staypuft 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +8 -8
  2. data/app/assets/javascripts/staypuft/staypuft.js +99 -1
  3. data/app/assets/stylesheets/staypuft/bootstrap_and_overrides.css.scss +48 -4
  4. data/app/assets/stylesheets/staypuft/staypuft.css.scss +7 -11
  5. data/app/controllers/staypuft/deployments_controller.rb +23 -20
  6. data/app/controllers/staypuft/steps_controller.rb +18 -24
  7. data/app/helpers/staypuft/application_helper.rb +16 -1
  8. data/app/helpers/staypuft/deployments_helper.rb +1 -1
  9. data/app/lib/actions/staypuft/host/wait_until_host_ready.rb +2 -8
  10. data/app/lib/staypuft/seeder.rb +702 -0
  11. data/app/models/staypuft/concerns/host_open_stack_affiliation.rb +29 -2
  12. data/app/models/staypuft/concerns/hostgroup_extensions.rb +28 -3
  13. data/app/models/staypuft/concerns/lookup_key_extensions.rb +72 -0
  14. data/app/models/staypuft/deployment/abstract_param_scope.rb +31 -0
  15. data/app/models/staypuft/deployment/attribute_param_storage.rb +41 -0
  16. data/app/models/staypuft/deployment/cinder_service.rb +87 -0
  17. data/app/models/staypuft/deployment/glance_service.rb +85 -0
  18. data/app/models/staypuft/deployment/ips.rb +26 -0
  19. data/app/models/staypuft/deployment/neutron_service.rb +165 -0
  20. data/app/models/staypuft/deployment/nova_service.rb +84 -0
  21. data/app/models/staypuft/deployment/passwords.rb +66 -0
  22. data/app/models/staypuft/deployment/vips.rb +36 -0
  23. data/app/models/staypuft/deployment.rb +179 -72
  24. data/app/models/staypuft/deployment_role_hostgroup.rb +1 -1
  25. data/app/models/staypuft/role.rb +8 -1
  26. data/app/models/staypuft/service/ui_params.rb +12 -1
  27. data/app/views/staypuft/deployments/_assigned_hosts_table.html.erb +60 -0
  28. data/app/views/staypuft/deployments/_deployed_hosts_table.html.erb +51 -0
  29. data/app/views/staypuft/deployments/_free_hosts_table.html.erb +47 -0
  30. data/app/views/staypuft/deployments/edit.html.erb +50 -0
  31. data/app/views/staypuft/deployments/show.html.erb +41 -79
  32. data/app/views/staypuft/deployments/summary.html.erb +4 -1
  33. data/app/views/staypuft/steps/_cinder.html.erb +17 -0
  34. data/app/views/staypuft/steps/_glance.html.erb +16 -0
  35. data/app/views/staypuft/steps/_neutron.html.erb +57 -0
  36. data/app/views/staypuft/steps/_nova.html.erb +34 -0
  37. data/app/views/staypuft/steps/deployment_settings.html.erb +41 -17
  38. data/app/views/staypuft/steps/services_configuration.html.erb +19 -32
  39. data/app/views/staypuft/steps/{services_selection.html.erb → services_overview.html.erb} +7 -3
  40. data/config/routes.rb +2 -0
  41. data/db/migrate/20140623142500_remove_amqp_provider_from_staypuft_deployment.rb +6 -0
  42. data/db/seeds.rb +1 -314
  43. data/lib/staypuft/engine.rb +1 -0
  44. data/lib/staypuft/version.rb +1 -1
  45. metadata +23 -3
@@ -0,0 +1,50 @@
1
+ <% title _("%s Deployment - Advanced Configuration") % @deployment.name %>
2
+ <% content_for(:title_actions) do %>
3
+ <%= link_to _("Back to Summary"), summary_deployment_path(@deployment.id)%>
4
+ <% end %>
5
+
6
+
7
+ <div class="col-md-12">
8
+ <div class="form-group tabbed_side_nav_form row">
9
+ <ul class="nav nav-pills nav-stacked col-md-3" data-tabs="pills">
10
+ <h3><%= _("Services") %></h3>
11
+ <% @service_hostgroup_map.each_with_index do |(service, hostgroup), i| %>
12
+ <li class="<%= 'active' if i == 0 %>">
13
+ <a href="#<%= service.name.parameterize.underscore %>" data-toggle="tab">
14
+ <%= service.name %>
15
+ </a>
16
+ </li>
17
+ <% end %>
18
+ </ul>
19
+
20
+ <div class="tab-content col-md-9">
21
+ <% @service_hostgroup_map.each_with_index do |(service, hostgroup), i| %>
22
+ <div class="tab-pane <%= 'active' if i == 0 %>" id="<%= service.name.parameterize.underscore %>">
23
+ <h3><%= "#{service.name} " + _("Service Configuration") %></h3>
24
+ <% if (params_hash = service.ui_params_for_form(hostgroup)).size > 0 %>
25
+ <% params_hash.each do |param_hash| %>
26
+ <div class="row">
27
+ <div class="col-md-4 control-label">
28
+ <%= label_tag param_hash[:param_key].key %>
29
+ </div>
30
+ <div class="col-md-5">
31
+ <%= text_field_tag format("staypuft_deployment[hostgroup_params][%s][puppetclass_params][%s][%s]",
32
+ param_hash[:hostgroup].id,
33
+ param_hash[:puppetclass].id,
34
+ param_hash[:param_key].key),
35
+ param_hash[:hostgroup].current_param_value_str(param_hash[:param_key]),
36
+ :class => "form-control",
37
+ :size => "45" %>
38
+ </div>
39
+ </div>
40
+ <br/>
41
+ <% end %>
42
+ <% else %>
43
+ <p><%= _("No configuration needed for this service.") %></p>
44
+ <% end %>
45
+ <% # render "puppetclasses/classes_parameters", { :obj => service.hostgroups.first } %>
46
+ </div>
47
+ <% end %>
48
+ </div>
49
+ </div>
50
+ </div>
@@ -2,7 +2,7 @@
2
2
 
3
3
  <% content_for(:title_actions) do %>
4
4
 
5
- <%= link_to(_("Edit"), if @deployment.deployed?
5
+ <%= link_to(_("Revisit Setup Wizard"), if @deployment.deployed?
6
6
  deployment_step_path(deployment_id: @deployment, id: 'services_configuration')
7
7
  else
8
8
  deployment_steps_path(deployment_id: @deployment)
@@ -15,6 +15,7 @@
15
15
  </button>
16
16
  <ul class="dropdown-menu dropdown keep-open" role="menu">
17
17
  <li><%= link_to(_("Summary"), summary_deployment_path(@deployment.id), :class => '') %></li>
18
+ <li><%= link_to _("Advanced Configuration"), edit_deployment_path(@deployment.id)%></li>
18
19
  <li>
19
20
  <%= link_to(icon_text("cloud-upload", _("Import")),
20
21
  {},
@@ -51,7 +52,7 @@
51
52
  </div>
52
53
  <% end %>
53
54
 
54
- <% if ForemanTasks::Lock.locked? @deployment, nil %>
55
+ <% if @deployment.in_progress? %>
55
56
  <%= display_link_if_authorized(
56
57
  _('Deploy in progress'),
57
58
  hash_for_foreman_tasks_task_path(id: ForemanTasks::Lock.colliding_locks(@deployment, nil).first.task.id),
@@ -59,7 +60,7 @@
59
60
  <% else %>
60
61
  <%= link_to(_("Deploy"),
61
62
  "",
62
- :class => %w(btn btn-success),
63
+ :class => %w(btn btn-primary),
63
64
  :'data-toggle' => "modal",
64
65
  :'data-target' => "#deploy_modal") %>
65
66
  <% end %>
@@ -70,90 +71,51 @@
70
71
 
71
72
  <div class="row tabbed_side_nav_table">
72
73
  <ul class="nav nav-pills nav-stacked col-md-4" data-tabs="pills">
73
- <h3><%= _("Host Groups") %></h3>
74
+ <h3><%= _("Deployment Roles") %></h3>
74
75
  <% @deployment.child_hostgroups.deploy_order.each_with_index do |child_hostgroup, i| %>
75
- <li class="<%= 'active' if @hostgroup == child_hostgroup %>">
76
- <a href="#<%= child_hostgroup.name.parameterize.underscore %>" data-toggle="tab" class="roles_list">
77
- <div class="col-xs-2 text-center">
78
- <i class="glyphicon glyphicon-ok"></i>
79
- <span><%= child_hostgroup.hosts.select { |h| h.open_stack_deployed? && !h.error? }.count %></span>
80
- </div>
81
- <div class="col-xs-2 text-center">
82
- <i class="glyphicon glyphicon-warning-sign"></i>
83
- <span><%= child_hostgroup.hosts.select { |h| h.open_stack_deployed? && h.error? }.count %></span>
84
- </div>
85
- <div class="col-xs-2 text-center">
86
- <i class="glyphicon glyphicon-time"></i>
87
- <span><%= child_hostgroup.hosts.select { |h| !h.open_stack_deployed? }.count %></span>
76
+ <li>
77
+ <div class="col-xs-2">
78
+ <% if child_hostgroup.hosts.select { |h| !ForemanTasks::Lock.locked?(@deployment, nil) && h.open_stack_deployed? }.count > 0 %>
79
+ <a href="#<%= child_hostgroup.name.parameterize.underscore %>_deployed_hosts" data-toggle="tab" class="roles_list">
80
+ <span><%= child_hostgroup.hosts.select { |h| !ForemanTasks::Lock.locked?(@deployment, nil) && h.open_stack_deployed? }.count %></span>
81
+ </a>
82
+ <% else %>
83
+ <span><%= child_hostgroup.hosts.select { |h| !ForemanTasks::Lock.locked?(@deployment, nil) && h.open_stack_deployed? }.count %></span>
84
+ <% end %>
85
+ </div>
86
+ <div class="col-xs-6">
87
+ <div class="group_name">
88
+ <%= child_hostgroup.name %>
88
89
  </div>
89
- <div class="col-xs-6"><%= child_hostgroup.name %></div>
90
- <span class="clearfix"></span>
91
- </a>
90
+ </div>
91
+ <div class="col-xs-2">
92
+ <% if child_hostgroup.hosts.select { |h| !(!ForemanTasks::Lock.locked?(@deployment, nil) && h.open_stack_deployed?) }.count > 0 %>
93
+ <a href="#<%= child_hostgroup.name.parameterize.underscore %>_assigned_hosts" data-toggle="tab" class="roles_list">
94
+ <i class="glyphicon glyphicon-time"></i>
95
+ <span><%= child_hostgroup.hosts.select { |h| !(!ForemanTasks::Lock.locked?(@deployment, nil) && h.open_stack_deployed?) }.count %></span>
96
+ </a>
97
+ <% end %>
98
+ </div>
99
+ <div class="col-xs-2">
100
+ <a href="#<%= child_hostgroup.name.parameterize.underscore %>_free_hosts" data-toggle="tab" class="roles_list">
101
+ <i class="glyphicon glyphicon-plus"></i>
102
+ </a>
103
+ </div>
92
104
  </li>
93
105
  <% end %>
94
106
  </ul>
95
107
 
96
108
  <div class="tab-content col-md-8">
97
109
  <% @deployment.child_hostgroups.deploy_order.each_with_index do |child_hostgroup, i| %>
98
- <div class="tab-pane <%= 'active' if @hostgroup == child_hostgroup %>" id="<%= child_hostgroup.name.parameterize.underscore %>">
99
- <h3><%= _("Hosts") %></h3>
100
- <% if child_hostgroup.own_and_free_hosts.present? %>
101
- <%= form_tag(associate_host_deployment_path(id: @deployment), class: 'form-horizontal well association') do |f| %>
102
- <p>
103
- <%= submit_tag _("Assign / Unassign"), :class => "btn btn-primary btn-sm" %>
104
- </p>
105
- <%= hidden_field_tag :hostgroup_id, child_hostgroup.id %>
106
- <table class="table table-bordered table-striped table-condensed">
107
- <thead>
108
- <tr>
109
- <th class="ca">
110
- <%= check_box_tag :check_all %>
111
- </th>
112
- <th><%= sort :name, :as => _('Name') %></th>
113
- <th class="hidden-s hidden-xs"><%= _('Deployed?') %></th>
114
- <th class="hidden-s hidden-xs"><%= sort :ip, :as => _('IP Address') %></th>
115
- </tr>
116
- </thead>
117
- <tbody>
118
- <% child_hostgroup.own_and_free_hosts.each do |host| %>
119
- <tr class="<%= ['checkbox_highlight',
120
- ('success' if child_hostgroup.host_ids.include?(host.id)),
121
- ('deployed' if host.open_stack_deployed?)
122
- ].compact.join(' ') %>">
123
- <td class="ca">
124
- <% disabled = ForemanTasks::Lock.locked?(@deployment, nil) && host.open_stack_deployed? %>
125
- <%= check_box_tag 'host_ids[]',
126
- host.id,
127
- child_hostgroup.host_ids.include?(host.id),
128
- id: "host_ids_#{host.id}",
129
- disabled: disabled %>
130
- <%= hidden_field_tag 'host_ids[]', host.id if disabled %>
131
- </td>
132
- <td class="ellipsis">
133
- <%= host_label(host) %>
134
- </td>
135
- <td class="hidden-s hidden-xs">
136
- <% if host.open_stack_deployed? %>
137
- <span class="glyphicon glyphicon-cloud"></span>
138
- <% else %>
139
- <span class="glyphicon glyphicon-minus"></span>
140
- <% end %>
141
- </td>
142
- <td class="hidden-s hidden-xs"><%= host.ip %></td>
143
- </tr>
144
- <% end %>
145
- </tbody>
146
- </table>
147
- <% end %>
148
- <% else %>
149
- <div class="well association">
150
- <div class="alert alert-warning">
151
- <span class="glyphicon glyphicon-warning-sign">&nbsp;</span>
152
- <%= _("All available hosts have been already assigned.") %>
153
- </div>
154
- </div>
155
- <% end %>
156
- </div>
110
+ <%= render :partial => "free_hosts_table", :locals => { :deployment => @deployment,
111
+ :hostgroup => @hostgroup,
112
+ :child_hostgroup => child_hostgroup } %>
113
+ <%= render :partial => "assigned_hosts_table", :locals => { :deployment => @deployment,
114
+ :hostgroup => @hostgroup,
115
+ :child_hostgroup => child_hostgroup } %>
116
+ <%= render :partial => "deployed_hosts_table", :locals => { :deployment => @deployment,
117
+ :hostgroup => @hostgroup,
118
+ :child_hostgroup => child_hostgroup } %>
157
119
  <% end %>
158
120
  </div>
159
121
  </div>
@@ -1,5 +1,8 @@
1
- <% title_actions link_to _("Back to Deployment"), deployment_path(@deployment.id)%>
2
1
  <% title _("%s Summary") % @deployment.name %>
2
+ <% content_for(:title_actions) do %>
3
+ <%= link_to _("Advanced Configuration"), edit_deployment_path(@deployment.id)%>
4
+ <%= link_to _("Back to Deployment"), deployment_path(@deployment.id)%>
5
+ <% end %>
3
6
 
4
7
  <div class="col-md-12">
5
8
  <% @service_hostgroup_map.each_with_index do |(service, hostgroup), i| %>
@@ -0,0 +1,17 @@
1
+ <%= f.fields_for :cinder, @deployment.cinder do |p| %>
2
+ <%= field(p, :driver_backend, :label => _(Staypuft::Deployment::CinderService::DriverBackend::HUMAN)) do
3
+ @deployment.cinder.backend_labels_for_layout.map do |value, label|
4
+ radio_button_f_non_inline(p, :driver_backend,
5
+ :checked => @deployment.cinder.driver_backend == value,
6
+ :value => value,
7
+ :text => label)
8
+ end.join
9
+ end %>
10
+
11
+ <div class="cinder_nfs_uri col-md-offset-0 hide">
12
+ <%= text_f p, :nfs_uri, class: "cinder_nfs_uri",
13
+ label: _(Staypuft::Deployment::CinderService::NfsUri::HUMAN),
14
+ help_inline: _(Staypuft::Deployment::CinderService::NfsUri::HUMAN_AFTER) %>
15
+
16
+ </div>
17
+ <% end %>
@@ -0,0 +1,16 @@
1
+ <%= f.fields_for :glance, @deployment.glance do |p| %>
2
+ <%= field(p, :driver_backend, :label => _(Staypuft::Deployment::GlanceService::DriverBackend::HUMAN)) do
3
+ @deployment.glance.backend_labels_for_layout.map do |value, label|
4
+ radio_button_f_non_inline(p, :driver_backend,
5
+ :checked => @deployment.glance.driver_backend == value,
6
+ :value => value,
7
+ :text => label)
8
+ end.join
9
+ end %>
10
+
11
+ <div class="glance_nfs_network_path col-md-offset-0 hide">
12
+ <%= text_f p, :nfs_network_path, class: "glance_nfs_network_path",
13
+ label: _(Staypuft::Deployment::GlanceService::NfsNetworkPath::HUMAN),
14
+ help_inline: _(Staypuft::Deployment::GlanceService::NfsNetworkPath::HUMAN_AFTER) %>
15
+ </div>
16
+ <% end %>
@@ -0,0 +1,57 @@
1
+ <%= f.fields_for :neutron, @deployment.neutron do |p| %>
2
+ <%= change_label_width(4, field(p, :network_segmentation, :label => _(Staypuft::Deployment::NeutronService::NetworkSegmentation::HUMAN)) do
3
+ Staypuft::Deployment::NeutronService::NetworkSegmentation::LABELS.map do |value, label|
4
+ radio_button_f_non_inline(p, :network_segmentation,
5
+ :checked => @deployment.neutron.network_segmentation == value,
6
+ :value => value,
7
+ :text => label)
8
+ end.join
9
+ end) %>
10
+
11
+ <div class="neutron_tenant_vlan_ranges col-md-offset-0 hide">
12
+ <%= change_label_width 4, text_f(p, :tenant_vlan_ranges, class: "neutron_tenant_vlan_ranges",
13
+ label: _(Staypuft::Deployment::NeutronService::TenantVlanRanges::HUMAN),
14
+ help_inline: _(Staypuft::Deployment::NeutronService::TenantVlanRanges::HUMAN_AFTER)) %>
15
+ </div>
16
+
17
+ <h4><%= _('Network Nodes') %> </h4>
18
+
19
+ <%= change_label_width 4, text_f(p, :networker_tenant_interface,
20
+ label: _(Staypuft::Deployment::NeutronService::NetworkerTenantInterface::HUMAN),
21
+ help_inline: _(Staypuft::Deployment::NeutronService::NetworkerTenantInterface::HUMAN_AFTER)) %>
22
+
23
+ <%= check_box_f_non_inline(p, :use_external_interface,
24
+ :checked_value => 'true',
25
+ :unchecked_value => 'false',
26
+ :text => Staypuft::Deployment::NeutronService::UseExternalInterface::HUMAN)
27
+ %>
28
+
29
+ <div class="neutron_external_interface col-md-offset-0 hide">
30
+ <%= change_label_width 4, text_f(p, :external_interface_name,
31
+ label: _(Staypuft::Deployment::NeutronService::ExternalInterfaceName::HUMAN),
32
+ help_inline: _(Staypuft::Deployment::NeutronService::ExternalInterfaceName::HUMAN_AFTER)) %>
33
+
34
+ <%= check_box_f_non_inline(p, :use_vlan_for_external_network,
35
+ :checked_value => 'true',
36
+ :unchecked_value => 'false',
37
+ :text => Staypuft::Deployment::NeutronService::UseVlanForExternalNetwork::HUMAN)
38
+ %>
39
+
40
+ <div class="neutron_external_vlan col-md-offset-0 hide">
41
+ <%= change_label_width 4, text_f(p, :vlan_ranges_for_external_network,
42
+ label: _(Staypuft::Deployment::NeutronService::VlanRangesForExternalNetwork::HUMAN),
43
+ help_inline: _(Staypuft::Deployment::NeutronService::VlanRangesForExternalNetwork::HUMAN_AFTER)) %>
44
+ </div>
45
+
46
+ </div>
47
+
48
+
49
+ <h4><%= _('Compute Nodes') %> </h4>
50
+
51
+ <%= change_label_width 4, text_f(p, :compute_tenant_interface,
52
+ label: _(Staypuft::Deployment::NeutronService::ComputeTenantInterface::HUMAN),
53
+ help_inline: _(Staypuft::Deployment::NeutronService::ComputeTenantInterface::HUMAN_AFTER)) %>
54
+
55
+ <%= _('NOTE: Best practice is to use a different interface than the interface used for pxe/provisioning the node. This practice is mandatory if VLAN is chosen as the tenant network type.') %>
56
+
57
+ <% end %>
@@ -0,0 +1,34 @@
1
+ <%= f.fields_for :nova, @deployment.nova do |p| %>
2
+ <%= change_label_width(4, field(p, :network_manager, :label => _(Staypuft::Deployment::NovaService::NetworkManager::HUMAN)) do
3
+ Staypuft::Deployment::NovaService::NetworkManager::LABELS.map do |value, label|
4
+ radio_button_f_non_inline(p, :network_manager,
5
+ :checked => @deployment.nova.network_manager == value,
6
+ :value => value,
7
+ :text => label)
8
+ end.join
9
+ end) %>
10
+
11
+ <div class="nova_vlan_range col-md-offset-0 hide">
12
+ <%= change_label_width 4, text_f(p, :vlan_range, class: "nova_vlan_range", label: _(Staypuft::Deployment::NovaService::VlanRange::HUMAN),
13
+ help_inline: _(Staypuft::Deployment::NovaService::VlanRange::HUMAN_AFTER)) %>
14
+ </div>
15
+
16
+ <%= change_label_width 4, text_f(p, :public_floating_range,
17
+ label: _(Staypuft::Deployment::NovaService::PublicFloatingRange::HUMAN),
18
+ help_inline: _(Staypuft::Deployment::NovaService::PublicFloatingRange::HUMAN_AFTER)) %>
19
+
20
+ <%= change_label_width 4, text_f(p, :private_fixed_range,
21
+ label: _(Staypuft::Deployment::NovaService::PrivateFixedRange::HUMAN),
22
+ help_inline: _(Staypuft::Deployment::NovaService::PrivateFixedRange::HUMAN_AFTER)) %>
23
+
24
+ <h4><%= _('Compute Nodes') %> </h4>
25
+
26
+ <%= change_label_width 4, text_f(p, :external_interface_name, label: _(Staypuft::Deployment::NovaService::ExternalInterfaceName::HUMAN),
27
+ help_inline: _(Staypuft::Deployment::NovaService::ExternalInterfaceName::HUMAN_AFTER)) %>
28
+
29
+ <%= change_label_width 4, text_f(p, :compute_tenant_interface, label: _(Staypuft::Deployment::NovaService::ComputeTenantInterface::HUMAN),
30
+ help_inline: _(Staypuft::Deployment::NovaService::ComputeTenantInterface::HUMAN_AFTER)) %>
31
+
32
+ <%= _('NOTE: Best practice is to use a different interface than the interface used for pxe/provisioning the node. This practice is mandatory if VLAN is chosen as the tenant network type.') %>
33
+
34
+ <% end %>
@@ -11,23 +11,47 @@
11
11
  <%= text_f f, :name %>
12
12
  <%= textarea_f f, :description, :rows => 3 %>
13
13
 
14
- <%= field(f, :layout_id, :label => _('Deployment Layout')) do
15
- @layouts.map do |layout|
16
- radio_button_f_non_inline(f, :layout_id,
17
- :checked => layout.id == @deployment.layout_id,
18
- :value => layout.id,
19
- :text => "#{layout.name}, #{layout.networking.capitalize} " + _("Networking"))
20
- end.join
21
- end %>
22
-
23
- <%= field(f, :layout_id, :label => _('Messaging provider')) do
24
- Staypuft::Deployment::AMQP_PROVIDER_LABELS.map do |provider_value, provider_label|
25
- radio_button_f_non_inline(f, :amqp_provider,
26
- :checked => provider_value == @deployment.amqp_provider,
27
- :value => provider_value,
28
- :text => provider_label)
29
- end.join
30
- end %>
14
+ <% { layout_name: Staypuft::Deployment::LayoutName,
15
+ networking: Staypuft::Deployment::Networking,
16
+ # amqp_provider: Staypuft::Deployment::AmqpProvider,
17
+ # platform: Staypuft::Deployment::Platform
18
+ }.
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 %>
29
+ <% end %>
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
+ <% end %>
53
+
54
+
31
55
 
32
56
  <div class="form_actions">
33
57
  <% if !is_new %>
@@ -6,44 +6,31 @@
6
6
 
7
7
  <%= deployment_wizard 3 %>
8
8
  <div class="form-group tabbed_side_nav_form row">
9
- <ul class="nav nav-pills nav-stacked col-md-3" data-tabs="pills">
9
+ <ul class="nav nav-pills nav-stacked col-md-3 configuration" data-tabs="pills">
10
10
  <h3><%= _("Services") %></h3>
11
- <% @service_hostgroup_map.each_with_index do |(service, hostgroup), i| %>
12
- <li class="<%= 'active' if i == 0 %>">
13
- <a href="#<%= service.name.parameterize.underscore %>" data-toggle="tab">
14
- <%= service.name %>
15
- </a>
16
- </li>
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 %>
17
21
  <% end %>
18
22
  </ul>
19
23
 
20
24
  <div class="tab-content col-md-9">
21
- <% @service_hostgroup_map.each_with_index do |(service, hostgroup), i| %>
22
- <div class="tab-pane <%= 'active' if i == 0 %>" id="<%= service.name.parameterize.underscore %>">
23
- <h3><%= "#{service.name} " + _("Service Configuration") %></h3>
24
- <% if (params_hash = service.ui_params_for_form(hostgroup)).size > 0 %>
25
- <% params_hash.each do |param_hash| %>
26
- <div class="row">
27
- <div class="col-md-4 control-label">
28
- <%= label_tag param_hash[:param_key].key %>
29
- </div>
30
- <div class="col-md-5">
31
- <%= text_field_tag format("staypuft_deployment[hostgroup_params][%s][puppetclass_params][%s][%s]",
32
- param_hash[:hostgroup].id,
33
- param_hash[:puppetclass].id,
34
- param_hash[:param_key].key),
35
- param_hash[:hostgroup].current_param_value_str(param_hash[:param_key]),
36
- :class => "form-control",
37
- :size => "45" %>
38
- </div>
39
- </div>
40
- <br/>
41
- <% end %>
42
- <% else %>
43
- <p><%= _("No configuration needed for this service.") %></p>
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>
44
33
  <% end %>
45
- <% # render "puppetclasses/classes_parameters", { :obj => service.hostgroups.first } %>
46
- </div>
47
34
  <% end %>
48
35
  </div>
49
36
  </div>
@@ -5,7 +5,7 @@
5
5
  <%= base_errors_for @deployment %>
6
6
 
7
7
  <%= deployment_wizard 2 %>
8
- <h3><%= _("Host Groups & Available Services") %></h3>
8
+ <h3><%= _("Deployment Roles & Available Services") %></h3>
9
9
  <h4><%= "#{@deployment.layout.name} - #{@deployment.layout.networking.capitalize} " + _("Networking") %></h4>
10
10
 
11
11
  <div class="clearfix">
@@ -13,12 +13,16 @@
13
13
  <div class="panel panel-default service-box">
14
14
  <div class="panel-heading"><strong><%= role.name %></strong></div>
15
15
  <div class="panel-body">
16
+ <ul>
16
17
  <% role.services.each do |service| %>
17
- <%= f.label service.name.parameterize.underscore.to_sym, service.name, :class=> "checkbox inline" do %>
18
- <%= f.check_box(service.name.parameterize.underscore.to_sym, :checked => true, :disabled => "disabled") %>
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) %>
19
21
  <%= service.name %>
20
22
  <% end %>
23
+ </li>
21
24
  <% end %>
25
+ </ul>
22
26
  </div>
23
27
  </div>
24
28
  <% end %>
data/config/routes.rb CHANGED
@@ -11,7 +11,9 @@ Rails.application.routes.draw do
11
11
  post 'deploy'
12
12
  get 'populate'
13
13
  get 'summary'
14
+ get 'edit'
14
15
  post 'associate_host'
16
+ post 'unassign_host'
15
17
  get 'export_config'
16
18
  post 'import_config'
17
19
  end
@@ -0,0 +1,6 @@
1
+ class RemoveAmqpProviderFromStaypuftDeployment < ActiveRecord::Migration
2
+ def change
3
+ remove_column :staypuft_deployments, :amqp_provider
4
+ # TODO(pitr) migrate down?
5
+ end
6
+ end