staypuft 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -0
  3. data/app/assets/stylesheets/staypuft/staypuft.css.scss +12 -0
  4. data/app/controllers/staypuft/deployments_controller.rb +5 -8
  5. data/app/lib/actions/staypuft/deployment/deploy.rb +5 -1
  6. data/app/lib/actions/staypuft/host/deploy.rb +10 -5
  7. data/app/lib/actions/staypuft/hostgroup/deploy.rb +12 -8
  8. data/app/lib/actions/staypuft/hostgroup/ordered_deploy.rb +6 -1
  9. data/app/models/staypuft/deployment/glance_service.rb +2 -2
  10. data/app/models/staypuft/deployment/neutron_service.rb +12 -8
  11. data/app/models/staypuft/deployment/nova_service.rb +12 -9
  12. data/app/models/staypuft/deployment/vlan_range_values_validator.rb +33 -0
  13. data/app/models/staypuft/deployment.rb +5 -1
  14. data/app/views/staypuft/deployments/_deployment_progress_bar.html.erb +2 -5
  15. data/app/views/staypuft/deployments/_deployment_summary.html.erb +29 -12
  16. data/app/views/staypuft/deployments/show.html.erb +18 -16
  17. data/app/views/staypuft/deployments/summary.html.erb +4 -3
  18. data/app/views/staypuft/steps/_neutron_ha.html.erb +28 -0
  19. data/app/views/staypuft/steps/_neutron_non_ha.html.erb +41 -0
  20. data/app/views/staypuft/steps/_nova_ha.html.erb +29 -0
  21. data/app/views/staypuft/steps/_nova_non_ha.html.erb +29 -0
  22. data/app/views/staypuft/steps/_wizard_form_buttons.html.erb +33 -0
  23. data/app/views/staypuft/steps/deployment_settings.html.erb +54 -64
  24. data/app/views/staypuft/steps/services_configuration.html.erb +39 -45
  25. data/app/views/staypuft/steps/services_overview.html.erb +8 -31
  26. data/config/routes.rb +0 -3
  27. data/lib/staypuft/version.rb +1 -1
  28. metadata +11 -5
  29. data/app/views/staypuft/deployments/show.js.erb +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3386cee555561d013c4968867cb54660088bba35
4
- data.tar.gz: a2ac68c76e051ea923e3998ccaa220ec50642597
3
+ metadata.gz: 649c569f711506344527e8d7fde4bc80a02eea35
4
+ data.tar.gz: 6ad27bedcd36de4fc1fdb0f42778ff7604b0893e
5
5
  SHA512:
6
- metadata.gz: 72bd5a3ba9c0fe7fb6e9817aec46b6c1c56195273bc41497a3b09f2b7505e6c737eae5c52bcd92a2a0929be4a79967d8d4ef374608c9e0fd73d91972746753f8
7
- data.tar.gz: 7526c87be767c0b690aa8960565ab975c1f737d5453fdc9552f40e14636492441202068b254c7109c03d1ca4ae5ea96dbb094f9a22a41ed80f91b1d7ac4dc34c
6
+ metadata.gz: 530524b460fbe5f721cc316cb9369c7df316430f8d28d95a1822234d7e3399b0ee94e59c130bbee91b9c4c14ddcaa22ff8ff83967c674ee825d5e56697ff4e3d
7
+ data.tar.gz: f02a79d67f30ad5051bc438d150bae88b04996bfd2c6c188ab9eaff6c8294b890bc6037a983c9cca53c92a327ab717bef0cec0eff90179289d6b95a59487d5c6
data/README.md CHANGED
@@ -19,6 +19,20 @@ See [this](doc/setup.md) document.
19
19
 
20
20
  Fork and send a Pull Request. Thanks!
21
21
 
22
+ ## Release a new version
23
+
24
+ To release a new gem version you have to be owner of the gem on rubygems.org.
25
+ If you're not you can ask for ownership or you can build a gem locally. To build
26
+ a gem locally, cd into staypuft directory and run `rake build`. This builds
27
+ a gem in pkg directory. The version is determined by constant in lib/staypuft/version.rb
28
+ so if you want to bump version, modify this file before running rake.
29
+
30
+ If you are the owner and you want to release new gem version, make sure you're building
31
+ from official repository (not your own fork). Clone the repository and make sure the origin
32
+ remote is github.com/theforeman/staypuft. Now bump the version in lib/staypuft/version.rb.
33
+ Finally build and release new gem by running `rake release`. This will build the package,
34
+ tag the commit, push the commit and the tag to origin and uploads the gem to rubygems.org.
35
+
22
36
  ## Copyright
23
37
 
24
38
  Copyright (c) 2014 Red Hat, Inc. http://redhat.com
@@ -15,6 +15,18 @@
15
15
  @import "bootstrap/buttons";
16
16
  @import "bootstrap/forms";
17
17
 
18
+ .deployment-wizard .wizard {
19
+ width: 100%;
20
+ float: left;
21
+ padding-left: 0;
22
+ }
23
+
24
+ .deployment-wizard label {
25
+ text-align: left !important;
26
+ float: left;
27
+ margin-left: 10px;
28
+ }
29
+
18
30
  .top_actions {
19
31
  //same margin as h1 (title)
20
32
  margin: 20px 0 10px;
@@ -16,11 +16,10 @@ module Staypuft
16
16
  def show
17
17
  @deployment = Deployment.find(params[:id])
18
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
19
+ format.html {}
20
+ format.json do
21
+ render :status => 200, :json => @deployment.to_json(:methods => [:progress, :progress_summary])
22
22
  end
23
- format.js {}
24
23
  end
25
24
  end
26
25
 
@@ -103,8 +102,7 @@ module Staypuft
103
102
  join("\n"))
104
103
  end
105
104
 
106
- redirect_to show_with_hostgroup_selected_deployment_path(
107
- id: deployment, hostgroup_id: hostgroup)
105
+ redirect_to deployment_path(deployment)
108
106
  end
109
107
 
110
108
  def unassign_host
@@ -123,8 +121,7 @@ module Staypuft
123
121
  end
124
122
  end
125
123
 
126
- redirect_to show_with_hostgroup_selected_deployment_path(
127
- id: deployment, hostgroup_id: hostgroup)
124
+ redirect_to deployment_path(deployment)
128
125
  end
129
126
 
130
127
  def export_config
@@ -31,7 +31,11 @@ module Actions
31
31
  end
32
32
 
33
33
  def humanized_output
34
- planned_actions.map(&:humanized_output).join("\n")
34
+ planned_actions.first.humanized_output
35
+ end
36
+
37
+ def task_output
38
+ planned_actions.first.task_output
35
39
  end
36
40
 
37
41
  end
@@ -31,17 +31,22 @@ module Actions
31
31
  end
32
32
  end
33
33
 
34
- def humanized_output
35
- # TODO: use Action::Progress.calculate in new dynflow version
34
+ def task_output
36
35
  steps = planned_actions.inject([]) { |s, a| s + a.steps[1..2] }.compact
37
36
  progress = if steps.empty?
38
- 'done'
37
+ 1
39
38
  else
40
39
  total = steps.map { |s| s.progress_done * s.progress_weight }.reduce(&:+)
41
40
  weighted_count = steps.map(&:progress_weight).reduce(&:+)
42
- format '%3d%%', total / weighted_count * 100
41
+ total / weighted_count
43
42
  end
44
- format '%s Host: %s', progress, input[:host][:name]
43
+
44
+ input[:host].merge progress: progress
45
+ end
46
+
47
+ def humanized_output
48
+ task_output = self.task_output
49
+ format '%s %s%%', task_output[:name], (task_output[:progress]*100).to_i
45
50
  end
46
51
 
47
52
  end
@@ -36,14 +36,18 @@ module Actions
36
36
  input[:name]
37
37
  end
38
38
 
39
- def humanized_output
40
- format "Hostgroup: %s\n%s", input[:name],
41
- planned_actions.
42
- map(&:humanized_output).
43
- compact.
44
- tap { |lines| lines << '-' if lines.empty? }.
45
- map { |l| ' ' + l }.
46
- join("\n")
39
+ def task_output
40
+ task_outputs = planned_actions.map(&:task_output)
41
+ progress = if task_outputs.size == 0
42
+ 1
43
+ else
44
+ task_outputs.map { |to| to[:progress] }.reduce(&:+).to_f / task_outputs.size
45
+ end
46
+ { id: input[:id], name: input[:name], progress: progress, hosts: task_outputs }
47
+ end
48
+
49
+ def humanized_output(task_output = self.task_output)
50
+ format '%s %s%%', task_output[:name], (task_output[:progress]*100).to_i
47
51
  end
48
52
 
49
53
  end
@@ -34,7 +34,12 @@ module Actions
34
34
  end
35
35
 
36
36
  def humanized_output
37
- planned_actions.map(&:humanized_output).join("\n")
37
+ action = Hostgroup::Deploy.allocate
38
+ task_output.map { |to| action.humanized_output to }.join(", ")
39
+ end
40
+
41
+ def task_output
42
+ planned_actions.map(&:task_output).select { |to| !to[:hosts].empty? }
38
43
  end
39
44
  end
40
45
  end
@@ -59,9 +59,9 @@ module Staypuft
59
59
 
60
60
  def pcmk_fs_options
61
61
  if self.nfs_backend?
62
- "context=\"system_u:object_r:glance_var_lib_t:s0\")"
62
+ 'context=\"system_u:object_r:glance_var_lib_t:s0\"'
63
63
  else
64
- ""
64
+ ''
65
65
  end
66
66
  end
67
67
 
@@ -5,8 +5,8 @@ module Staypuft
5
5
  end
6
6
 
7
7
  SEGMENTATION_LIST = ['vxlan', 'vlan', 'gre', 'flat']
8
- INTERFACE_HELP = N_('(i.e. eth0, em1, etc.)')
9
- VLAN_HELP = N_('[1-4094] (i.e. 10:100)')
8
+ INTERFACE_HELP = N_('(e.g. eth0 or em1)')
9
+ VLAN_HELP = N_('[1-4094] (e.g. 10:100)')
10
10
 
11
11
 
12
12
  param_attr :network_segmentation, :tenant_vlan_ranges, :networker_tenant_interface,
@@ -28,17 +28,21 @@ module Staypuft
28
28
  validates :network_segmentation, presence: true, inclusion: { in: NetworkSegmentation::TYPES }
29
29
 
30
30
  module TenantVlanRanges
31
- HUMAN = N_('Tenant (VM data) VLAN Ranges')
31
+ HUMAN = N_('Tenant (VM Data) VLAN Ranges')
32
32
  HUMAN_AFTER = VLAN_HELP
33
33
  end
34
34
 
35
+ class NeutronVlanRangesValidator < ActiveModel::EachValidator
36
+ include Staypuft::Deployment::VlanRangeValuesValidator
37
+ end
38
+
35
39
  validates :tenant_vlan_ranges,
36
- :presence => true,
37
- :if => :vlan_segmentation?
38
- # TODO: vlan range format validation
40
+ :presence => true,
41
+ :if => :vlan_segmentation?,
42
+ :neutron_vlan_ranges => true
39
43
 
40
44
  module NetworkerTenantInterface
41
- HUMAN = N_('Which interface to use for tenant networks:')
45
+ HUMAN = N_('Which interface to use for tenant networks')
42
46
  HUMAN_AFTER = INTERFACE_HELP
43
47
  end
44
48
 
@@ -63,7 +67,7 @@ module Staypuft
63
67
  # TODO: interface name format validation
64
68
 
65
69
  module ComputeTenantInterface
66
- HUMAN = N_('Which interface to use for tenant networks:')
70
+ HUMAN = N_('Which interface to use for tenant networks')
67
71
  HUMAN_AFTER = INTERFACE_HELP
68
72
  end
69
73
 
@@ -64,14 +64,17 @@ module Staypuft
64
64
  HUMAN_AFTER = VLAN_HELP
65
65
  end
66
66
 
67
+ class NovaVlanRangeValidator < ActiveModel::EachValidator
68
+ include Staypuft::Deployment::VlanRangeValuesValidator
69
+ end
70
+
67
71
  validates :vlan_range,
68
- :presence => true,
69
- :if => :vlan_manager?
70
- # TODO: vlan range format validation
71
- # TODO: determine whether this is a true range or a single value
72
+ :presence => true,
73
+ :if => :vlan_manager?,
74
+ :nova_vlan_range => true
72
75
 
73
76
  module ExternalInterfaceName
74
- HUMAN = N_('Which interface to use for external networks:')
77
+ HUMAN = N_('Which interface to use for external networks')
75
78
  HUMAN_AFTER = INTERFACE_HELP
76
79
  end
77
80
 
@@ -79,15 +82,15 @@ module Staypuft
79
82
  # TODO: interface name format validation
80
83
 
81
84
  module PublicFloatingRange
82
- HUMAN = N_('Floating IP range for external network:')
83
- HUMAN_AFTER = N_('("10.0.0.0/24", for example)')
85
+ HUMAN = N_('Floating IP range for external network')
86
+ HUMAN_AFTER = N_('(e.g. "10.0.0.0/24")')
84
87
  end
85
88
 
86
89
  validates :public_floating_range, presence: true
87
90
  # TODO: interface format validation
88
91
 
89
92
  module ComputeTenantInterface
90
- HUMAN = N_('Which interface to use for tenant networks:')
93
+ HUMAN = N_('Which interface to use for tenant networks')
91
94
  HUMAN_AFTER = INTERFACE_HELP
92
95
  end
93
96
 
@@ -96,7 +99,7 @@ module Staypuft
96
99
  # TODO: interface name format validation
97
100
 
98
101
  module PrivateFixedRange
99
- HUMAN = N_('Private IP range for tenant networks:')
102
+ HUMAN = N_('Private IP range for tenant networks')
100
103
  HUMAN_AFTER = PublicFloatingRange::HUMAN_AFTER
101
104
  end
102
105
 
@@ -0,0 +1,33 @@
1
+ module Staypuft
2
+ module Deployment::VlanRangeValuesValidator
3
+ GENERAL_MSG = N_("Start and end vlan IDs required, in format '10:100'")
4
+ INT_VAL_MSG = N_("is not a valid integer between 1 and 4094")
5
+ FIRST_VALID = 1
6
+ LAST_VALID = 4024
7
+
8
+ def validate_each(record, attribute, value)
9
+
10
+ return if value.empty?
11
+
12
+ if value !~ /\A\d+:\d+\Z/
13
+ record.errors.add attribute, GENERAL_MSG
14
+ return
15
+ end
16
+
17
+ range_values = value.split(':').map(&:to_i)
18
+
19
+ range_values.all? do |value|
20
+ if value.between?(FIRST_VALID, LAST_VALID)
21
+ true
22
+ else
23
+ record.errors.add attribute, "Range boundary #{value} #{INT_VAL_MSG}"
24
+ false
25
+ end
26
+ end or return
27
+
28
+ unless range_values[1] >= range_values[0]
29
+ record.errors.add attribute, _("End VLAN ID must be equal to or greater than start VLAN ID.")
30
+ end
31
+ end
32
+ end
33
+ end
@@ -122,6 +122,10 @@ module Staypuft
122
122
  in_progress? ? {} : hostgroup.openstack_hosts(errors)
123
123
  end
124
124
 
125
+ def progress_summary
126
+ self.in_progress? ? self.task.humanized[:output] : nil
127
+ end
128
+
125
129
  # Helper method for getting the progress of this deployment
126
130
  def progress
127
131
  if self.in_progress?
@@ -142,7 +146,7 @@ module Staypuft
142
146
  QPID = 'qpid'
143
147
  LABELS = { RABBITMQ => N_('RabbitMQ'), QPID => N_('Qpid') }
144
148
  TYPES = LABELS.keys
145
- HUMAN = N_('Messaging provider')
149
+ HUMAN = N_('Messaging Provider')
146
150
  end
147
151
 
148
152
  module Networking
@@ -1,5 +1,5 @@
1
1
  <% if deployment.in_progress? %>
2
- <%= "#{deployment.progress}% #{_('Complete')}" %>
2
+ <span><%= deployment.progress %></span><%= "% #{_('Complete')}" %>
3
3
  <div class="progress progress-striped <%= 'active' if deployment.task.state == 'running' %>">
4
4
  <% classes = ['progress-bar',
5
5
  case deployment.task.result
@@ -20,8 +20,5 @@
20
20
  <span class="sr-only"><%= deployment.progress %>% Complete</span>
21
21
  </div>
22
22
  </div>
23
- <% else %>
24
- <script>
25
- location.reload(true);
26
- </script>
23
+ <span id="progress-summary" class="text-muted"><%= deployment.progress_summary %></span>
27
24
  <% end %>
@@ -43,18 +43,6 @@
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
-
58
46
  <div class="row">
59
47
  <div class="col-sm-12 text-center"><h3 class="text-muted"><%= _("Deploying") %></h3></div>
60
48
  </div>
@@ -74,6 +62,35 @@
74
62
  <% end %>
75
63
  </div>
76
64
  </div>
65
+ <script>
66
+ // Polling for progress bar updates
67
+ var pollingInterval = 10000;
68
+ var $pollElement = $("#deployment_progress_bar");
69
+
70
+ setTimeout(updateProgress, pollingInterval);
71
+
72
+ function updateProgress() {
73
+ var url = $pollElement.data('poll-url');
74
+
75
+ $.getJSON(url, function (response) {
76
+ var progress = response.deployment.progress;
77
+ var $progressBar = $pollElement.find(".progress-bar");
78
+
79
+ if(progress == 100) {
80
+ location.reload(true)
81
+ }
82
+
83
+ $pollElement.children('span').text(progress)
84
+
85
+ $progressBar.attr("aria-valuenow", progress);
86
+ $progressBar.width(progress + "%");
87
+ $progressBar.find("span.sr-only").text(progress + "% Complete");
88
+ $("#progress-summary").text(response.deployment.progress_summary);
89
+
90
+ setTimeout(updateProgress, pollingInterval);
91
+ });
92
+ }
93
+ </script>
77
94
  <% else %>
78
95
  <div class="row">
79
96
  <div class="col-sm-12 text-center"><h3 class="text-muted"><%= _("Not deployed, yet.") %></h3></div>
@@ -1,19 +1,21 @@
1
1
  <% title(@deployment.name,
2
2
  edit_textfield(@deployment,
3
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")) %>
8
- <% subtitle edit_textfield(@deployment, :description, options={:update_url => deployment_path(@deployment)}) %>
4
+ options={ :update_url => deployment_path(@deployment) }) +
5
+ content_tag(:small,
6
+ @deployment.ha? ? _("with High Availability") : _("without High Availability"),
7
+ :class => "text-muted")) %>
8
+ <% subtitle edit_textfield(@deployment, :description, options={ :update_url => deployment_path(@deployment) }) %>
9
9
 
10
10
  <% content_for(:top_actions) do %>
11
11
  <%= link_to(_("Advanced Configuration"), summary_deployment_path(@deployment.id), :class => 'btn btn-link') %>
12
- <%= link_to(_("Revisit Setup Wizard"), if @deployment.deployed?
13
- deployment_step_path(deployment_id: @deployment, id: 'services_configuration')
14
- else
15
- deployment_steps_path(deployment_id: @deployment)
16
- end, :class => "btn btn-default") %>
12
+ <%= link_to(_("Revisit Setup Wizard"),
13
+ if @deployment.deployed?
14
+ deployment_step_path(deployment_id: @deployment, id: 'services_configuration')
15
+ else
16
+ deployment_steps_path(deployment_id: @deployment)
17
+ end,
18
+ :class => @deployment.in_progress? ? %w(btn btn-default disabled) : %w(btn btn-default)) %>
17
19
 
18
20
  <%= link_to(_("Deploy"),
19
21
  "",
@@ -86,14 +88,14 @@
86
88
 
87
89
  <div class="tab-content col-md-8">
88
90
  <% @deployment.child_hostgroups.deploy_order.each_with_index do |child_hostgroup, i| %>
89
- <%= render :partial => "free_hosts_table", :locals => { :deployment => @deployment,
90
- :hostgroup => @hostgroup,
91
+ <%= render :partial => "free_hosts_table", :locals => { :deployment => @deployment,
92
+ :hostgroup => @hostgroup,
91
93
  :child_hostgroup => child_hostgroup } %>
92
- <%= render :partial => "assigned_hosts_table", :locals => { :deployment => @deployment,
93
- :hostgroup => @hostgroup,
94
+ <%= render :partial => "assigned_hosts_table", :locals => { :deployment => @deployment,
95
+ :hostgroup => @hostgroup,
94
96
  :child_hostgroup => child_hostgroup } %>
95
- <%= render :partial => "deployed_hosts_table", :locals => { :deployment => @deployment,
96
- :hostgroup => @hostgroup,
97
+ <%= render :partial => "deployed_hosts_table", :locals => { :deployment => @deployment,
98
+ :hostgroup => @hostgroup,
97
99
  :child_hostgroup => child_hostgroup } %>
98
100
  <% end %>
99
101
  <%= render :partial => "deployment_summary", :locals => { :deployment => @deployment } %>
@@ -3,7 +3,7 @@
3
3
  <%= link_to _("Back to Deployment"), deployment_path(@deployment.id), :class => "btn btn-link" %>
4
4
  <%= link_to(icon_text("cloud-upload", _("Import")),
5
5
  {},
6
- { :class => "btn btn-default",
6
+ { :class => "btn btn-default",
7
7
  :remote => true,
8
8
  :rel => 'popover',
9
9
  :data => { 'content' => "#{render partial: 'import_form'}",
@@ -11,7 +11,8 @@
11
11
  'placement' => 'left' } }) %>
12
12
  <%= link_to(icon_text("cloud-download", _("Export")),
13
13
  export_config_deployment_path(@deployment.id), :class => "btn btn-default") %>
14
- <%= link_to _("Edit"), edit_deployment_path(@deployment.id), :class => "btn btn-default" %>
14
+ <%= link_to _("Edit"), edit_deployment_path(@deployment.id),
15
+ :class => @deployment.in_progress? ? %w(btn btn-default disabled) : %w(btn btn-default) %>
15
16
  <% end %>
16
17
 
17
18
  <div class="col-md-12">
@@ -59,7 +60,7 @@
59
60
  <% else %>
60
61
  <p><%= _("No configuration needed for this service.") %></p>
61
62
  <% end %>
62
- <% # render "puppetclasses/classes_parameters", { :obj => service.hostgroups.first } %>
63
+ <% # render "puppetclasses/classes_parameters", { :obj => service.hostgroups.first } %>
63
64
  </div>
64
65
  <% end %>
65
66
  </div>
@@ -0,0 +1,28 @@
1
+ <!--Neutron HA-->
2
+ <div class="clearfix">
3
+ <div class="panel panel-default service-box">
4
+ <div class="panel-heading"><strong><%= _("Controller") %></strong></div>
5
+ <div class="panel-body">
6
+ <ul>
7
+ <li>Horizon</li>
8
+ <li>Keystone</li>
9
+ <li>Glance</li>
10
+ <li>Cinder</li>
11
+ <li>Neutron</li>
12
+ <li>Database with Galera</li>
13
+ <li>Messaging</li>
14
+ <li>Pacemaker Cluster</li>
15
+ <li>HAProxy Load Balancer</li>
16
+ </ul>
17
+ </div>
18
+ </div>
19
+ <div class="panel panel-default service-box">
20
+ <div class="panel-heading"><strong><%= _("Compute") %></strong></div>
21
+ <div class="panel-body">
22
+ <ul>
23
+ <li>Nova-Compute</li>
24
+ <li>Open vSwitch Agent</li>
25
+ </ul>
26
+ </div>
27
+ </div>
28
+ </div>
@@ -0,0 +1,41 @@
1
+ <!--Neutron Non-HA-->
2
+ <div class="clearfix">
3
+ <div class="panel panel-default service-box">
4
+ <div class="panel-heading"><strong><%= _("Controller") %></strong></div>
5
+ <div class="panel-body">
6
+ <ul>
7
+ <li>Horizon</li>
8
+ <li>Keystone</li>
9
+ <li>Glance</li>
10
+ <li>Cinder</li>
11
+ <li>Nova</li>
12
+ <li>Neutron Server</li>
13
+ <li>Database</li>
14
+ <li>Messaging</li>
15
+ <li>Heat</li>
16
+ <li>Ceilometer</li>
17
+ </ul>
18
+ </div>
19
+ </div>
20
+ <div class="panel panel-default service-box">
21
+ <div class="panel-heading"><strong><%= _("Compute") %></strong></div>
22
+ <div class="panel-body">
23
+ <ul>
24
+ <li>Nova-Compute</li>
25
+ <li>Open vSwitch Agent</li>
26
+ <li>Ceilometer Agent</li>
27
+ </ul>
28
+ </div>
29
+ </div>
30
+ <div class="panel panel-default service-box">
31
+ <div class="panel-heading"><strong><%= _("Neutron Network Node") %></strong></div>
32
+ <div class="panel-body">
33
+ <ul>
34
+ <li>L3 Agent</li>
35
+ <li>Open vSwitch Agent</li>
36
+ <li>DHCP Agent</li>
37
+ <li>Metadata Agent</li>
38
+ </ul>
39
+ </div>
40
+ </div>
41
+ </div>
@@ -0,0 +1,29 @@
1
+ <!--Nova-Network HA-->
2
+ <div class="clearfix">
3
+ <div class="panel panel-default service-box">
4
+ <div class="panel-heading"><strong><%= _("Controller") %></strong></div>
5
+ <div class="panel-body">
6
+ <ul>
7
+ <li>Horizon</li>
8
+ <li>Keystone</li>
9
+ <li>Glance</li>
10
+ <li>Cinder</li>
11
+ <li>Nova</li>
12
+ <li>Heat</li>
13
+ <li>Database with Galera</li>
14
+ <li>Messaging</li>
15
+ <li>Pacemaker Cluster</li>
16
+ <li>HAProxy Load Balancer</li>
17
+ </ul>
18
+ </div>
19
+ </div>
20
+ <div class="panel panel-default service-box">
21
+ <div class="panel-heading"><strong><%= _("Compute") %></strong></div>
22
+ <div class="panel-body">
23
+ <ul>
24
+ <li>Nova Compute</li>
25
+ <li>Nova Network</li>
26
+ </ul>
27
+ </div>
28
+ </div>
29
+ </div>
@@ -0,0 +1,29 @@
1
+ <!--Nova-Network Non-HA-->
2
+ <div class="clearfix">
3
+ <div class="panel panel-default service-box">
4
+ <div class="panel-heading"><strong><%= _("Controller") %></strong></div>
5
+ <div class="panel-body">
6
+ <ul>
7
+ <li>Horizon</li>
8
+ <li>Keystone</li>
9
+ <li>Glance</li>
10
+ <li>Cinder</li>
11
+ <li>Nova</li>
12
+ <li>Database</li>
13
+ <li>Messaging</li>
14
+ <li>Heat</li>
15
+ <li>Ceilometer</li>
16
+ </ul>
17
+ </div>
18
+ </div>
19
+ <div class="panel panel-default service-box">
20
+ <div class="panel-heading"><strong><%= _("Compute") %></strong></div>
21
+ <div class="panel-body">
22
+ <ul>
23
+ <li>Nova Compute</li>
24
+ <li>Nova Network</li>
25
+ <li>Ceilometer Agent</li>
26
+ </ul>
27
+ </div>
28
+ </div>
29
+ </div>
@@ -0,0 +1,33 @@
1
+ <!-- Render Wizard Form Cancel/Back/Submit Buttons -->
2
+ <div class="form_actions right" style="text-align: right">
3
+
4
+ <!-- Render Cancel Button -->
5
+ <% if is_new && step == Staypuft::Deployment::STEP_SETTINGS %>
6
+ <%= link_to _("Cancel"), deployment_path(@deployment),
7
+ :method => :delete,
8
+ :confirm => _("This will clear whole deployment configuration. Are you sure?"),
9
+ :class => "btn btn-danger" %>
10
+ <% else %>
11
+ <%= link_to _("Cancel"), deployment_path(@deployment),
12
+ :class => "btn btn-danger" %>
13
+ <% end %>
14
+
15
+ <!-- Render Back Button -->
16
+ <% unless step == Staypuft::Deployment::STEP_SETTINGS %>
17
+ <a class="btn btn-default" href="<%= previous_wizard_path %>">
18
+ <span class="glyphicon glyphicon-chevron-left"></span>
19
+ <%= _("Back") %>
20
+ </a>
21
+ <% end %>
22
+
23
+ <!-- Render Next/Submit Button -->
24
+ <%= button_tag(:type => 'submit', :class => "btn btn-primary") do %>
25
+ <% if step == Staypuft::Deployment::STEP_CONFIGURATION %>
26
+ <%= _("Submit") %>
27
+ <% else %>
28
+ <%= _("Next") %>
29
+ <span class="glyphicon glyphicon-chevron-right"></span>
30
+ <% end %>
31
+ <% end %>
32
+
33
+ </div>
@@ -1,71 +1,61 @@
1
1
  <%= render :layout => 'title' do %>
2
2
  <%= alert_if_deployed %>
3
3
 
4
- <%= form_for(@deployment, :url => wizard_path, :method => 'PUT') do |f| %>
5
- <%= base_errors_for @deployment %>
6
-
7
- <div class="wizard-container">
8
- <%= deployment_wizard 1 %>
9
- </div>
10
-
11
- <%= text_f f, :name %>
12
- <%= textarea_f f, :description, :rows => 3 %>
13
-
14
- <% { layout_name: Staypuft::Deployment::LayoutName,
15
- networking: Staypuft::Deployment::Networking,
16
- amqp_provider: Staypuft::Deployment::AmqpProvider,
17
- platform: Staypuft::Deployment::Platform }.
18
- each do |attr, constants| %>
19
-
20
- <%= field(f, attr, :label => _(constants::HUMAN)) do
21
- constants::LABELS.map do |value, label|
22
- radio_button_f_non_inline(f, attr,
23
- :checked => value == @deployment.send(attr),
24
- :value => value,
25
- :text => _(label))
26
- end.join
27
- end %>
28
- <% end %>
29
-
30
- <%= f.fields_for :passwords, @deployment.passwords do |p| %>
31
- <%= field(p, :mode, :label => _(Staypuft::Deployment::Passwords::Mode::HUMAN)) do
32
- Staypuft::Deployment::Passwords::Mode::LABELS.map do |value, label|
33
- radio_button_f_non_inline(p, :mode,
34
- :checked => @deployment.passwords.mode == value,
35
- :value => value,
36
- :text => label)
37
- end.join
38
- end %>
39
-
40
- <div class="single_password col-md-offset-0 hide">
41
- <%= password_f p, :single_password,
42
- :label => _("Password"),
43
- :class => "single_password",
44
- :help_inline => _("Password should be 6 characters or more"),
45
- :placeholder => '' %>
46
- <%= password_f p, :single_password_confirmation,
47
- :label => _("Confirm"),
48
- :class => "single_password",
49
- :placeholder => '' %>
4
+ <div class="deployment-wizard">
5
+ <%= form_for(@deployment, :url => wizard_path, :method => 'PUT') do |f| %>
6
+ <%= base_errors_for @deployment %>
7
+
8
+ <div class="wizard-container">
9
+ <%= deployment_wizard 1 %>
50
10
  </div>
51
- <% end %>
52
-
53
-
54
-
55
- <div class="form_actions">
56
- <% if !is_new %>
57
- <%= link_to _("Cancel"), deployment_path(@deployment),
58
- :class => "btn btn-danger" %>
59
- <% else %>
60
- <%= link_to _("Cancel"), deployment_path(@deployment),
61
- :method => :delete,
62
- :confirm => _("This will clear whole deployment configuration. Are you sure?"),
63
- :class => "btn btn-danger" %>
11
+
12
+ <%= text_f f, :name %>
13
+ <%= textarea_f f, :description, :rows => 3 %>
14
+
15
+ <% { layout_name: Staypuft::Deployment::LayoutName,
16
+ networking: Staypuft::Deployment::Networking,
17
+ amqp_provider: Staypuft::Deployment::AmqpProvider,
18
+ platform: Staypuft::Deployment::Platform }.
19
+ each do |attr, constants| %>
20
+
21
+ <%= field(f, attr, :label => _(constants::HUMAN)) do
22
+ constants::LABELS.map do |value, label|
23
+ radio_button_f_non_inline(f, attr,
24
+ :checked => value == @deployment.send(attr),
25
+ :value => value,
26
+ :text => _(label))
27
+ end.join
28
+ end %>
64
29
  <% end %>
65
- <%= button_tag(:type => 'submit', :class => "btn btn-primary pull-right") do %>
66
- <%= _("Next") %>
67
- <span class="glyphicon glyphicon-chevron-right"></span>
30
+
31
+ <%= f.fields_for :passwords, @deployment.passwords do |p| %>
32
+ <%= field(p, :mode, :label => _(Staypuft::Deployment::Passwords::Mode::HUMAN)) do
33
+ Staypuft::Deployment::Passwords::Mode::LABELS.map do |value, label|
34
+ radio_button_f_non_inline(p, :mode,
35
+ :checked => @deployment.passwords.mode == value,
36
+ :value => value,
37
+ :text => label)
38
+ end.join
39
+ end %>
40
+
41
+ <div class="single_password col-md-offset-0 hide">
42
+ <%= password_f p, :single_password,
43
+ :label => _("Password"),
44
+ :class => "single_password",
45
+ :help_inline => _("Password should be 6 characters or more"),
46
+ :placeholder => '' %>
47
+ <%= password_f p, :single_password_confirmation,
48
+ :label => _("Confirm"),
49
+ :class => "single_password",
50
+ :placeholder => '' %>
51
+ </div>
52
+
53
+ <%= render :partial => "wizard_form_buttons",
54
+ :locals => { :deployment => @deployment,
55
+ :step => Staypuft::Deployment::STEP_SETTINGS } %>
56
+
68
57
  <% end %>
69
- </div>
70
- <% end %>
58
+ <% end %>
59
+ </div>
60
+
71
61
  <% end %>
@@ -1,50 +1,44 @@
1
1
  <%= render :layout => 'title' do %>
2
2
  <%= alert_if_deployed %>
3
3
 
4
- <%= form_for(@deployment, :url => wizard_path, :method => 'PUT') do |f| %>
5
- <%= base_errors_for @deployment %>
6
-
7
- <%= deployment_wizard 3 %>
8
- <div class="form-group tabbed_side_nav_form row">
9
- <ul class="nav nav-pills nav-stacked col-md-3 configuration" data-tabs="pills">
10
- <h3><%= _("Services") %></h3>
11
- <% @services_map.each_with_index do |service_name, i| %>
12
- <% service = @deployment.send(service_name)
13
- if service.active?
14
- %>
15
- <li class="">
16
- <a href="#<%= service_name %>" data-toggle="tab">
17
- <%= service_name.capitalize %>
18
- </a>
19
- </li>
20
- <% end %>
21
- <% end %>
22
- </ul>
23
-
24
- <div class="tab-content col-md-9">
25
- <% @services_map.each_with_index do |service_name, i| %>
26
- <% service = @deployment.send(service_name)
27
- if service.active?
28
- %>
29
- <div class="tab-pane" id="<%= service_name %>">
30
- <h3><%= _("%s Service Configuration") % service_name.to_s.capitalize %></h3>
31
- <%= render partial: service_name.to_s, locals: {f: f}%>
32
- </div>
33
- <% end %>
34
- <% end %>
4
+ <div class="deployment-wizard">
5
+ <%= form_for(@deployment, :url => wizard_path, :method => 'PUT') do |f| %>
6
+ <%= base_errors_for @deployment %>
7
+
8
+ <%= deployment_wizard 3 %>
9
+ <div class="form-group tabbed_side_nav_form row">
10
+ <ul class="nav nav-pills nav-stacked col-md-3 configuration" data-tabs="pills">
11
+ <h3><%= _("Services") %></h3>
12
+ <% @services_map.each_with_index do |service_name, i| %>
13
+ <% service = @deployment.send(service_name)
14
+ if service.active?
15
+ %>
16
+ <li class="">
17
+ <a href="#<%= service_name %>" data-toggle="tab">
18
+ <%= service_name.capitalize %>
19
+ </a>
20
+ </li>
21
+ <% end %>
22
+ <% end %>
23
+ </ul>
24
+
25
+ <div class="tab-content col-md-9">
26
+ <% @services_map.each_with_index do |service_name, i| %>
27
+ <% service = @deployment.send(service_name)
28
+ if service.active?
29
+ %>
30
+ <div class="tab-pane" id="<%= service_name %>">
31
+ <h3><%= _("%s Service Configuration") % service_name.to_s.capitalize %></h3>
32
+ <%= render partial: service_name.to_s, locals: {f: f}%>
33
+ </div>
34
+ <% end %>
35
+ <% end %>
36
+ </div>
35
37
  </div>
36
- </div>
37
-
38
- <div class="form_actions">
39
- <a class="btn btn-default" href="<%= previous_wizard_path %>">
40
- <span class="glyphicon glyphicon-chevron-left"></span>
41
- <%= _("Back") %>
42
- </a>
43
- <%= link_to _("Cancel"), deployment_path(@deployment),
44
- :class => "btn btn-danger" %>
45
- <%= button_tag(:type => 'submit', :class => "btn btn-primary pull-right") do %>
46
- <%= _("Submit") %>
47
- <% end %>
48
- </div>
49
- <% end %>
38
+
39
+ <%= render :partial => "wizard_form_buttons",
40
+ :locals => { :deployment => @deployment,
41
+ :step => Staypuft::Deployment::STEP_CONFIGURATION } %>
42
+ <% end %>
43
+ </div>
50
44
  <% end %>
@@ -1,6 +1,7 @@
1
1
  <%= render :layout => 'title' do %>
2
2
  <%= alert_if_deployed %>
3
3
 
4
+ <div class="deployment-wizard">
4
5
  <%= form_for(@deployment, :url => wizard_path, :method => 'PUT') do |f| %>
5
6
  <%= base_errors_for @deployment %>
6
7
 
@@ -8,37 +9,13 @@
8
9
  <h3><%= _("Deployment Roles & Available Services") %></h3>
9
10
  <h4><%= "#{@deployment.layout.name} - #{@deployment.layout.networking.capitalize} " + _("Networking") %></h4>
10
11
 
11
- <div class="clearfix">
12
- <% @deployment.roles_ordered.each do |role| %>
13
- <div class="panel panel-default service-box">
14
- <div class="panel-heading"><strong><%= role.name %></strong></div>
15
- <div class="panel-body">
16
- <ul>
17
- <% role.services.each do |service| %>
18
- <li>
19
- <%= f.label service.name.parameterize.underscore.to_sym, service.name, :class=> "inline" do %>
20
- <%= f.check_box(service.name.parameterize.underscore.to_sym, :checked => true, :disabled => "disabled", :hidden=> true) %>
21
- <%= service.name %>
22
- <% end %>
23
- </li>
24
- <% end %>
25
- </ul>
26
- </div>
27
- </div>
28
- <% end %>
29
- </div>
12
+ <%= render partial: @deployment.networking +
13
+ (@deployment.ha? ? "_ha" : "_non_ha")%>
30
14
 
31
- <div class="form_actions">
32
- <a class="btn btn-default" href="<%= previous_wizard_path %>">
33
- <span class="glyphicon glyphicon-chevron-left"></span>
34
- <%= _("Back") %>
35
- </a>
36
- <%= link_to _("Cancel"), deployment_path(@deployment),
37
- :class => "btn btn-danger" %>
38
- <%= button_tag(:type => 'submit', :class => "btn btn-primary pull-right") do %>
39
- <%= _("Next") %>
40
- <span class="glyphicon glyphicon-chevron-right"></span>
41
- <% end %>
42
- </div>
15
+ <%= render :partial => "wizard_form_buttons",
16
+ :locals => { :deployment => @deployment,
17
+ :step => Staypuft::Deployment::STEP_OVERVIEW } %>
43
18
  <% end %>
19
+ </div>
20
+
44
21
  <% end %>
data/config/routes.rb CHANGED
@@ -5,9 +5,6 @@ Rails.application.routes.draw do
5
5
  get 'auto_complete_search'
6
6
  end
7
7
  member do
8
- match '/hostgroup/:hostgroup_id',
9
- :to => 'deployments#show',
10
- :as => :show_with_hostgroup_selected, :method => :get
11
8
  post 'deploy'
12
9
  get 'populate'
13
10
  get 'summary'
@@ -1,3 +1,3 @@
1
1
  module Staypuft
2
- VERSION = '0.1.17'
2
+ VERSION = '0.1.18'
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.17
4
+ version: 0.1.18
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-16 00:00:00.000000000 Z
11
+ date: 2014-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foreman-tasks
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.3.0.rc1
69
- description: OpenStack Foreman Installer
69
+ description: OpenStack Foreman Installer Plugin
70
70
  email:
71
71
  - foreman-dev+staypuft@googlegroups.com
72
72
  executables: []
@@ -99,6 +99,7 @@ files:
99
99
  - app/models/staypuft/role.rb
100
100
  - app/models/staypuft/deployment/passwords.rb
101
101
  - app/models/staypuft/deployment/glance_service.rb
102
+ - app/models/staypuft/deployment/vlan_range_values_validator.rb
102
103
  - app/models/staypuft/deployment/attribute_param_storage.rb
103
104
  - app/models/staypuft/deployment/abstract_param_scope.rb
104
105
  - app/models/staypuft/deployment/cinder_service.rb
@@ -133,20 +134,24 @@ files:
133
134
  - app/views/staypuft/deployments/_deployment_progress_bar.html.erb
134
135
  - app/views/staypuft/deployments/show.html.erb
135
136
  - app/views/staypuft/deployments/edit.html.erb
136
- - app/views/staypuft/deployments/show.js.erb
137
137
  - app/views/staypuft/deployments/_deployed_hosts_table.html.erb
138
138
  - app/views/staypuft/deployments/_import_form.html.erb
139
139
  - app/views/staypuft/deployments/_free_hosts_table.html.erb
140
140
  - app/views/staypuft/deployments/summary.html.erb
141
141
  - app/views/staypuft/layouts/staypuft.html.erb
142
142
  - app/views/staypuft/layouts/application.html.erb
143
+ - app/views/staypuft/steps/_nova_ha.html.erb
143
144
  - app/views/staypuft/steps/services_overview.html.erb
144
145
  - app/views/staypuft/steps/_neutron.html.erb
146
+ - app/views/staypuft/steps/_wizard_form_buttons.html.erb
145
147
  - app/views/staypuft/steps/deployment_settings.html.erb
148
+ - app/views/staypuft/steps/_neutron_ha.html.erb
149
+ - app/views/staypuft/steps/_neutron_non_ha.html.erb
146
150
  - app/views/staypuft/steps/_nova.html.erb
147
151
  - app/views/staypuft/steps/_title.html.erb
148
152
  - app/views/staypuft/steps/_glance.html.erb
149
153
  - app/views/staypuft/steps/services_configuration.html.erb
154
+ - app/views/staypuft/steps/_nova_non_ha.html.erb
150
155
  - app/views/staypuft/steps/_cinder.html.erb
151
156
  - config/staypuft.local.rb
152
157
  - config/routes.rb
@@ -183,7 +188,8 @@ files:
183
188
  - test/factories/staypuft_factories.rb
184
189
  - test/test_plugin_helper.rb
185
190
  homepage: https://github.com/theforeman/staypuft
186
- licenses: []
191
+ licenses:
192
+ - GPL-3.0+
187
193
  metadata: {}
188
194
  post_install_message:
189
195
  rdoc_options: []
@@ -1 +0,0 @@
1
- $('#deployment_progress_bar').html("<%= escape_javascript(render :partial => 'deployment_progress_bar', :locals => { :deployment => @deployment }) %>");