staypuft 0.1.11 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZjMyMjI1NjU5ZDUzZDQwMTM3NTYwMGJkNDEwZWU3ZDk4MWM2NjkxOA==
5
- data.tar.gz: !binary |-
6
- YjVkNzI2YTc3YWE5MzZhYTcwMDJhYjhhNmIzMjNhYTQwYjNjMzFiMg==
2
+ SHA1:
3
+ metadata.gz: 3386cee555561d013c4968867cb54660088bba35
4
+ data.tar.gz: a2ac68c76e051ea923e3998ccaa220ec50642597
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NmZlNTAwZTcwODIxMDczYzMxZTE0OTY1NjE3OTI5YjlmNjU0YmM4ZGNjZjEx
10
- MTRkMDQ5NjJlMTk1MjZkNTQ5NmFmNmIwMTNjNzcyNjdhYzFiMDk0ZjgwMGMw
11
- ZDZmM2VlNDczNzBmOGI5MzFmZTBhNmJkMDY3YWYxYmZmZWI2MDk=
12
- data.tar.gz: !binary |-
13
- ZmE3ZGE4MDYwMTllZWY3OGExMDY1MTA1N2MyZTIwZjBkMWYxMGVhZGFkMmI0
14
- NDcwY2Q1OTNkMTVmMDUyMWM1MjY0MWY0MzUwOGU0NGQ0NWQxZDQ4ZjIyMTEx
15
- YTNkZWQxOTg1OGViMWIyZDc3NWMzYzM4M2ZhNzIxMWRiMTRlMDg=
6
+ metadata.gz: 72bd5a3ba9c0fe7fb6e9817aec46b6c1c56195273bc41497a3b09f2b7505e6c737eae5c52bcd92a2a0929be4a79967d8d4ef374608c9e0fd73d91972746753f8
7
+ data.tar.gz: 7526c87be767c0b690aa8960565ab975c1f737d5453fdc9552f40e14636492441202068b254c7109c03d1ca4ae5ea96dbb094f9a22a41ed80f91b1d7ac4dc34c
@@ -15,8 +15,13 @@ module Staypuft
15
15
 
16
16
  def show
17
17
  @deployment = Deployment.find(params[:id])
18
- @hostgroup = ::Hostgroup.find_by_id(params[:hostgroup_id]) ||
19
- @deployment.child_hostgroups.deploy_order.first
18
+ respond_to do | format |
19
+ format.html do
20
+ @hostgroup = ::Hostgroup.find_by_id(params[:hostgroup_id]) ||
21
+ @deployment.child_hostgroups.deploy_order.first
22
+ end
23
+ format.js {}
24
+ end
20
25
  end
21
26
 
22
27
  def summary
@@ -9,6 +9,10 @@ module Staypuft
9
9
  case step
10
10
  when :deployment_settings
11
11
  @layouts = ordered_layouts
12
+ when :services_overview
13
+ if !@deployment.ha? && @deployment.cinder.lvm_ptable.nil?
14
+ flash[:warning] = "Missing Partition Table 'LVM with cinder-volumes', LVM cinder backend won't work."
15
+ end
12
16
  when :services_configuration
13
17
  @services_map = [:nova, :neutron, :glance, :cinder]
14
18
  end
@@ -1,11 +1,41 @@
1
1
  module Staypuft
2
2
  class DeploymentParamExporter
3
+
4
+ NAME = :name
5
+ DESCRIPTION = :description
6
+ UI_PARAMS = "ui_params"
7
+
8
+ PUPPET_PARAMS = "puppet_params"
9
+ SERVICES = "services"
10
+ SERVICE_NAME = "name"
11
+ SERVICE_PARAMS = "params"
12
+
13
+ PARAM_KEY = "key"
14
+ PARAM_ROLE = "role"
15
+ PARAM_PUPPETCLASS = "puppetclass"
16
+ PARAM_VALUE = "value"
3
17
  def initialize(deployment)
4
18
  @deployment = deployment
5
19
  end
6
20
 
7
21
  def to_hash
8
- {"deployment" => {"name" => @deployment.name, "services" => services}}
22
+ {"deployment" => {NAME.to_s => @deployment.send(NAME),
23
+ DESCRIPTION.to_s => @deployment.send(DESCRIPTION),
24
+ UI_PARAMS => ui_params,
25
+ PUPPET_PARAMS => puppet_params} }
26
+ end
27
+
28
+ def ui_params
29
+ param_hash = {}
30
+ services_hash = {}
31
+ Deployment::EXPORT_PARAMS.each {|param| param_hash[param.to_s] = @deployment.send(param)}
32
+ Deployment::EXPORT_SERVICES.each {|param| services_hash[param.to_s] = @deployment.send(param).param_hash}
33
+ param_hash[SERVICES.to_s] = services_hash
34
+ param_hash
35
+ end
36
+
37
+ def puppet_params
38
+ { SERVICES => services }
9
39
  end
10
40
 
11
41
  def services
@@ -13,7 +43,7 @@ module Staypuft
13
43
  end
14
44
 
15
45
  def service(one_service, hostgroup)
16
- { 'name' => one_service.name, 'params' => params(one_service, hostgroup) }
46
+ { SERVICE_NAME => one_service.name, SERVICE_PARAMS => params(one_service, hostgroup) }
17
47
  end
18
48
 
19
49
  def params(one_service, hostgroup)
@@ -27,10 +57,10 @@ module Staypuft
27
57
  # force encoding needed to prevent to_yaml from outputting some strings as binary
28
58
  value.force_encoding("UTF-8") if value.is_a? String
29
59
 
30
- { 'key' => param_hash[:param_key].key,
31
- 'role' => param_hash[:role].name,
32
- 'puppetclass' => param_hash[:puppetclass].name,
33
- 'value' => value }
60
+ { PARAM_KEY => param_hash[:param_key].key,
61
+ PARAM_ROLE => param_hash[:role].name,
62
+ PARAM_PUPPETCLASS => param_hash[:puppetclass].name,
63
+ PARAM_VALUE => value }
34
64
  end
35
65
 
36
66
  end
@@ -10,15 +10,47 @@ module Staypuft
10
10
  if !in_hash.is_a?(Hash) || ((deployment_node = in_hash['deployment']).nil?)
11
11
  raise ArgumentError, "Invalid import file: no 'deployment' node found"
12
12
  end
13
- unless deployment_node.nil? || (services = deployment_node['services']).nil?
14
- services.each do |service_hash|
15
- handle_service(service_hash, hostgroups, puppetclasses)
13
+ # We don't import name/description to avoid conflict with existing deployments
14
+ if (ui_params = deployment_node[DeploymentParamExporter::UI_PARAMS])
15
+ handle_obj_params(ui_params, @deployment, Deployment::EXPORT_PARAMS)
16
+ if (ui_services = ui_params[DeploymentParamExporter::SERVICES])
17
+ handle_ui_services(ui_services, @deployment, Deployment::EXPORT_SERVICES)
18
+ end
19
+ end
20
+ @deployment.save!
21
+
22
+ handle_services(deployment_node, hostgroups, puppetclasses)
23
+ end
24
+
25
+ def handle_ui_services(services_node, obj, service_list)
26
+ service_list.each do |service_name|
27
+ if (service_node = services_node[service_name.to_s])
28
+ service_obj = obj.send(service_name)
29
+ handle_obj_params(service_node, service_obj, service_obj.param_hash.keys)
30
+ end
31
+ end
32
+ end
33
+
34
+ def handle_obj_params(node, obj, param_list)
35
+ param_list.each do |param_name|
36
+ param_value = node[param_name.to_s]
37
+ obj.send(param_name.to_s+"=",param_value) if param_value
38
+ end
39
+ end
40
+
41
+ def handle_services(deployment_node, hostgroups, puppetclasses)
42
+ unless deployment_node.nil? || (puppet_params = deployment_node[DeploymentParamExporter::PUPPET_PARAMS]).nil?
43
+ services = puppet_params[DeploymentParamExporter::SERVICES]
44
+ if services
45
+ services.each do |service_hash|
46
+ handle_service(service_hash, hostgroups, puppetclasses)
47
+ end
16
48
  end
17
49
  end
18
50
  end
19
51
 
20
52
  def handle_service(service_hash, hostgroups, puppetclasses)
21
- unless (service_params = service_hash['params']).nil?
53
+ unless (service_params = service_hash[DeploymentParamExporter::SERVICE_PARAMS]).nil?
22
54
  service_params.each do |param_hash|
23
55
  handle_param(param_hash, hostgroups, puppetclasses)
24
56
  end
@@ -26,17 +58,17 @@ module Staypuft
26
58
  end
27
59
 
28
60
  def handle_param(param_hash, hostgroups, puppetclasses)
29
- hostgroup = hostgroups[param_hash['role']]
61
+ hostgroup = hostgroups[param_hash[DeploymentParamExporter::PARAM_ROLE]]
30
62
  if hostgroup.nil?
31
63
  drh = DeploymentRoleHostgroup.includes(:hostgroup, :role).
32
64
  where(:deployment_id => @deployment.id,
33
- "staypuft_roles.name" => param_hash['role']).first
65
+ "staypuft_roles.name" => param_hash[DeploymentParamExporter::PARAM_ROLE]).first
34
66
  hostgroup = drh.hostgroup unless drh.nil?
35
67
  end
36
- puppetclass = (puppetclasses[param_hash['puppetclass']] ||=
37
- Puppetclass.where(:name => param_hash['puppetclass']).first)
38
- key = param_hash['key']
39
- value = param_hash['value']
68
+ puppetclass = (puppetclasses[param_hash[DeploymentParamExporter::PARAM_PUPPETCLASS]] ||=
69
+ Puppetclass.where(:name => param_hash[DeploymentParamExporter::PARAM_PUPPETCLASS]).first)
70
+ key = param_hash[DeploymentParamExporter::PARAM_KEY]
71
+ value = param_hash[DeploymentParamExporter::PARAM_VALUE]
40
72
  # skip if either hostgroup or puppetclass are nil
41
73
  unless hostgroup.nil? || puppetclass.nil? || key.nil? || value.nil?
42
74
  hostgroup.set_param_value_if_changed(puppetclass,
@@ -21,11 +21,6 @@ module Staypuft
21
21
  'swift_ext4_device' => '/dev/sdc2',
22
22
  'swift_local_interface' => 'eth3',
23
23
  'swift_loopback' => true,
24
- 'swift_ring_server' => '192.168.203.1',
25
- 'controller_admin_host' => '172.16.0.1',
26
- 'controller_priv_host' => '172.16.0.1',
27
- 'controller_pub_host' => '172.16.1.1',
28
- 'mysql_host' => '172.16.0.1',
29
24
  'mysql_virtual_ip' => '192.168.200.220',
30
25
  'mysql_bind_address' => '0.0.0.0',
31
26
  'mysql_virt_ip_nic' => 'eth1',
@@ -34,7 +29,6 @@ module Staypuft
34
29
  'mysql_shared_storage_type' => 'nfs',
35
30
  'mysql_resource_group_name' => 'mysqlgrp',
36
31
  'mysql_clu_member_addrs' => '192.168.203.11 192.168.203.12 192.168.203.13',
37
- 'amqp_host' => '172.16.0.1',
38
32
  'amqp_username' => 'openstack',
39
33
  'admin_email' => "admin@#{Facter.value(:domain)}",
40
34
  'enable_ovs_agent' => 'true',
@@ -43,14 +37,12 @@ module Staypuft
43
37
  'auto_assign_floating_ip' => 'true',
44
38
  'cisco_vswitch_plugin' => 'neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2',
45
39
  'cisco_nexus_plugin' => 'neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin',
46
- 'nexus_config' => {},
40
+ 'nexus_config' => { :hash => {}},
47
41
  'nexus_credentials' => [],
48
42
  'provider_vlan_auto_create' => 'false',
49
43
  'provider_vlan_auto_trunk' => 'false',
50
44
  'backend_server_names' => [],
51
45
  'backend_server_addrs' => [],
52
- 'lb_backend_server_names' => [],
53
- 'lb_backend_server_addrs' => [],
54
46
  'configure_ovswitch' => 'true',
55
47
  'neutron' => 'false',
56
48
  'ssl' => 'false',
@@ -160,45 +152,54 @@ module Staypuft
160
152
 
161
153
  CONTROLLER_ROLES = ROLES.select { |h| h.fetch(:name) =~ /Controller/ }
162
154
 
155
+ def get_host_format(param_name)
156
+ { :string => '<%%= d = @host.deployment; d.ha? ? d.vips.get(:%s) : d.ips.controller_ip %%>' % param_name }
157
+ end
158
+
159
+ # virtual ip addresses
160
+ def vip_format(param_name)
161
+ { :string => '<%%= @host.deployment.vips.get(:%s) %%>' % param_name }
162
+ end
163
163
 
164
164
  def functional_dependencies
165
- amqp_provider = '<%= @host.deployment.amqp_provider %>'
166
- neutron = '<%= @host.deployment.neutron_networking? %>'
165
+ amqp_provider = { :string => '<%= @host.deployment.amqp_provider %>' }
166
+ neutron = { :string => '<%= @host.deployment.neutron_networking? %>' }
167
+ ceilometer = { :string => '<%= @host.deployment.non_ha? %>' }
167
168
 
168
169
  # Nova
169
- network_manager = '<%= @host.deployment.nova.network_manager %>'
170
+ network_manager = { :string => '<%= @host.deployment.nova.network_manager %>' }
170
171
  # multi_host handled inline, since it's two separate static values 'true' and 'True'
171
- network_overrides = '<%= @host.deployment.nova.network_overrides %>'
172
- network_num_networks = '<%= @host.deployment.nova.num_networks %>'
173
- network_fixed_range = '<%= @host.deployment.nova.private_fixed_range %>'
174
- network_floating_range = '<%= @host.deployment.nova.public_floating_range %>'
175
- network_private_iface = '<%= @host.deployment.nova.compute_tenant_interface %>'
176
- network_public_iface = '<%= @host.deployment.nova.external_interface_name %>'
172
+ network_overrides = { :hash => '<%= @host.deployment.nova.network_overrides %>' }
173
+ network_num_networks = { :string => '<%= @host.deployment.nova.num_networks %>' }
174
+ network_fixed_range = { :string => '<%= @host.deployment.nova.private_fixed_range %>' }
175
+ network_floating_range = { :string => '<%= @host.deployment.nova.public_floating_range %>' }
176
+ network_private_iface = { :string => '<%= @host.deployment.nova.compute_tenant_interface %>' }
177
+ network_public_iface = { :string => '<%= @host.deployment.nova.external_interface_name %>' }
177
178
  network_create_networks = true
178
179
 
179
180
  # Neutron
180
- ovs_vlan_ranges = '<%= @host.deployment.neutron.networker_vlan_ranges %>'
181
- compute_ovs_vlan_ranges = '<%= @host.deployment.neutron.compute_vlan_ranges %>'
181
+ ovs_vlan_ranges = { :array => '<%= @host.deployment.neutron.networker_vlan_ranges %>' }
182
+ compute_ovs_vlan_ranges = { :array => '<%= @host.deployment.neutron.compute_vlan_ranges %>' }
182
183
  ml2_network_vlan_ranges = ovs_vlan_ranges
183
184
  ml2_tenant_network_types = ['<%= @host.deployment.neutron.network_segmentation %>']
184
185
  ml2_tunnel_id_ranges = ['10:100000']
185
186
  ml2_vni_ranges = ['10:100000']
186
187
  ovs_tunnel_types = ['vxlan', 'gre']
187
- ovs_tunnel_iface = '<%= n = @host.deployment.neutron; n.enable_tunneling? ? n.networker_tenant_interface : "" %>'
188
- ovs_bridge_mappings = '<%= @host.deployment.neutron.networker_ovs_bridge_mappings %>'
189
- ovs_bridge_uplinks = '<%= @host.deployment.neutron.networker_ovs_bridge_uplinks %>'
190
- compute_ovs_tunnel_iface = '<%= n = @host.deployment.neutron; n.enable_tunneling? ? n.compute_tenant_interface : "" %>'
191
- compute_ovs_bridge_mappings = '<%= @host.deployment.neutron.compute_ovs_bridge_mappings %>'
192
- compute_ovs_bridge_uplinks = '<%= @host.deployment.neutron.compute_ovs_bridge_uplinks %>'
193
- enable_tunneling = '<%= @host.deployment.neutron.enable_tunneling?.to_s %>'
188
+ ovs_tunnel_iface = { :string => '<%= n = @host.deployment.neutron; n.enable_tunneling? ? n.networker_tenant_interface : "" %>' }
189
+ ovs_bridge_mappings = { :array => '<%= @host.deployment.neutron.networker_ovs_bridge_mappings %>' }
190
+ ovs_bridge_uplinks = { :array => '<%= @host.deployment.neutron.networker_ovs_bridge_uplinks %>' }
191
+ compute_ovs_tunnel_iface = { :string => '<%= n = @host.deployment.neutron; n.enable_tunneling? ? n.compute_tenant_interface : "" %>' }
192
+ compute_ovs_bridge_mappings = { :array => '<%= @host.deployment.neutron.compute_ovs_bridge_mappings %>' }
193
+ compute_ovs_bridge_uplinks = { :array => '<%= @host.deployment.neutron.compute_ovs_bridge_uplinks %>' }
194
+ enable_tunneling = { :string => '<%= @host.deployment.neutron.enable_tunneling?.to_s %>' }
194
195
 
195
196
  # Glance
196
197
  backend = 'file'
197
- pcmk_fs_type = '<%= @host.deployment.glance.driver_backend %>'
198
- pcmk_fs_device = '<%= @host.deployment.glance.pcmk_fs_device %>'
199
- pcmk_fs_dir = '<%= @host.deployment.glance.pcmk_fs_dir %>'
198
+ pcmk_fs_type = { :string => '<%= @host.deployment.glance.driver_backend %>' }
199
+ pcmk_fs_device = { :string => '<%= @host.deployment.glance.pcmk_fs_device %>' }
200
+ pcmk_fs_dir = '/var/lib/glance/images'
200
201
  pcmk_fs_manage = 'true'
201
- pcmk_fs_options = '<%= @host.deployment.glance.pcmk_fs_options %>'
202
+ pcmk_fs_options = { :string => '<%= @host.deployment.glance.pcmk_fs_options %>' }
202
203
  glance_rbd_store_user = 'glance'
203
204
  glance_rbd_store_pool = 'images'
204
205
 
@@ -206,15 +207,15 @@ module Staypuft
206
207
  volume = true
207
208
  cinder_backend_gluster = false
208
209
  cinder_backend_gluster_name = 'gluster_backend'
209
- cinder_backend_iscsi = '<%= @host.deployment.cinder.lvm_backend? %>'
210
+ cinder_backend_iscsi = { :string => '<%= @host.deployment.cinder.lvm_backend? %>' }
210
211
  cinder_backend_iscsi_name = 'iscsi_backend'
211
- cinder_backend_nfs = '<%= @host.deployment.cinder.nfs_backend? %>'
212
+ cinder_backend_nfs = { :string => '<%= @host.deployment.cinder.nfs_backend? %>' }
212
213
  cinder_backend_nfs_name = 'nfs_backend'
213
214
  cinder_multiple_backends = false
214
215
  cinder_nfs_shares = ['<%= @host.deployment.cinder.nfs_uri %>']
215
216
  cinder_nfs_mount_options = ''
216
217
 
217
- cinder_backend_rbd = '<%= @host.deployment.cinder.ceph_backend? %>'
218
+ cinder_backend_rbd = { :string => '<%= @host.deployment.cinder.ceph_backend? %>' }
218
219
  cinder_backend_rbd_name = 'rbd_backend'
219
220
  # TODO: confirm these params and add them to model where user input is needed
220
221
  cinder_rbd_pool = 'volumes'
@@ -224,7 +225,7 @@ module Staypuft
224
225
  cinder_rbd_user = 'cinder'
225
226
  cinder_rbd_secret_uuid = ''
226
227
 
227
- cinder_backend_eqlx = '<%= @host.deployment.cinder.equallogic_backend? %>'
228
+ cinder_backend_eqlx = { :string => '<%= @host.deployment.cinder.equallogic_backend? %>' }
228
229
  cinder_backend_eqlx_name = ['eqlx_backend']
229
230
  # TODO: confirm these params and add them to model where user input is needed
230
231
  # below dynamic calls are commented out since the model does not yet have san/chap entries
@@ -241,47 +242,44 @@ module Staypuft
241
242
 
242
243
  # effective_value grabs shared password if deployment is in shared password mode,
243
244
  # otherwise use the service-specific one
244
- admin_pw = '<%= @host.deployment.passwords.effective_value(:admin) %>'
245
- ceilometer_user_pw = '<%= @host.deployment.passwords.effective_value(:ceilometer_user) %>'
246
- cinder_db_pw = '<%= @host.deployment.passwords.effective_value(:cinder_db) %>'
247
- cinder_user_pw = '<%= @host.deployment.passwords.effective_value(:cinder_user) %>'
248
- glance_db_pw = '<%= @host.deployment.passwords.effective_value(:glance_db) %>'
249
- glance_user_pw = '<%= @host.deployment.passwords.effective_value(:glance_user) %>'
250
- heat_db_pw = '<%= @host.deployment.passwords.effective_value(:heat_db) %>'
251
- heat_user_pw = '<%= @host.deployment.passwords.effective_value(:heat_user) %>'
252
- heat_cfn_user_pw = '<%= @host.deployment.passwords.effective_value(:heat_cfn_user) %>'
253
- keystone_db_pw = '<%= @host.deployment.passwords.effective_value(:keystone_db) %>'
254
- keystone_user_pw = '<%= @host.deployment.passwords.effective_value(:keystone_user) %>'
255
- mysql_root_pw = '<%= @host.deployment.passwords.effective_value(:mysql_root) %>'
256
- neutron_db_pw = '<%= @host.deployment.passwords.effective_value(:neutron_db) %>'
257
- neutron_user_pw = '<%= @host.deployment.passwords.effective_value(:neutron_user) %>'
258
- nova_db_pw = '<%= @host.deployment.passwords.effective_value(:nova_db) %>'
259
- nova_user_pw = '<%= @host.deployment.passwords.effective_value(:nova_user) %>'
260
- swift_admin_pw = '<%= @host.deployment.passwords.effective_value(:swift_admin) %>'
261
- swift_user_pw = '<%= @host.deployment.passwords.effective_value(:swift_user) %>'
262
- amqp_pw = '<%= @host.deployment.passwords.effective_value(:amqp) %>'
263
- amqp_nssdb_pw = '<%= @host.deployment.passwords.effective_value(:amqp_nssdb) %>'
264
- keystone_admin_token = '<%= @host.deployment.passwords.effective_value(:keystone_admin_token) %>'
245
+ admin_pw = { :string => '<%= @host.deployment.passwords.effective_value(:admin) %>' }
246
+ ceilometer_user_pw = { :string => '<%= @host.deployment.passwords.effective_value(:ceilometer_user) %>' }
247
+ cinder_db_pw = { :string => '<%= @host.deployment.passwords.effective_value(:cinder_db) %>' }
248
+ cinder_user_pw = { :string => '<%= @host.deployment.passwords.effective_value(:cinder_user) %>' }
249
+ glance_db_pw = { :string => '<%= @host.deployment.passwords.effective_value(:glance_db) %>' }
250
+ glance_user_pw = { :string => '<%= @host.deployment.passwords.effective_value(:glance_user) %>' }
251
+ heat_db_pw = { :string => '<%= @host.deployment.passwords.effective_value(:heat_db) %>' }
252
+ heat_user_pw = { :string => '<%= @host.deployment.passwords.effective_value(:heat_user) %>' }
253
+ heat_cfn_user_pw = { :string => '<%= @host.deployment.passwords.effective_value(:heat_cfn_user) %>' }
254
+ keystone_db_pw = { :string => '<%= @host.deployment.passwords.effective_value(:keystone_db) %>' }
255
+ keystone_user_pw = { :string => '<%= @host.deployment.passwords.effective_value(:keystone_user) %>' }
256
+ mysql_root_pw = { :string => '<%= @host.deployment.passwords.effective_value(:mysql_root) %>' }
257
+ neutron_db_pw = { :string => '<%= @host.deployment.passwords.effective_value(:neutron_db) %>' }
258
+ neutron_user_pw = { :string => '<%= @host.deployment.passwords.effective_value(:neutron_user) %>' }
259
+ nova_db_pw = { :string => '<%= @host.deployment.passwords.effective_value(:nova_db) %>' }
260
+ nova_user_pw = { :string => '<%= @host.deployment.passwords.effective_value(:nova_user) %>' }
261
+ swift_admin_pw = { :string => '<%= @host.deployment.passwords.effective_value(:swift_admin) %>' }
262
+ swift_user_pw = { :string => '<%= @host.deployment.passwords.effective_value(:swift_user) %>' }
263
+ amqp_pw = { :string => '<%= @host.deployment.passwords.effective_value(:amqp) %>' }
264
+ amqp_nssdb_pw = { :string => '<%= @host.deployment.passwords.effective_value(:amqp_nssdb) %>' }
265
+ keystone_admin_token = { :string => '<%= @host.deployment.passwords.effective_value(:keystone_admin_token) %>' }
265
266
 
266
267
  #these don't share the user-supplied password value; they're always a random per param value
267
- ceilometer_metering = '<%= @host.deployment.passwords.ceilometer_metering_secret %>'
268
- heat_auth_encrypt_key = '<%= @host.deployment.passwords.heat_auth_encrypt_key %>'
269
- horizon_secret_key = '<%= @host.deployment.passwords.horizon_secret_key %>'
270
- swift_shared_secret = '<%= @host.deployment.passwords.swift_shared_secret %>'
271
- neutron_metadata_proxy_secret = '<%= @host.deployment.passwords.neutron_metadata_proxy_secret %>'
268
+ ceilometer_metering = { :string => '<%= @host.deployment.passwords.ceilometer_metering_secret %>' }
269
+ heat_auth_encrypt_key = { :string => '<%= @host.deployment.passwords.heat_auth_encrypt_key %>' }
270
+ horizon_secret_key = { :string => '<%= @host.deployment.passwords.horizon_secret_key %>' }
271
+ swift_shared_secret = { :string => '<%= @host.deployment.passwords.swift_shared_secret %>' }
272
+ neutron_metadata_proxy_secret = { :string => '<%= @host.deployment.passwords.neutron_metadata_proxy_secret %>' }
272
273
 
273
- # virtual ip addresses
274
- vip_format = '<%%= @host.deployment.vips.get(:%s) %%>'
275
- get_host_format = '<%%= d = @host.deployment; d.ha? ? d.vips.get(:%s) : d.ips.controller_ip %%>'
276
274
 
277
- amqp_host = get_host_format % :amqp
278
- mysql_host = get_host_format % :db
279
- glance_host = get_host_format % :glance
280
- auth_host = get_host_format % :keystone
281
- neutron_host = get_host_format % :neutron
282
- nova_host = get_host_format % :nova
275
+ amqp_host = get_host_format :amqp
276
+ mysql_host = get_host_format :db
277
+ glance_host = get_host_format :glance
278
+ auth_host = get_host_format :keystone
279
+ neutron_host = get_host_format :neutron
280
+ nova_host = get_host_format :nova
283
281
 
284
- controller_host = '<%= d = @host.deployment; d.ha? ? nil : d.ips.controller_ip %>'
282
+ controller_host = { :string => '<%= d = @host.deployment; d.ha? ? nil : d.ips.controller_ip %>'}
285
283
 
286
284
  {
287
285
  'quickstack::nova_network::controller' => {
@@ -340,7 +338,7 @@ module Staypuft
340
338
  'mysql_host' => mysql_host,
341
339
  'swift_shared_secret' => swift_shared_secret,
342
340
  'swift_ringserver_ip' => '',
343
- 'swift_storage_ips' => '<%= @host.deployment.ips.controller_ips %>',
341
+ 'swift_storage_ips' => { :array => '<%= @host.deployment.ips.controller_ips %>' },
344
342
  'cinder_nfs_shares' => [],
345
343
  'cinder_gluster_shares' => [],
346
344
  'controller_admin_host' => controller_host,
@@ -412,13 +410,14 @@ module Staypuft
412
410
  'mysql_host' => mysql_host,
413
411
  'swift_shared_secret' => swift_shared_secret,
414
412
  'swift_ringserver_ip' => '',
415
- 'swift_storage_ips' => '<%= @host.deployment.ips.controller_ips %>',
413
+ 'swift_storage_ips' => { :array => '<%= @host.deployment.ips.controller_ips %>' },
416
414
  'cinder_nfs_shares' => [],
417
415
  'cinder_gluster_shares' => [],
418
416
  'controller_admin_host' => controller_host,
419
417
  'controller_priv_host' => controller_host,
420
418
  'controller_pub_host' => controller_host },
421
419
  'quickstack::pacemaker::params' => {
420
+ 'include_swift' => 'false',
422
421
  'include_neutron' => neutron,
423
422
  'neutron' => neutron,
424
423
  'ceilometer_user_password' => ceilometer_user_pw,
@@ -435,46 +434,47 @@ module Staypuft
435
434
  'neutron_user_password' => neutron_user_pw,
436
435
  'nova_db_password' => nova_db_pw,
437
436
  'nova_user_password' => nova_user_pw,
437
+ 'amqp_provider' => amqp_provider,
438
438
  'amqp_password' => amqp_pw,
439
439
  'heat_auth_encryption_key' => heat_auth_encrypt_key,
440
440
  'neutron_metadata_proxy_secret' => neutron_metadata_proxy_secret,
441
- 'ceilometer_admin_vip' => vip_format % :ceilometer,
442
- 'ceilometer_private_vip' => vip_format % :ceilometer,
443
- 'ceilometer_public_vip' => vip_format % :ceilometer,
444
- 'cinder_admin_vip' => vip_format % :cinder,
445
- 'cinder_private_vip' => vip_format % :cinder,
446
- 'cinder_public_vip' => vip_format % :cinder,
447
- 'db_vip' => vip_format % :db,
448
- 'glance_admin_vip' => vip_format % :glance,
449
- 'glance_private_vip' => vip_format % :glance,
450
- 'glance_public_vip' => vip_format % :glance,
451
- 'heat_admin_vip' => vip_format % :heat,
452
- 'heat_private_vip' => vip_format % :heat,
453
- 'heat_public_vip' => vip_format % :heat,
454
- 'heat_cfn_admin_vip' => vip_format % :heat_cfn,
455
- 'heat_cfn_private_vip' => vip_format % :heat_cfn,
456
- 'heat_cfn_public_vip' => vip_format % :heat_cfn,
457
- 'horizon_admin_vip' => vip_format % :horizon,
458
- 'horizon_private_vip' => vip_format % :horizon,
459
- 'horizon_public_vip' => vip_format % :horizon,
460
- 'keystone_admin_vip' => vip_format % :keystone,
461
- 'keystone_private_vip' => vip_format % :keystone,
462
- 'keystone_public_vip' => vip_format % :keystone,
463
- 'loadbalancer_vip' => vip_format % :loadbalancer,
464
- 'neutron_admin_vip' => vip_format % :neutron,
465
- 'neutron_private_vip' => vip_format % :neutron,
466
- 'neutron_public_vip' => vip_format % :neutron,
467
- 'nova_admin_vip' => vip_format % :nova,
468
- 'nova_private_vip' => vip_format % :nova,
469
- 'nova_public_vip' => vip_format % :nova,
470
- 'amqp_vip' => vip_format % :amqp,
471
- 'swift_public_vip' => vip_format % :swift,
472
- 'private_ip' => '<%= @host.ip %>',
473
- 'cluster_control_ip' => '<%= @host.deployment.ips.controller_ips.first %>',
474
- 'lb_backend_server_addrs' => '<%= @host.deployment.ips.controller_ips %>',
475
- 'lb_backend_server_names' => '<%= @host.deployment.ips.controller_fqdns %>' },
441
+ 'ceilometer_admin_vip' => vip_format(:ceilometer),
442
+ 'ceilometer_private_vip' => vip_format(:ceilometer),
443
+ 'ceilometer_public_vip' => vip_format(:ceilometer),
444
+ 'cinder_admin_vip' => vip_format(:cinder),
445
+ 'cinder_private_vip' => vip_format(:cinder),
446
+ 'cinder_public_vip' => vip_format(:cinder),
447
+ 'db_vip' => vip_format(:db),
448
+ 'glance_admin_vip' => vip_format(:glance),
449
+ 'glance_private_vip' => vip_format(:glance),
450
+ 'glance_public_vip' => vip_format(:glance),
451
+ 'heat_admin_vip' => vip_format(:heat),
452
+ 'heat_private_vip' => vip_format(:heat),
453
+ 'heat_public_vip' => vip_format(:heat),
454
+ 'heat_cfn_admin_vip' => vip_format(:heat_cfn),
455
+ 'heat_cfn_private_vip' => vip_format(:heat_cfn),
456
+ 'heat_cfn_public_vip' => vip_format(:heat_cfn),
457
+ 'horizon_admin_vip' => vip_format(:horizon),
458
+ 'horizon_private_vip' => vip_format(:horizon),
459
+ 'horizon_public_vip' => vip_format(:horizon),
460
+ 'keystone_admin_vip' => vip_format(:keystone),
461
+ 'keystone_private_vip' => vip_format(:keystone),
462
+ 'keystone_public_vip' => vip_format(:keystone),
463
+ 'loadbalancer_vip' => vip_format(:loadbalancer),
464
+ 'neutron_admin_vip' => vip_format(:neutron),
465
+ 'neutron_private_vip' => vip_format(:neutron),
466
+ 'neutron_public_vip' => vip_format(:neutron),
467
+ 'nova_admin_vip' => vip_format(:nova),
468
+ 'nova_private_vip' => vip_format(:nova),
469
+ 'nova_public_vip' => vip_format(:nova),
470
+ 'amqp_vip' => vip_format(:amqp),
471
+ 'swift_public_vip' => vip_format(:swift),
472
+ 'private_ip' => { :string => '<%= @host.ip %>' },
473
+ 'cluster_control_ip' => { :string => '<%= @host.deployment.ips.controller_ips.first %>' },
474
+ 'lb_backend_server_addrs' => { :array => '<%= @host.deployment.ips.controller_ips %>' },
475
+ 'lb_backend_server_names' => { :array => '<%= @host.deployment.ips.controller_fqdns %>' } },
476
476
  'quickstack::pacemaker::common' => {
477
- 'pacemaker_cluster_members' => '<%= @host.deployment.ips.controller_ips.join(" ") %>' },
477
+ 'pacemaker_cluster_members' => { :string => '<%= @host.deployment.ips.controller_ips.join(" ") %>' } },
478
478
  'quickstack::pacemaker::neutron' => {
479
479
  'ml2_network_vlan_ranges' => ml2_network_vlan_ranges,
480
480
  'ml2_tenant_network_types' => ml2_tenant_network_types,
@@ -523,10 +523,10 @@ module Staypuft
523
523
  'secret_key' => horizon_secret_key },
524
524
  'quickstack::pacemaker::galera' => {
525
525
  'mysql_root_password' => mysql_root_pw,
526
- 'wsrep_cluster_members' => '<%= @host.deployment.ips.controller_ips %>' },
526
+ 'wsrep_cluster_members' => { :array => '<%= @host.deployment.ips.controller_ips %>' } },
527
527
  'quickstack::pacemaker::swift' => {
528
528
  'swift_shared_secret' => swift_shared_secret,
529
- 'swift_internal_vip' => vip_format % :swift,
529
+ 'swift_internal_vip' => vip_format(:swift),
530
530
  'swift_storage_ips' => [] },
531
531
  'quickstack::pacemaker::nova' => {
532
532
  'multi_host' => 'true',
@@ -555,6 +555,7 @@ module Staypuft
555
555
  'amqp_password' => amqp_pw },
556
556
  'quickstack::nova_network::compute' => {
557
557
  'amqp_provider' => amqp_provider,
558
+ 'ceilometer' => ceilometer,
558
559
  'cinder_backend_gluster' => cinder_backend_gluster,
559
560
  'cinder_backend_nfs' => cinder_backend_nfs,
560
561
  'network_manager' => network_manager,
@@ -579,6 +580,7 @@ module Staypuft
579
580
  'nova_host' => nova_host },
580
581
  'quickstack::neutron::compute' => {
581
582
  'amqp_provider' => amqp_provider,
583
+ 'ceilometer' => ceilometer,
582
584
  'cinder_backend_gluster' => cinder_backend_gluster,
583
585
  'cinder_backend_nfs' => cinder_backend_nfs,
584
586
  'enable_tunneling' => enable_tunneling,
@@ -602,20 +604,27 @@ module Staypuft
602
604
  'neutron_host' => neutron_host,
603
605
  'nova_host' => nova_host },
604
606
  'quickstack::pacemaker::rsync::keystone' => {
605
- 'keystone_private_vip' => vip_format % :keystone } }
607
+ 'keystone_private_vip' => vip_format(:keystone) } }
606
608
  end
607
609
 
608
- def get_key_type(value)
610
+ def get_key_type_and_value(value)
609
611
  key_list = LookupKey::KEY_TYPES
610
- value_type = value.class.to_s.downcase
611
- if key_list.include?(value_type)
612
- value_type
613
- elsif [FalseClass, TrueClass].include? value.class
614
- 'boolean'
612
+ if value.class == Hash
613
+ key_type = value.keys.first.to_s
614
+ key_value = value.values.first
615
615
  else
616
- raise
616
+ key_value = value
617
+ value_type = value.class.to_s.downcase
618
+ if key_list.include?(value_type)
619
+ key_type = value_type
620
+ elsif [FalseClass, TrueClass].include? value.class
621
+ key_type = 'boolean'
622
+ else
623
+ raise
624
+ end
617
625
  end
618
626
  # If we need to handle actual number classes like Fixnum, add those here
627
+ [key_type, key_value]
619
628
  end
620
629
 
621
630
  def seed_layouts
@@ -689,8 +698,9 @@ module Staypuft
689
698
  map { |lk| lk.param_class.name }.inspect
690
699
  next
691
700
  end
692
- unless param.update_attributes default_value: default_value
693
- Rails.logger.error "param #{param_key} in #{puppetclass_name} default_value: #{default_value.inspect} is invalid"
701
+ param_type, param_value = get_key_type_and_value(default_value)
702
+ unless param.update_attributes key_type: param_type, default_value: param_value
703
+ Rails.logger.error "param #{param_key} in #{puppetclass_name} default_value: #{param_value.inspect} is invalid"
694
704
  end
695
705
  end
696
706
  end
@@ -714,8 +724,7 @@ module Staypuft
714
724
  def apply_astapor_defaults(puppet_class)
715
725
  puppet_class.class_params.each do |param|
716
726
  if ASTAPOR_PARAMS.include?(param.key)
717
- param.key_type = get_key_type(ASTAPOR_PARAMS[param.key])
718
- param.default_value = ASTAPOR_PARAMS[param.key]
727
+ param.key_type, param.default_value = get_key_type_and_value(ASTAPOR_PARAMS[param.key])
719
728
  end
720
729
  param.override = true
721
730
  param.save!
@@ -4,7 +4,8 @@ module Staypuft
4
4
  'cinder'
5
5
  end
6
6
 
7
- param_attr :driver_backend, :nfs_uri, :nfs_mount_options
7
+ param_attr :driver_backend, :nfs_uri
8
+ after_save :set_lvm_ptable
8
9
 
9
10
  module DriverBackend
10
11
  LVM = 'lvm'
@@ -87,5 +88,29 @@ module Staypuft
87
88
  ret_list
88
89
  end
89
90
 
91
+ def param_hash
92
+ { "driver_backend" => driver_backend, "nfs_uri" => nfs_uri}
93
+ end
94
+
95
+ def lvm_ptable
96
+ Ptable.find_by_name('LVM with cinder-volumes')
97
+ end
98
+
99
+ private
100
+
101
+ def set_lvm_ptable
102
+ if (hostgroup = deployment.controller_hostgroup)
103
+ ptable = lvm_ptable
104
+ if (lvm_backend? && ptable.nil?)
105
+ Rails.logger.error "Missing Partition Table 'LVM with cinder-volumes'"
106
+ end
107
+ if (lvm_backend? && ptable)
108
+ hostgroup.ptable = ptable
109
+ else
110
+ hostgroup.ptable = nil
111
+ end
112
+ hostgroup.save!
113
+ end
114
+ end
90
115
  end
91
116
  end
@@ -6,8 +6,7 @@ module Staypuft
6
6
 
7
7
  NFS_HELP = N_('(<server>:<local path>)')
8
8
 
9
- param_attr :driver_backend, :nfs_network_path, :gluster_network_path,
10
- :gluster_backup_volfile_servers
9
+ param_attr :driver_backend, :nfs_network_path
11
10
 
12
11
  module DriverBackend
13
12
  LOCAL = 'local'
@@ -31,7 +30,7 @@ module Staypuft
31
30
  # TODO: network_path validation
32
31
 
33
32
  class Jail < Safemode::Jail
34
- allow :driver_backend, :pcmk_fs_device, :pcmk_fs_dir, :pcmk_fs_options
33
+ allow :driver_backend, :pcmk_fs_device, :pcmk_fs_options
35
34
  end
36
35
 
37
36
  def set_defaults
@@ -52,20 +51,12 @@ module Staypuft
52
51
  self.driver_backend == DriverBackend::NFS
53
52
  end
54
53
 
55
- def network_path
54
+ def pcmk_fs_device
56
55
  if self.nfs_backend?
57
56
  self.nfs_network_path
58
57
  end
59
58
  end
60
59
 
61
- def pcmk_fs_device
62
- network_path.nil? ? '' : network_path.split(':')[0]
63
- end
64
-
65
- def pcmk_fs_dir
66
- network_path.nil? ? '' : network_path.split(':')[1]
67
- end
68
-
69
60
  def pcmk_fs_options
70
61
  if self.nfs_backend?
71
62
  "context=\"system_u:object_r:glance_var_lib_t:s0\")"
@@ -87,5 +78,9 @@ module Staypuft
87
78
  ret_list
88
79
  end
89
80
 
81
+ def param_hash
82
+ { "driver_backend" => driver_backend, "nfs_network_path" => nfs_network_path}
83
+ end
84
+
90
85
  end
91
86
  end
@@ -6,12 +6,7 @@ module Staypuft
6
6
  end
7
7
 
8
8
  def controllers
9
- @controllers ||= Hostgroup.
10
- includes(:deployment_role_hostgroup).
11
- where(DeploymentRoleHostgroup.table_name => { deployment_id: deployment,
12
- role_id: Staypuft::Role.controller }).
13
- first.
14
- hosts
9
+ @controllers ||= deployment.controller_hostgroup.hosts.order(:id)
15
10
  end
16
11
 
17
12
  def controller_ips
@@ -145,5 +145,14 @@ module Staypuft
145
145
  [NetworkSegmentation::VXLAN, NetworkSegmentation::GRE].include?(network_segmentation)
146
146
  end
147
147
 
148
+ def param_hash
149
+ { 'network_segmentation' => network_segmentation,
150
+ 'tenant_vlan_ranges' => tenant_vlan_ranges,
151
+ 'networker_tenant_interface' => networker_tenant_interface,
152
+ 'use_external_interface' => use_external_interface,
153
+ 'external_interface_name' => external_interface_name,
154
+ 'compute_tenant_interface' => compute_tenant_interface }
155
+ end
156
+
148
157
  end
149
158
  end
@@ -10,6 +10,44 @@ module Staypuft
10
10
  param_attr :network_manager, :vlan_range, :external_interface_name, :public_floating_range,
11
11
  :compute_tenant_interface, :private_fixed_range
12
12
 
13
+ class NetworkRangesValidator < ActiveModel::Validator
14
+ def validate(record)
15
+ valid_ranges = []
16
+ [:public_floating_range, :private_fixed_range].each do |range_param|
17
+ begin
18
+ unless (range_str = record.send(range_param)).empty?
19
+ ip_addr = IPAddr.new(range_str)
20
+ ip_range = ip_addr.to_range
21
+ if ip_range.begin == ip_range.end
22
+ record.errors[range_param] << "Specify address range, not single value"
23
+ else
24
+ valid_ranges << [range_param, ip_addr]
25
+ end
26
+ end
27
+ rescue
28
+ record.errors[range_param] << "Invalid Network Range Format"
29
+ end
30
+ # don't validate conflicts unless both ranges otherwise passed validation
31
+ if valid_ranges.size == 2
32
+ valid_ranges.each_with_index do |param_and_ip, index|
33
+ this_param_name = param_and_ip[0]
34
+ this_ip_range = param_and_ip[1].to_range
35
+
36
+ other_param_name = valid_ranges[(index+1)%2][0]
37
+ other_ip_addr = valid_ranges[(index+1)%2][1]
38
+ ["begin", "end"].each do |action|
39
+ if (other_ip_addr===this_ip_range.send(action))
40
+ record.errors[this_param_name] << "Range #{action} #{this_ip_range.begin} overlaps with range for #{other_param_name.to_s.humanize}"
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+
49
+ validates_with NetworkRangesValidator
50
+
13
51
  module NetworkManager
14
52
  FLAT_DHCP = 'FlatDHCPManager'
15
53
  VLAN = 'VlanManager'
@@ -99,6 +137,15 @@ module Staypuft
99
137
  end
100
138
  end
101
139
 
140
+ def param_hash
141
+ { 'network_manager' => network_manager,
142
+ 'vlan_range' => vlan_range,
143
+ 'external_interface_name' => external_interface_name,
144
+ 'public_floating_range' => public_floating_range,
145
+ 'compute_tenant_interface' => compute_tenant_interface,
146
+ 'private_fixed_range' => private_fixed_range }
147
+ end
148
+
102
149
  class Jail < Safemode::Jail
103
150
  allow :network_manager, :network_overrides, :private_fixed_range, :public_floating_range,
104
151
  :compute_tenant_interface, :external_interface_name, :num_networks
@@ -87,5 +87,9 @@ module Staypuft
87
87
  h.update name => single_mode? ? single_password : self.send(name)
88
88
  end
89
89
  end
90
+
91
+ def param_hash
92
+ { "mode" => mode, "single_password" => single_password}
93
+ end
90
94
  end
91
95
  end
@@ -10,6 +10,10 @@ module Staypuft
10
10
 
11
11
  NEW_NAME_PREFIX = 'uninitialized_'
12
12
 
13
+ # supporting import/export
14
+ EXPORT_PARAMS = [:amqp_provider, :networking, :layout_name, :platform]
15
+ EXPORT_SERVICES = [:nova, :neutron, :glance, :cinder, :passwords]
16
+
13
17
  attr_accessible :description, :name, :layout_id, :layout,
14
18
  :amqp_provider, :layout_name, :networking, :platform
15
19
  after_save :update_hostgroup_name
@@ -118,6 +122,17 @@ module Staypuft
118
122
  in_progress? ? {} : hostgroup.openstack_hosts(errors)
119
123
  end
120
124
 
125
+ # Helper method for getting the progress of this deployment
126
+ def progress
127
+ if self.in_progress?
128
+ (self.task.progress * 100).round(1)
129
+ elsif self.deployed?
130
+ 100
131
+ else
132
+ 0
133
+ end
134
+ end
135
+
121
136
  def self.param_scope
122
137
  'deployment'
123
138
  end
@@ -164,7 +179,7 @@ module Staypuft
164
179
 
165
180
  class Jail < Safemode::Jail
166
181
  allow :amqp_provider, :networking, :layout_name, :platform, :nova_networking?, :neutron_networking?,
167
- :nova, :neutron, :glance, :cinder, :passwords, :vips, :ips, :ha?
182
+ :nova, :neutron, :glance, :cinder, :passwords, :vips, :ips, :ha?, :non_ha?
168
183
  end
169
184
 
170
185
  # TODO(mtaylor)
@@ -208,6 +223,10 @@ module Staypuft
208
223
  self.layout_name == LayoutName::HA
209
224
  end
210
225
 
226
+ def non_ha?
227
+ self.layout_name == LayoutName::NON_HA
228
+ end
229
+
211
230
  def nova_networking?
212
231
  networking == Networking::NOVA
213
232
  end
@@ -224,6 +243,13 @@ module Staypuft
224
243
  end
225
244
  end
226
245
 
246
+ def controller_hostgroup
247
+ Hostgroup.includes(:deployment_role_hostgroup).
248
+ where(DeploymentRoleHostgroup.table_name => { deployment_id: self,
249
+ role_id: Staypuft::Role.controller }).
250
+ first
251
+ end
252
+
227
253
  private
228
254
 
229
255
  def update_layout
@@ -0,0 +1,27 @@
1
+ <% if deployment.in_progress? %>
2
+ <%= "#{deployment.progress}% #{_('Complete')}" %>
3
+ <div class="progress progress-striped <%= 'active' if deployment.task.state == 'running' %>">
4
+ <% classes = ['progress-bar',
5
+ case deployment.task.result
6
+ when 'success'
7
+ 'progress-bar-success'
8
+ when 'error'
9
+ 'progress-bar-danger'
10
+ else
11
+ nil
12
+ end]
13
+ %>
14
+ <div class="<%= classes.join ' ' %>"
15
+ role="progressbar"
16
+ aria-valuenow="<%= deployment.progress %>"
17
+ aria-valuemin="0"
18
+ aria-valuemax="100"
19
+ style="width: <%= deployment.progress %>%;">
20
+ <span class="sr-only"><%= deployment.progress %>% Complete</span>
21
+ </div>
22
+ </div>
23
+ <% else %>
24
+ <script>
25
+ location.reload(true);
26
+ </script>
27
+ <% end %>
@@ -43,33 +43,24 @@
43
43
  </div>
44
44
  </div>
45
45
  <% elsif @deployment.in_progress? %>
46
+ <script>
47
+ // Polling for progress bar updates
48
+ var pollingInterval = 10000;
49
+ setTimeout(updateProgress, pollingInterval);
50
+
51
+ function updateProgress() {
52
+ var url = $("#deployment_progress_bar").attr("data-poll-url");
53
+ $.getScript(url);
54
+ setTimeout(updateProgress, pollingInterval);
55
+ }
56
+ </script>
57
+
46
58
  <div class="row">
47
59
  <div class="col-sm-12 text-center"><h3 class="text-muted"><%= _("Deploying") %></h3></div>
48
60
  </div>
49
61
  <div class="row">
50
- <div class="col-sm-6 col-sm-offset-3 text-center">
51
- <% progress = 100 * @deployment.task.progress %>
52
- <%= "#{progress.round(1)}% #{_('Complete')}" %>
53
- <div class="progress progress-striped <%= 'active' if @deployment.task.state == 'running' %>">
54
- <% classes = ['progress-bar',
55
- case @deployment.task.result
56
- when 'success'
57
- 'progress-bar-success'
58
- when 'error'
59
- 'progress-bar-danger'
60
- else
61
- nil
62
- end]
63
- %>
64
- <div class="<%= classes.join ' ' %>"
65
- role="progressbar"
66
- aria-valuenow="<%= progress %>"
67
- aria-valuemin="0"
68
- aria-valuemax="100"
69
- style="width: <%= progress %>%;">
70
- <span class="sr-only"><%= progress %>% Complete</span>
71
- </div>
72
- </div>
62
+ <div class="col-sm-6 col-sm-offset-3 text-center" id="deployment_progress_bar" data-poll-url="<%= deployment_path(@deployment) %>">
63
+ <%= render :partial => "deployment_progress_bar", :locals => { :deployment => @deployment } %>
73
64
  </div>
74
65
  </div>
75
66
  <div class="row">
@@ -1,4 +1,10 @@
1
- <% title(@deployment.name, edit_textfield(@deployment, :name, options={:update_url => deployment_path(@deployment)})) %>
1
+ <% title(@deployment.name,
2
+ edit_textfield(@deployment,
3
+ :name,
4
+ options={:update_url => deployment_path(@deployment)}) +
5
+ content_tag(:small,
6
+ @deployment.ha? ? _("with High Availability") : _("without High Availability"),
7
+ :class => "text-muted")) %>
2
8
  <% subtitle edit_textfield(@deployment, :description, options={:update_url => deployment_path(@deployment)}) %>
3
9
 
4
10
  <% content_for(:top_actions) do %>
@@ -0,0 +1 @@
1
+ $('#deployment_progress_bar').html("<%= escape_javascript(render :partial => 'deployment_progress_bar', :locals => { :deployment => @deployment }) %>");
@@ -1,3 +1,3 @@
1
1
  module Staypuft
2
- VERSION = '0.1.11'
2
+ VERSION = '0.1.17'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staypuft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Staypuft team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-10 00:00:00.000000000 Z
11
+ date: 2014-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman-tasks
@@ -42,14 +42,14 @@ dependencies:
42
42
  name: wicked
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
@@ -73,113 +73,115 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - LICENSE
77
- - README.md
78
- - Rakefile
76
+ - app/overrides/hide_subscription_manager_passwords.rb
77
+ - app/overrides/customize_foreman_tasks_show_page.rb
78
+ - app/helpers/staypuft/application_helper.rb
79
+ - app/helpers/staypuft/deployments_helper.rb
79
80
  - app/assets/javascripts/staypuft/staypuft.js
80
- - app/assets/stylesheets/staypuft/bootstrap_and_overrides.css.scss
81
81
  - app/assets/stylesheets/staypuft/foreman_helper.scss
82
82
  - app/assets/stylesheets/staypuft/staypuft.css.scss
83
- - app/controllers/staypuft/application_controller.rb
84
- - app/controllers/staypuft/deployments_controller.rb
85
- - app/controllers/staypuft/steps_controller.rb
86
- - app/helpers/staypuft/application_helper.rb
87
- - app/helpers/staypuft/deployments_helper.rb
88
- - app/lib/actions/staypuft/deployment/deploy.rb
89
- - app/lib/actions/staypuft/deployment/populate.rb
90
- - app/lib/actions/staypuft/host/build.rb
91
- - app/lib/actions/staypuft/host/create.rb
92
- - app/lib/actions/staypuft/host/deploy.rb
93
- - app/lib/actions/staypuft/host/puppet_run.rb
94
- - app/lib/actions/staypuft/host/wait_until_host_ready.rb
95
- - app/lib/actions/staypuft/host/wait_until_installed.rb
96
- - app/lib/actions/staypuft/hostgroup/deploy.rb
97
- - app/lib/actions/staypuft/hostgroup/ordered_deploy.rb
98
- - app/lib/actions/staypuft/middleware/as_current_user.rb
99
- - app/lib/staypuft/deployment_param_exporter.rb
100
- - app/lib/staypuft/deployment_param_importer.rb
101
- - app/lib/staypuft/exception.rb
102
- - app/lib/staypuft/seeder.rb
103
- - app/models/setting/staypuft_provisioning.rb
104
- - app/models/staypuft/concerns/environment_extensions.rb
105
- - app/models/staypuft/concerns/host_open_stack_affiliation.rb
83
+ - app/assets/stylesheets/staypuft/bootstrap_and_overrides.css.scss
84
+ - app/models/staypuft/service.rb
85
+ - app/models/staypuft/role_class.rb
86
+ - app/models/staypuft/deployment.rb
87
+ - app/models/staypuft/role_service.rb
88
+ - app/models/staypuft/deployment_role_hostgroup.rb
89
+ - app/models/staypuft/layout.rb
90
+ - app/models/staypuft/service_class.rb
106
91
  - app/models/staypuft/concerns/host_orchestration_build_hook.rb
107
92
  - app/models/staypuft/concerns/hostgroup_extensions.rb
93
+ - app/models/staypuft/concerns/host_open_stack_affiliation.rb
108
94
  - app/models/staypuft/concerns/lookup_key_extensions.rb
109
95
  - app/models/staypuft/concerns/puppetclass_extensions.rb
110
- - app/models/staypuft/deployment.rb
111
- - app/models/staypuft/deployment/abstract_param_scope.rb
96
+ - app/models/staypuft/concerns/environment_extensions.rb
97
+ - app/models/staypuft/layout_role.rb
98
+ - app/models/staypuft/service/ui_params.rb
99
+ - app/models/staypuft/role.rb
100
+ - app/models/staypuft/deployment/passwords.rb
101
+ - app/models/staypuft/deployment/glance_service.rb
112
102
  - app/models/staypuft/deployment/attribute_param_storage.rb
103
+ - app/models/staypuft/deployment/abstract_param_scope.rb
113
104
  - app/models/staypuft/deployment/cinder_service.rb
114
- - app/models/staypuft/deployment/glance_service.rb
105
+ - app/models/staypuft/deployment/vips.rb
115
106
  - app/models/staypuft/deployment/ips.rb
116
107
  - app/models/staypuft/deployment/neutron_service.rb
117
108
  - app/models/staypuft/deployment/nova_service.rb
118
- - app/models/staypuft/deployment/passwords.rb
119
- - app/models/staypuft/deployment/vips.rb
120
- - app/models/staypuft/deployment_role_hostgroup.rb
121
- - app/models/staypuft/layout.rb
122
- - app/models/staypuft/layout_role.rb
123
- - app/models/staypuft/role.rb
124
- - app/models/staypuft/role_class.rb
125
- - app/models/staypuft/role_service.rb
126
- - app/models/staypuft/service.rb
127
- - app/models/staypuft/service/ui_params.rb
128
- - app/models/staypuft/service_class.rb
129
- - app/overrides/customize_foreman_tasks_show_page.rb
130
- - app/overrides/hide_subscription_manager_passwords.rb
131
- - app/views/staypuft/deployments/_assigned_hosts_table.html.erb
132
- - app/views/staypuft/deployments/_deployed_hosts_table.html.erb
109
+ - app/models/setting/staypuft_provisioning.rb
110
+ - app/lib/staypuft/deployment_param_importer.rb
111
+ - app/lib/staypuft/exception.rb
112
+ - app/lib/staypuft/seeder.rb
113
+ - app/lib/staypuft/deployment_param_exporter.rb
114
+ - app/lib/actions/staypuft/middleware/as_current_user.rb
115
+ - app/lib/actions/staypuft/hostgroup/deploy.rb
116
+ - app/lib/actions/staypuft/hostgroup/ordered_deploy.rb
117
+ - app/lib/actions/staypuft/host/deploy.rb
118
+ - app/lib/actions/staypuft/host/build.rb
119
+ - app/lib/actions/staypuft/host/wait_until_host_ready.rb
120
+ - app/lib/actions/staypuft/host/puppet_run.rb
121
+ - app/lib/actions/staypuft/host/create.rb
122
+ - app/lib/actions/staypuft/host/wait_until_installed.rb
123
+ - app/lib/actions/staypuft/deployment/deploy.rb
124
+ - app/lib/actions/staypuft/deployment/populate.rb
125
+ - app/controllers/staypuft/steps_controller.rb
126
+ - app/controllers/staypuft/deployments_controller.rb
127
+ - app/controllers/staypuft/application_controller.rb
133
128
  - app/views/staypuft/deployments/_deployment_access_all_details_dialogue.html.erb
134
129
  - app/views/staypuft/deployments/_deployment_progress_page_header.html.erb
135
- - app/views/staypuft/deployments/_deployment_summary.html.erb
136
- - app/views/staypuft/deployments/_free_hosts_table.html.erb
137
- - app/views/staypuft/deployments/_import_form.html.erb
138
- - app/views/staypuft/deployments/edit.html.erb
139
130
  - app/views/staypuft/deployments/index.html.erb
131
+ - app/views/staypuft/deployments/_assigned_hosts_table.html.erb
132
+ - app/views/staypuft/deployments/_deployment_summary.html.erb
133
+ - app/views/staypuft/deployments/_deployment_progress_bar.html.erb
140
134
  - app/views/staypuft/deployments/show.html.erb
135
+ - app/views/staypuft/deployments/edit.html.erb
136
+ - app/views/staypuft/deployments/show.js.erb
137
+ - app/views/staypuft/deployments/_deployed_hosts_table.html.erb
138
+ - app/views/staypuft/deployments/_import_form.html.erb
139
+ - app/views/staypuft/deployments/_free_hosts_table.html.erb
141
140
  - app/views/staypuft/deployments/summary.html.erb
142
- - app/views/staypuft/layouts/application.html.erb
143
141
  - app/views/staypuft/layouts/staypuft.html.erb
144
- - app/views/staypuft/steps/_cinder.html.erb
145
- - app/views/staypuft/steps/_glance.html.erb
142
+ - app/views/staypuft/layouts/application.html.erb
143
+ - app/views/staypuft/steps/services_overview.html.erb
146
144
  - app/views/staypuft/steps/_neutron.html.erb
145
+ - app/views/staypuft/steps/deployment_settings.html.erb
147
146
  - app/views/staypuft/steps/_nova.html.erb
148
147
  - app/views/staypuft/steps/_title.html.erb
149
- - app/views/staypuft/steps/deployment_settings.html.erb
148
+ - app/views/staypuft/steps/_glance.html.erb
150
149
  - app/views/staypuft/steps/services_configuration.html.erb
151
- - app/views/staypuft/steps/services_overview.html.erb
152
- - config/routes.rb
150
+ - app/views/staypuft/steps/_cinder.html.erb
153
151
  - config/staypuft.local.rb
152
+ - config/routes.rb
153
+ - db/migrate/20140312050615_create_staypuft_role_classes.rb
154
154
  - db/migrate/20140309021811_create_staypuft_layouts.rb
155
- - db/migrate/20140310004533_create_staypuft_deployments.rb
155
+ - db/migrate/20140310203855_create_staypuft_role_services.rb
156
156
  - db/migrate/20140310023613_create_staypuft_roles.rb
157
- - db/migrate/20140310174152_create_staypuft_layout_roles.rb
157
+ - db/migrate/20140623142500_remove_amqp_provider_from_staypuft_deployment.rb
158
+ - db/migrate/20140325211410_add_role_to_staypuft_deployment_role_hostgroup.rb
159
+ - db/migrate/20140326032027_drop_staypuft_hostgroup_roles.rb
160
+ - db/migrate/20140602121501_add_amqp_provider_to_staypuft_deployment.rb
158
161
  - db/migrate/20140310194221_create_staypuft_services.rb
159
- - db/migrate/20140310203855_create_staypuft_role_services.rb
160
- - db/migrate/20140312044533_create_staypuft_deployment_role_hostgroups.rb
161
162
  - db/migrate/20140312050001_create_staypuft_hostgroup_roles.rb
162
- - db/migrate/20140312050615_create_staypuft_role_classes.rb
163
- - db/migrate/20140312051144_create_staypuft_service_classes.rb
164
- - db/migrate/20140315031754_add_networking_to_staypuft_layout.rb
163
+ - db/migrate/20140310174152_create_staypuft_layout_roles.rb
165
164
  - db/migrate/20140318163222_add_deploy_order_to_staypuft_layout_role.rb
166
- - db/migrate/20140325211410_add_role_to_staypuft_deployment_role_hostgroup.rb
167
- - db/migrate/20140326032027_drop_staypuft_hostgroup_roles.rb
168
165
  - db/migrate/20140507103716_add_form_step_to_staypuft_deployment.rb
169
166
  - db/migrate/20140513124807_change_column_default_form_step_on_staypuft_deployment.rb
170
- - db/migrate/20140602121501_add_amqp_provider_to_staypuft_deployment.rb
171
- - db/migrate/20140623142500_remove_amqp_provider_from_staypuft_deployment.rb
167
+ - db/migrate/20140315031754_add_networking_to_staypuft_layout.rb
168
+ - db/migrate/20140312051144_create_staypuft_service_classes.rb
169
+ - db/migrate/20140312044533_create_staypuft_deployment_role_hostgroups.rb
170
+ - db/migrate/20140310004533_create_staypuft_deployments.rb
172
171
  - db/seeds.rb
173
- - lib/staypuft.rb
174
172
  - lib/staypuft/engine.rb
175
173
  - lib/staypuft/version.rb
174
+ - lib/staypuft.rb
176
175
  - lib/tasks/staypuft_tasks.rake
177
- - test/factories/staypuft_factories.rb
178
- - test/integration/navigation_test.rb
179
- - test/staypuft_test.rb
176
+ - LICENSE
177
+ - Rakefile
178
+ - README.md
180
179
  - test/test_helper.rb
181
- - test/test_plugin_helper.rb
180
+ - test/staypuft_test.rb
182
181
  - test/unit/staypuft_test.rb
182
+ - test/integration/navigation_test.rb
183
+ - test/factories/staypuft_factories.rb
184
+ - test/test_plugin_helper.rb
183
185
  homepage: https://github.com/theforeman/staypuft
184
186
  licenses: []
185
187
  metadata: {}
@@ -189,25 +191,24 @@ require_paths:
189
191
  - lib
190
192
  required_ruby_version: !ruby/object:Gem::Requirement
191
193
  requirements:
192
- - - ! '>='
194
+ - - '>='
193
195
  - !ruby/object:Gem::Version
194
196
  version: '0'
195
197
  required_rubygems_version: !ruby/object:Gem::Requirement
196
198
  requirements:
197
- - - ! '>='
199
+ - - '>='
198
200
  - !ruby/object:Gem::Version
199
201
  version: '0'
200
202
  requirements: []
201
203
  rubyforge_project:
202
- rubygems_version: 2.2.2
204
+ rubygems_version: 2.0.3
203
205
  signing_key:
204
206
  specification_version: 4
205
207
  summary: OpenStack Foreman Installer
206
208
  test_files:
207
- - test/factories/staypuft_factories.rb
208
- - test/integration/navigation_test.rb
209
- - test/staypuft_test.rb
210
209
  - test/test_helper.rb
211
- - test/test_plugin_helper.rb
210
+ - test/staypuft_test.rb
212
211
  - test/unit/staypuft_test.rb
213
- has_rdoc:
212
+ - test/integration/navigation_test.rb
213
+ - test/factories/staypuft_factories.rb
214
+ - test/test_plugin_helper.rb