Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add enabled parameter to nova::controller

This commit add the config param enabled to the nova::controller class.

This parameter is used to determine if the installation of the controller
node should be an active or passive installation for active-passive clustering.
  • Loading branch information...
commit aa2b981aeaea9ebb209174df6ede609ad662447f 1 parent 327c374
Dan Bode authored

Showing 1 changed file with 71 additions and 46 deletions. Show diff stats Hide diff stats

  1. +71 46 manifests/controller.pp
117 manifests/controller.pp
@@ -2,7 +2,7 @@
2 2 # This can be used to build out the simplest openstack controller
3 3 #
4 4 #
5   -# $export_resources - rather resources should be exported
  5 +# $export_resources - Whether resources should be exported
6 6 #
7 7 # [public_interface] Public interface used to route public traffic. Required.
8 8 # [public_address] Public address for public endpoints. Required.
@@ -43,6 +43,8 @@
43 43 # Each app is defined in two parts, the display name, and the URI
44 44 # [horizon_app_links] array as in '[ ["Nagios","http://nagios_addr:port/path"],["Ganglia","http://ganglia_addr"] ]'
45 45 #
  46 +# [enabled] Whether services should be enabled. This parameter can be used to
  47 +# implement services in active-passive modes for HA. Optional. Defaults to true.
46 48 class openstack::controller(
47 49 # my address
48 50 $public_address,
@@ -84,6 +86,7 @@
84 86 $swift = false,
85 87 $quantum = false,
86 88 $horizon_app_links = false,
  89 + $enabled = true
87 90 ) {
88 91
89 92 $glance_api_servers = "${internal_address}:9292"
@@ -116,21 +119,25 @@
116 119 # TODO I should make sure that this works
117 120 # 'root_password' => $mysql_root_password,
118 121 'bind_address' => '0.0.0.0'
119   - }
120   - }
121   - # set up all openstack databases, users, grants
122   - class { 'keystone::db::mysql':
123   - password => $keystone_db_password,
  122 + },
  123 + enabled => $enabled,
124 124 }
125   - class { 'glance::db::mysql':
126   - host => '127.0.0.1',
127   - password => $glance_db_password,
128   - }
129   - # TODO should I allow all hosts to connect?
130   - class { 'nova::db::mysql':
131   - password => $nova_db_password,
132   - host => $internal_address,
133   - allowed_hosts => '%',
  125 + if ($enabled) {
  126 + # set up all openstack databases, users, grants
  127 + class { 'keystone::db::mysql':
  128 + password => $keystone_db_password,
  129 + }
  130 + Class['glance::db::mysql'] -> Class['glance::registry']
  131 + class { 'glance::db::mysql':
  132 + host => '127.0.0.1',
  133 + password => $glance_db_password,
  134 + }
  135 + # TODO should I allow all hosts to connect?
  136 + class { 'nova::db::mysql':
  137 + password => $nova_db_password,
  138 + host => $internal_address,
  139 + allowed_hosts => '%',
  140 + }
134 141 }
135 142
136 143 ####### KEYSTONE ###########
@@ -144,36 +151,42 @@
144 151 log_verbose => $verbose,
145 152 log_debug => $verbose,
146 153 catalog_type => 'sql',
  154 + enabled => $enabled,
147 155 }
148 156 # set up keystone database
149 157 # set up the keystone config for mysql
150 158 class { 'keystone::config::mysql':
151 159 password => $keystone_db_password,
152 160 }
153   - # set up keystone admin users
154   - class { 'keystone::roles::admin':
155   - email => $admin_email,
156   - password => $admin_password,
157   - }
158   - # set up the keystone service and endpoint
159   - class { 'keystone::endpoint':
160   - public_address => $public_address,
161   - internal_address => $internal_address,
162   - admin_address => $admin_address,
163   - }
164   - # set up glance service,user,endpoint
165   - class { 'glance::keystone::auth':
166   - password => $glance_user_password,
167   - public_address => $public_address,
168   - internal_address => $internal_address,
169   - admin_address => $admin_address,
170   - }
171   - # set up nova serice,user,endpoint
172   - class { 'nova::keystone::auth':
173   - password => $nova_user_password,
174   - public_address => $public_address,
175   - internal_address => $internal_address,
176   - admin_address => $admin_address,
  161 +
  162 + if ($enabled) {
  163 + # set up keystone admin users
  164 + class { 'keystone::roles::admin':
  165 + email => $admin_email,
  166 + password => $admin_password,
  167 + }
  168 + # set up the keystone service and endpoint
  169 + class { 'keystone::endpoint':
  170 + public_address => $public_address,
  171 + internal_address => $internal_address,
  172 + admin_address => $admin_address,
  173 + }
  174 + # set up glance service,user,endpoint
  175 + class { 'glance::keystone::auth':
  176 + password => $glance_user_password,
  177 + public_address => $public_address,
  178 + internal_address => $internal_address,
  179 + admin_address => $admin_address,
  180 + before => [Class['glance::api'], Class['glance::registry']]
  181 + }
  182 + # set up nova serice,user,endpoint
  183 + class { 'nova::keystone::auth':
  184 + password => $nova_user_password,
  185 + public_address => $public_address,
  186 + internal_address => $internal_address,
  187 + admin_address => $admin_address,
  188 + before => Class['nova::api'],
  189 + }
177 190 }
178 191
179 192 ######## END KEYSTONE ##########
@@ -190,7 +203,7 @@
190 203 keystone_tenant => 'services',
191 204 keystone_user => 'glance',
192 205 keystone_password => $glance_user_password,
193   - require => Keystone_user_role["glance@services"],
  206 + enabled => $enabled,
194 207 }
195 208 class { 'glance::backend::file': }
196 209
@@ -204,7 +217,7 @@
204 217 keystone_user => 'glance',
205 218 keystone_password => $glance_user_password,
206 219 sql_connection => "mysql://glance:${glance_db_password}@127.0.0.1/glance",
207   - require => [Class['Glance::Db::Mysql'], Keystone_user_role['glance@services']]
  220 + enabled => $enabled,
208 221 }
209 222
210 223 ######## END GLANCE ###########
@@ -215,6 +228,7 @@
215 228 class { 'nova::rabbitmq':
216 229 userid => $rabbit_user,
217 230 password => $rabbit_password,
  231 + enabled => $enabled,
218 232 }
219 233
220 234 # TODO I may need to figure out if I need to set the connection information
@@ -231,7 +245,7 @@
231 245 }
232 246
233 247 class { 'nova::api':
234   - enabled => true,
  248 + enabled => $enabled,
235 249 # TODO this should be the nova service credentials
236 250 #admin_tenant_name => 'openstack',
237 251 #admin_user => 'admin',
@@ -239,7 +253,6 @@
239 253 admin_tenant_name => 'services',
240 254 admin_user => 'nova',
241 255 admin_password => $nova_user_password,
242   - require => Keystone_user_role["nova@services"],
243 256 }
244 257
245 258 class { [
@@ -249,14 +262,24 @@
249 262 'nova::objectstore',
250 263 'nova::vncproxy'
251 264 ]:
252   - enabled => true,
  265 + enabled => $enabled,
253 266 }
254 267
255 268 if $multi_host {
256 269 nova_config { 'multi_host': value => 'True'; }
257 270 $enable_network_service = false
258 271 } else {
259   - $enable_network_service = true
  272 + if $enabled == true {
  273 + $enable_network_service = true
  274 + } else {
  275 + $enable_network_service = false
  276 + }
  277 + }
  278 +
  279 + if $enabled {
  280 + $really_create_networks = $create_networks
  281 + } else {
  282 + $really_create_networks = false
260 283 }
261 284
262 285 # set up networking
@@ -267,7 +290,7 @@
267 290 floating_range => $floating_range,
268 291 network_manager => $network_manager,
269 292 config_overrides => $network_config,
270   - create_networks => $create_networks,
  293 + create_networks => $really_create_networks,
271 294 num_networks => $num_networks,
272 295 enabled => $enable_network_service,
273 296 install_service => $enable_network_service,
@@ -279,6 +302,8 @@
279 302
280 303 ######## Horizon ########
281 304
  305 + # TOOO - what to do about HA for horizon?
  306 +
282 307 class { 'memcached':
283 308 listen_ip => '127.0.0.1',
284 309 }

0 comments on commit aa2b981

Please sign in to comment.
Something went wrong with that request. Please try again.