staypuft 0.4.15 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +13 -5
  2. data/app/assets/javascripts/staypuft/staypuft.js +6 -0
  3. data/app/controllers/staypuft/bonds_controller.rb +18 -2
  4. data/app/controllers/staypuft/deployments_controller.rb +19 -36
  5. data/app/controllers/staypuft/interface_assignments_controller.rb +3 -3
  6. data/app/controllers/staypuft/steps_controller.rb +1 -0
  7. data/app/lib/actions/staypuft/deployment/deploy.rb +5 -2
  8. data/app/lib/actions/staypuft/deployment/populate.rb +1 -1
  9. data/app/lib/actions/staypuft/host/deploy.rb +6 -15
  10. data/app/lib/actions/staypuft/host/puppet_run.rb +5 -8
  11. data/app/lib/actions/staypuft/host/{wait_until_host_ready.rb → report_check.rb} +20 -11
  12. data/app/lib/actions/staypuft/host/{build.rb → trigger_provisioning.rb} +13 -9
  13. data/app/lib/actions/staypuft/host/update.rb +33 -0
  14. data/app/lib/actions/staypuft/host/{wait_until_installed.rb → wait_until_provisioned.rb} +7 -5
  15. data/app/lib/actions/staypuft/host/wait_until_ready.rb +56 -0
  16. data/app/lib/actions/staypuft/hostgroup/ordered_deploy.rb +98 -6
  17. data/app/lib/staypuft/network_query.rb +2 -10
  18. data/app/lib/staypuft/seeder.rb +1 -3
  19. data/app/models/staypuft/concerns/host_interface_management.rb +11 -29
  20. data/app/models/staypuft/deployment.rb +38 -2
  21. data/app/models/staypuft/deployment/cinder_service/equallogic.rb +1 -1
  22. data/app/models/staypuft/deployment/passwords.rb +1 -1
  23. data/app/models/staypuft/deployment_vip_nic.rb +13 -0
  24. data/app/models/staypuft/interface_assigner.rb +1 -1
  25. data/app/models/staypuft/vip_nic.rb +18 -0
  26. data/app/views/staypuft/deployments/_deployment_summary.html.erb +3 -0
  27. data/app/views/staypuft/deployments/_host_head_row.html.erb +1 -0
  28. data/app/views/staypuft/deployments/_host_row.html.erb +8 -0
  29. data/app/views/staypuft/interface_assignments/_nics_assignment.html.erb +1 -1
  30. data/app/views/staypuft/steps/network_configuration.html.erb +12 -1
  31. data/db/migrate/20141107144800_create_staypuft_deployment_vip_nics.rb +15 -0
  32. data/lib/staypuft/engine.rb +0 -2
  33. data/lib/staypuft/version.rb +1 -1
  34. metadata +22 -20
  35. data/app/lib/actions/staypuft/hostgroup/deploy.rb +0 -93
  36. data/app/models/staypuft/concerns/subnet_ip_management.rb +0 -17
  37. data/app/models/staypuft/concerns/vip_nic_scopes.rb +0 -13
@@ -113,5 +113,8 @@
113
113
  <div class="row">
114
114
  <div class="col-sm-12 text-center"><h3 class="text-muted"><%= _("Not deployed, yet.") %></h3></div>
115
115
  </div>
116
+ <div class="row text-center">
117
+ <%= link_to(_("Access all details"), "", :'data-toggle' => "modal", :'data-target' => "#all_details_modal", :class => "btn btn-default") %>
118
+ </div>
116
119
  <% end %>
117
120
  </div>
@@ -8,5 +8,6 @@
8
8
  <% if local_assigns[:deploying_col] %>
9
9
  <th class="hidden-s hidden-xs"><%= _('Deploying?') %></th>
10
10
  <% end %>
11
+ <th class="hidden-s hidden-xs"><%= _('Managed?') %></th>
11
12
  <th class="hidden-s hidden-xs"><%= sort :ip, :as => _('IP Address') %></th>
12
13
  </tr>
@@ -30,5 +30,13 @@
30
30
  </td>
31
31
  <% end %>
32
32
 
33
+ <td class="hidden-s hidden-xs">
34
+ <% if host.managed? %>
35
+ <span class="glyphicon glyphicon-ok"></span>
36
+ <% else %>
37
+ <span class="glyphicon glyphicon-minus"></span>
38
+ <% end %>
39
+ </td>
40
+
33
41
  <td class="hidden-s hidden-xs"><%= host.ip %></td>
34
42
  </tr>
@@ -5,7 +5,7 @@
5
5
  <div class="panel-body">
6
6
  <% @subnets.each do |subnet| %>
7
7
  <% next if is_pxe?(@deployment, subnet) # we skip PXE network which is always on primary interface %>
8
- <% next if @host.interfaces.non_vip.where(:subnet_id => subnet.id).present? # we skip assigned subnets %>
8
+ <% next if @host.interfaces.where(:subnet_id => subnet.id).present? # we skip assigned subnets %>
9
9
  <%= render 'staypuft/subnets/subnet_pull',
10
10
  :subnet => subnet,
11
11
  :deployment => @deployment,
@@ -54,7 +54,7 @@
54
54
  </a>
55
55
  <%= link_to _("Cancel"), deployment_path(@deployment),
56
56
  :class => "btn btn-danger" %>
57
- <%= button_tag(:type => 'submit', :class => "btn btn-primary pull-right") do %>
57
+ <%= button_tag(:type => 'submit', :class => "btn btn-primary pull-right", :id => "vip_modal_button" ) do %>
58
58
  <%= _("Next") %>
59
59
  <% end %>
60
60
  </div>
@@ -84,4 +84,15 @@
84
84
  </div>
85
85
  </div>
86
86
  </div>
87
+
88
+ <div class="modal fade" id="vip_modal" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true">
89
+ <div class="modal-dialog">
90
+ <div class="modal-content">
91
+ <div class="modal-body">
92
+ <h4><%= image_tag '/assets/spinner.gif', style: "float: left; display: block; margin-left: auto; margin-right: 10px;" %> Generating network configuration. This may take a few moments.</h4>
93
+ </div>
94
+ </div>
95
+ </div>
96
+ </div>
97
+
87
98
  <% end %>
@@ -0,0 +1,15 @@
1
+ class CreateStaypuftDeploymentVipNics < ActiveRecord::Migration
2
+ def change
3
+ create_table :staypuft_deployment_vip_nics do |t|
4
+ t.references :deployment, :null => false
5
+ t.foreign_key :staypuft_deployments, column: :deployment_id, :name => "staypuft_deployment_vip_nic_deployment_id_fk"
6
+
7
+ t.references :vip_nic, :null => false
8
+ t.foreign_key :nics, column: :vip_nic_id, :name => "staypuft_deployment_vip_nics_nic_id_fk"
9
+
10
+ t.timestamps
11
+ end
12
+ add_index :staypuft_deployment_vip_nics, :deployment_id
13
+ add_index :staypuft_deployment_vip_nics, :vip_nic_id
14
+ end
15
+ end
@@ -35,8 +35,6 @@ module Staypuft
35
35
  ::Host::Discovered.send :include, Staypuft::Concerns::HostOpenStackAffiliation
36
36
  ::Host::Discovered.send :include, Staypuft::Concerns::HostDetailsHelper
37
37
  ::Puppetclass.send :include, Staypuft::Concerns::PuppetclassExtensions
38
- ::Nic::Base.send :include, Staypuft::Concerns::SubnetIpManagement
39
- ::Nic::Base.send :include, Staypuft::Concerns::VipNicScopes
40
38
  ::Hostgroup.send :include, Staypuft::Concerns::HostgroupExtensions
41
39
  ::Environment.send :include, Staypuft::Concerns::EnvironmentExtensions
42
40
  ::LookupKey.send :include, Staypuft::Concerns::LookupKeyExtensions
@@ -1,3 +1,3 @@
1
1
  module Staypuft
2
- VERSION = '0.4.15'
2
+ VERSION = '0.5.0'
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.4.15
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Staypuft team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-07 00:00:00.000000000 Z
11
+ date: 2014-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman-tasks
@@ -42,28 +42,28 @@ 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
56
56
  name: deface
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
@@ -84,14 +84,14 @@ dependencies:
84
84
  name: ipaddress
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ! '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ! '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: OpenStack Foreman Installer Plugin
@@ -126,13 +126,14 @@ files:
126
126
  - app/helpers/staypuft/hosts_helper.rb
127
127
  - app/lib/actions/staypuft/deployment/deploy.rb
128
128
  - app/lib/actions/staypuft/deployment/populate.rb
129
- - app/lib/actions/staypuft/host/build.rb
130
129
  - app/lib/actions/staypuft/host/create.rb
131
130
  - app/lib/actions/staypuft/host/deploy.rb
132
131
  - app/lib/actions/staypuft/host/puppet_run.rb
133
- - app/lib/actions/staypuft/host/wait_until_host_ready.rb
134
- - app/lib/actions/staypuft/host/wait_until_installed.rb
135
- - app/lib/actions/staypuft/hostgroup/deploy.rb
132
+ - app/lib/actions/staypuft/host/report_check.rb
133
+ - app/lib/actions/staypuft/host/trigger_provisioning.rb
134
+ - app/lib/actions/staypuft/host/update.rb
135
+ - app/lib/actions/staypuft/host/wait_until_provisioned.rb
136
+ - app/lib/actions/staypuft/host/wait_until_ready.rb
136
137
  - app/lib/actions/staypuft/hostgroup/ordered_deploy.rb
137
138
  - app/lib/actions/staypuft/middleware/as_current_user.rb
138
139
  - app/lib/staypuft/deployment_param_exporter.rb
@@ -151,8 +152,6 @@ files:
151
152
  - app/models/staypuft/concerns/lookup_key_extensions.rb
152
153
  - app/models/staypuft/concerns/nic_fencing_extensions.rb
153
154
  - app/models/staypuft/concerns/puppetclass_extensions.rb
154
- - app/models/staypuft/concerns/subnet_ip_management.rb
155
- - app/models/staypuft/concerns/vip_nic_scopes.rb
156
155
  - app/models/staypuft/deployment.rb
157
156
  - app/models/staypuft/deployment/abstract_param_scope.rb
158
157
  - app/models/staypuft/deployment/attribute_param_storage.rb
@@ -167,6 +166,7 @@ files:
167
166
  - app/models/staypuft/deployment/passwords.rb
168
167
  - app/models/staypuft/deployment/vlan_range_values_validator.rb
169
168
  - app/models/staypuft/deployment_role_hostgroup.rb
169
+ - app/models/staypuft/deployment_vip_nic.rb
170
170
  - app/models/staypuft/fencing.rb
171
171
  - app/models/staypuft/interface_assigner.rb
172
172
  - app/models/staypuft/layout.rb
@@ -181,6 +181,7 @@ files:
181
181
  - app/models/staypuft/simple_subnet.rb
182
182
  - app/models/staypuft/subnet_type.rb
183
183
  - app/models/staypuft/subnet_typing.rb
184
+ - app/models/staypuft/vip_nic.rb
184
185
  - app/overrides/customize_foreman_tasks_show_page.rb
185
186
  - app/overrides/foreman_hosts_edit.rb
186
187
  - app/overrides/hide_subscription_manager_passwords.rb
@@ -279,6 +280,7 @@ files:
279
280
  - db/migrate/20140831234000_add_required_to_subnet_types.rb
280
281
  - db/migrate/20141003223000_add_validation_to_subnet_types.rb
281
282
  - db/migrate/20141009064907_add_custom_repos_to_deployment.rb
283
+ - db/migrate/20141107144800_create_staypuft_deployment_vip_nics.rb
282
284
  - db/seeds.rb
283
285
  - lib/staypuft.rb
284
286
  - lib/staypuft/engine.rb
@@ -300,24 +302,24 @@ require_paths:
300
302
  - lib
301
303
  required_ruby_version: !ruby/object:Gem::Requirement
302
304
  requirements:
303
- - - '>='
305
+ - - ! '>='
304
306
  - !ruby/object:Gem::Version
305
307
  version: '0'
306
308
  required_rubygems_version: !ruby/object:Gem::Requirement
307
309
  requirements:
308
- - - '>='
310
+ - - ! '>='
309
311
  - !ruby/object:Gem::Version
310
312
  version: '0'
311
313
  requirements: []
312
314
  rubyforge_project:
313
- rubygems_version: 2.4.6
315
+ rubygems_version: 2.2.2
314
316
  signing_key:
315
317
  specification_version: 4
316
318
  summary: OpenStack Foreman Installer
317
319
  test_files:
318
320
  - test/test_helper.rb
319
- - test/factories/staypuft_factories.rb
321
+ - test/staypuft_test.rb
322
+ - test/unit/staypuft_test.rb
320
323
  - test/test_plugin_helper.rb
324
+ - test/factories/staypuft_factories.rb
321
325
  - test/integration/navigation_test.rb
322
- - test/unit/staypuft_test.rb
323
- - test/staypuft_test.rb
@@ -1,93 +0,0 @@
1
- #
2
- # Copyright 2014 Red Hat, Inc.
3
- #
4
- # This software is licensed to you under the GNU General Public
5
- # License as published by the Free Software Foundation; either version
6
- # 2 of the License (GPLv2) or (at your option) any later version.
7
- # There is NO WARRANTY for this software, express or implied,
8
- # including the implied warranties of MERCHANTABILITY,
9
- # NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
10
- # have received a copy of GPLv2 along with this software; if not, see
11
- # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
12
-
13
- module Actions
14
- module Staypuft
15
- module Hostgroup
16
- class Deploy < Actions::Base
17
-
18
- middleware.use Actions::Staypuft::Middleware::AsCurrentUser
19
-
20
- def plan(hostgroup, hosts)
21
- Type! hostgroup, ::Hostgroup
22
- (Type! hosts, Array).all? { |v| Type! v, ::Host::Base }
23
-
24
- input.update id: hostgroup.id, name: hostgroup.name
25
-
26
- # hostgroup.hosts returns already converted hosts from Host::Discovered with build flag
27
- # set to false so they are not built when assigned to the hostgroup in wizard
28
- # run Hostgroup's Hosts filtered by hosts
29
- host_list = hostgroup.hosts & hosts
30
- orchestration_mode = hostgroup.role.orchestration unless hostgroup.role.nil?
31
-
32
- case orchestration_mode
33
- when ::Staypuft::Role::ORCHESTRATION_CONCURRENT
34
- deploy_concurrently(host_list)
35
- when ::Staypuft::Role::ORCHESTRATION_SERIAL
36
- deploy_serially(host_list)
37
- when ::Staypuft::Role::ORCHESTRATION_LEADER
38
- deploy_leader_first(host_list)
39
- else
40
- deploy_concurrently(host_list)
41
- end
42
- end
43
-
44
- def deploy_concurrently(hosts)
45
- hosts.each do |host|
46
- # planned in concurrence
47
- plan_action Host::Deploy, host
48
- end
49
- end
50
-
51
- def deploy_serially(hosts)
52
- sequence do
53
- hosts.each do |host|
54
- plan_action Host::Deploy, host
55
- end
56
- end
57
- end
58
-
59
- def deploy_leader_first(hosts)
60
- first_host = hosts.shift
61
- sequence do
62
- #deploy first host, then deploy remainder in parallel
63
- plan_action Host::Deploy, first_host unless first_host.nil?
64
- concurrence do
65
- hosts.each do |host|
66
- plan_action Host::Deploy, host
67
- end
68
- end
69
- end
70
- end
71
-
72
- def humanized_input
73
- input[:name]
74
- end
75
-
76
- def task_output
77
- task_outputs = planned_actions.map(&:task_output)
78
- progress = if task_outputs.size == 0
79
- 1
80
- else
81
- task_outputs.map { |to| to[:progress] }.reduce(&:+).to_f / task_outputs.size
82
- end
83
- { id: input[:id], name: input[:name], progress: progress, hosts: task_outputs }
84
- end
85
-
86
- def humanized_output(task_output = self.task_output)
87
- format '%s %s%%', task_output[:name], (task_output[:progress]*100).to_i
88
- end
89
-
90
- end
91
- end
92
- end
93
- end
@@ -1,17 +0,0 @@
1
- module Staypuft
2
- module Concerns
3
- module SubnetIpManagement
4
- extend ActiveSupport::Concern
5
-
6
- included do
7
- before_save :reserve_ip
8
- end
9
-
10
- def reserve_ip
11
- if self.identifier =~ /\Avip\d+\Z/ && self.subnet.present? && self.subnet.ipam?
12
- self.ip ||= self.subnet.unused_ip
13
- end
14
- end
15
- end
16
- end
17
- end
@@ -1,13 +0,0 @@
1
- module Staypuft
2
- module Concerns
3
- module VipNicScopes
4
- extend ActiveSupport::Concern
5
-
6
- included do
7
- scope :vip, lambda { where(['identifier LIKE ?', 'vip%']) }
8
- scope :non_vip, lambda { where(['identifier NOT LIKE ?', 'vip%']) }
9
- end
10
-
11
- end
12
- end
13
- end