staypuft 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjllNGYyYjkzYTQwOTFhMDBiYmVmMzdiN2E4ZjlhY2EyZDRmN2VjNw==
4
+ MWFkYzZlNjIwZjcxOWRjNTM0NmU4ZDVmYzFiNGZiZTY5OGRmN2ZlYQ==
5
5
  data.tar.gz: !binary |-
6
- MzNiNDViNTcwZWJmNTg3N2VlNzAxZDM2MWIzNTVlNDEyZWUyZmQ5Nw==
6
+ NjlkODZkMGY2OTNmZGJkMWQ3Y2E1MmIzODg2ZDc0ODczZTRiZGJkNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzUzNDAwZTNlMzQxYzdkNDY5YzM2MWNiNTRjMzgyMjNlNDNjMDhlOTQ2OGIz
10
- MmE3NTQxMjgyNGNhZTA1ODM4YjJlODY2YzdlNzRlYjMzOThmNmJlZjI2Mjkx
11
- YmM1NDE3MTcwNWIzMDc5OWQxODgwYTFhZjBkNjkzOWUzNGQ4OTE=
9
+ NDAyY2U4YjBlYTkyNDc3ZTNhN2JiNTk1ZGVmZDkxZmJlOTllODI2ODkxYzJk
10
+ MWY0ZTMyZGY1NTBkOGUyYjczYmI5M2I2M2FkNDEzNmZiNDY3NzYxOGU4MmRk
11
+ MGNiMTI5Y2U5MDM0MTliNTE3OTVmMzhkNDg5NWE0ZmE4ZWEwZjQ=
12
12
  data.tar.gz: !binary |-
13
- MjYyMTg1ODk3NTc2MmQzZmI4YjEzZTRlYzU1NTFiYjhkZmY2YmJmZjk1M2E1
14
- MGE3MDU5Y2M3MDQ5Y2RhNDE2NjljYzU1ZWU0MzI4NjViNTFlOTczMzc2ZjM0
15
- MGFjZGQyZTI4NGUyMGRmMmNlMmY0ZDNjYzEzZTVlYWM3MzQzNzI=
13
+ MjQ2YzU1MmYzYmRhMGRjZDQxNWFlYTk5MWYzOTU2ODUzNTlhMGQ2YzllMWIy
14
+ Y2JkYTc0ZGUzYjE3NzAzMGM2MjY1ODk3YzhhYTg5ZDY3ZWRjMGNmYmEzMjRj
15
+ MGE1M2NkOWI5YWQ2MTg2NzA5YTMyZGIzNzU3YmVmYjkzNDUwNmE=
@@ -14,7 +14,7 @@
14
14
 
15
15
  $(function () {
16
16
  // Check all checkboxes in table
17
- $('#check_all').on('change', function (e) {
17
+ $('.check_all').on('change', function (e) {
18
18
  var table = $(e.target).closest('table');
19
19
  $('td input:checkbox', table).attr('checked', e.target.checked);
20
20
  $('td input:checkbox', table).closest("tr").toggleClass("info", this.checked);
@@ -24,7 +24,23 @@ module Staypuft
24
24
  @service_hostgroup_map = @deployment.services_hostgroup_map
25
25
  end
26
26
 
27
- # FIXME: missing update action, there is no way how to submit the edited params
27
+ def update
28
+ if params[:staypuft_deployment]
29
+ param_data = params[:staypuft_deployment][:hostgroup_params]
30
+ param_data.each do |hostgroup_id, hostgroup_params|
31
+ hostgroup = Hostgroup.find(hostgroup_id)
32
+ hostgroup_params[:puppetclass_params].each do |puppetclass_id, puppetclass_params|
33
+ puppetclass = Puppetclass.find(puppetclass_id)
34
+ puppetclass_params.each do |param_name, param_value|
35
+ hostgroup.set_param_value_if_changed(puppetclass, param_name, param_value)
36
+ end
37
+ end
38
+ end
39
+ end
40
+
41
+ redirect_to summary_deployment_path(params[:id])
42
+ end
43
+
28
44
  def edit
29
45
  @deployment = Deployment.find(params[:id])
30
46
  @service_hostgroup_map = @deployment.services_hostgroup_map
@@ -55,7 +71,7 @@ module Staypuft
55
71
  hostgroup = ::Hostgroup.find params[:hostgroup_id]
56
72
  deployment_in_progress = ForemanTasks::Lock.locked?(deployment, nil)
57
73
 
58
- hosts_to_assign = ::Host::Base.find Array(params[:host_ids])
74
+ hosts_to_assign = ::Host::Base.find Array(params[:host_ids])
59
75
 
60
76
  unassigned_hosts = hosts_to_assign.reduce([]) do |unassigned_hosts, discovered_host|
61
77
  success, host = assign_host_to_hostgroup discovered_host, hostgroup
@@ -80,7 +96,7 @@ module Staypuft
80
96
  hostgroup = ::Hostgroup.find params[:hostgroup_id]
81
97
  deployment_in_progress = ForemanTasks::Lock.locked?(deployment, nil)
82
98
 
83
- hosts_to_unassign = ::Host::Base.find Array(params[:host_ids])
99
+ hosts_to_unassign = ::Host::Base.find Array(params[:host_ids])
84
100
 
85
101
  hosts_to_unassign.each do |host|
86
102
  unless host.open_stack_deployed? && deployment_in_progress
@@ -179,19 +179,20 @@ module Staypuft
179
179
  network_create_networks = true
180
180
 
181
181
  # Neutron
182
- ovs_vlan_ranges = '<%= "physnet-tenants:#{@host.deployment.neutron.tenant_vlan_ranges}" %>'
183
- ml2_network_vlan_ranges = [ovs_vlan_ranges]
184
- ml2_tenant_network_types = '<%= @host.deployment.neutron.network_segmentation_list %>'
182
+ ovs_vlan_ranges = '<%= @host.deployment.neutron.networker_vlan_ranges %>'
183
+ compute_ovs_vlan_ranges = '<%= @host.deployment.neutron.compute_vlan_ranges %>'
184
+ ml2_network_vlan_ranges = ovs_vlan_ranges
185
+ ml2_tenant_network_types = ['<%= @host.deployment.neutron.network_segmentation %>']
185
186
  ml2_tunnel_id_ranges = ['10:100000']
186
187
  ml2_vni_ranges = ['10:100000']
187
188
  ovs_tunnel_types = ['vxlan', 'gre']
188
- ovs_tunnel_iface = '<%= @host.deployment.neutron.networker_tenant_interface %>'
189
- ovs_bridge_mappings = '<%= @host.deployment.neutron.controller_ovs_bridge_mappings %>'
190
- ovs_bridge_uplinks = '<%= @host.deployment.neutron.controller_ovs_bridge_uplinks %>'
191
- compute_ovs_tunnel_iface = '<%= @host.deployment.neutron.compute_tenant_interface %>'
189
+ ovs_tunnel_iface = '<%= n = @host.deployment.neutron; n.enable_tunneling? ? n.networker_tenant_interface : "" %>'
190
+ ovs_bridge_mappings = '<%= @host.deployment.neutron.networker_ovs_bridge_mappings %>'
191
+ ovs_bridge_uplinks = '<%= @host.deployment.neutron.networker_ovs_bridge_uplinks %>'
192
+ compute_ovs_tunnel_iface = '<%= n = @host.deployment.neutron; n.enable_tunneling? ? n.compute_tenant_interface : "" %>'
192
193
  compute_ovs_bridge_mappings = '<%= @host.deployment.neutron.compute_ovs_bridge_mappings %>'
193
194
  compute_ovs_bridge_uplinks = '<%= @host.deployment.neutron.compute_ovs_bridge_uplinks %>'
194
- enable_tunneling = 'true'
195
+ enable_tunneling = '<%= @host.deployment.neutron.enable_tunneling?.to_s %>'
195
196
 
196
197
  # Glance
197
198
  backend = 'file'
@@ -445,7 +446,7 @@ module Staypuft
445
446
  'swift_public_vip' => vip_format % :swift,
446
447
  'lb_backend_server_addrs' => '<%= @host.deployment.ips.controller_ips %>',
447
448
  'lb_backend_server_names' => '<%= @host.deployment.ips.controller_fqdns %>' },
448
- 'quickstack::pacemaker::common' => { # TODO is this correct puppetclass?
449
+ 'quickstack::pacemaker::common' => {
449
450
  'pacemaker_cluster_members' => '<%= @host.deployment.ips.controller_ips.join(" ") %>' },
450
451
  'quickstack::pacemaker::neutron' => {
451
452
  'ml2_network_vlan_ranges' => ml2_network_vlan_ranges,
@@ -554,7 +555,7 @@ module Staypuft
554
555
  'ovs_bridge_uplinks' => compute_ovs_bridge_uplinks,
555
556
  'ovs_tunnel_iface' => compute_ovs_tunnel_iface,
556
557
  'ovs_tunnel_types' => ovs_tunnel_types,
557
- 'ovs_vlan_ranges' => ovs_vlan_ranges,
558
+ 'ovs_vlan_ranges' => compute_ovs_vlan_ranges,
558
559
  'admin_password' => admin_pw,
559
560
  'ceilometer_user_password' => ceilometer_user_pw,
560
561
  'neutron_db_password' => neutron_db_pw,
@@ -651,10 +652,7 @@ module Staypuft
651
652
  param = puppetclass.class_params.find_by_key(param_key)
652
653
  unless param
653
654
  Rails.logger.error "missing param #{param_key} in #{puppetclass_name} trying to set default_value: #{default_value.inspect} found in puppetclasses: " +
654
- LookupKey.
655
- smart_class_parameters.
656
- search_for("key = #{param_key}").
657
- map { |lk| lk.param_class.name }.inspect
655
+ LookupKey.search_for(param_key).map { |lk| (c = (lk.param_class || lk.puppetclass)).nil? ? "class not found" : c.name }.inspect
658
656
  next
659
657
  end
660
658
  unless param.update_attributes default_value: default_value
@@ -51,7 +51,6 @@ module Staypuft::Concerns::LookupKeyExtensions
51
51
  type = lookup_key.key_type
52
52
  end
53
53
 
54
- p string
55
54
  value = if Setting[:safemode_render]
56
55
  box = Safemode::Box.new self, @allowed_methods
57
56
  box.eval(ERB.new(string, nil, '-').src, @allowed_vars)
@@ -5,6 +5,9 @@ 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)')
10
+
8
11
 
9
12
  param_attr :network_segmentation, :tenant_vlan_ranges, :networker_tenant_interface,
10
13
  :use_external_interface, :external_interface_name, :compute_tenant_interface,
@@ -27,7 +30,7 @@ module Staypuft
27
30
 
28
31
  module TenantVlanRanges
29
32
  HUMAN = N_('Tenant (VM data) VLAN Ranges')
30
- HUMAN_AFTER = '[1-4094] (i.e. 10:100)'
33
+ HUMAN_AFTER = VLAN_HELP
31
34
  end
32
35
 
33
36
  validates :tenant_vlan_ranges,
@@ -37,7 +40,7 @@ module Staypuft
37
40
 
38
41
  module NetworkerTenantInterface
39
42
  HUMAN = N_('Which interface to use for tenant networks:')
40
- HUMAN_AFTER = N_('(i.e. eth0, em1, etc.)')
43
+ HUMAN_AFTER = INTERFACE_HELP
41
44
  end
42
45
 
43
46
  validates :networker_tenant_interface,
@@ -52,7 +55,7 @@ module Staypuft
52
55
 
53
56
  module ExternalInterfaceName
54
57
  HUMAN = N_('External interface connected to')
55
- HUMAN_AFTER = N_('(interface) (i.e. eth1)')
58
+ HUMAN_AFTER = INTERFACE_HELP
56
59
  end
57
60
 
58
61
  validates :external_interface_name,
@@ -68,7 +71,7 @@ module Staypuft
68
71
 
69
72
  module VlanRangesForExternalNetwork
70
73
  HUMAN = N_('VLAN Range for external network')
71
- HUMAN_AFTER = N_('i.e. physnet1:1000:2999')
74
+ HUMAN_AFTER = N_('i.e. 1000:2999')
72
75
  end
73
76
 
74
77
  validates :vlan_ranges_for_external_network,
@@ -78,7 +81,7 @@ module Staypuft
78
81
 
79
82
  module ComputeTenantInterface
80
83
  HUMAN = N_('Which interface to use for tenant networks:')
81
- HUMAN_AFTER = N_('(i.e. eth0, em1, etc.)')
84
+ HUMAN_AFTER = INTERFACE_HELP
82
85
  end
83
86
 
84
87
  validates :compute_tenant_interface,
@@ -86,7 +89,7 @@ module Staypuft
86
89
  # TODO: interface name format validation
87
90
 
88
91
  def set_defaults
89
- self.network_segmentation = NetworkSegmentation::VXLAN
92
+ self.network_segmentation = NetworkSegmentation::VXLAN
90
93
  self.use_external_interface = 'false'
91
94
  end
92
95
 
@@ -110,26 +113,19 @@ module Staypuft
110
113
  [self.network_segmentation, *(SEGMENTATION_LIST - [self.network_segmentation])]
111
114
  end
112
115
 
113
- def controller_ovs_bridge_mappings
114
- if self.vlan_segmentation?
115
- ["physnet-tenants:br-#{self.networker_tenant_interface}",
116
- ('physnet-external:br-ex' if self.use_external_interface?)].compact
117
- else
118
- []
119
- end
116
+ def networker_ovs_bridge_mappings
117
+ [("physnet-tenants:br-#{self.networker_tenant_interface}" unless self.enable_tunneling?),
118
+ ('physnet-external:br-ex' if self.use_external_interface?)].compact
120
119
  end
121
120
 
122
- def controller_ovs_bridge_uplinks
123
- if self.vlan_segmentation?
124
- ["br-#{self.networker_tenant_interface}:#{self.networker_tenant_interface}",
125
- ("br-ex:#{self.external_interface_name}" if self.use_external_interface?)]
126
- else
127
- []
128
- end
121
+ def networker_ovs_bridge_uplinks
122
+ [("br-#{self.networker_tenant_interface}:#{self.networker_tenant_interface}" unless self.enable_tunneling?),
123
+ ("br-ex:#{self.external_interface_name}" if self.use_external_interface?)
124
+ ].compact
129
125
  end
130
126
 
131
127
  def compute_ovs_bridge_mappings
132
- if self.vlan_segmentation?
128
+ if !self.enable_tunneling?
133
129
  ["physnet-tenants:br-#{self.compute_tenant_interface}"]
134
130
  else
135
131
  []
@@ -137,22 +133,26 @@ module Staypuft
137
133
  end
138
134
 
139
135
  def compute_ovs_bridge_uplinks
140
- if self.vlan_segmentation?
136
+ if !self.enable_tunneling?
141
137
  ["br-#{self.compute_tenant_interface}:#{self.compute_tenant_interface}"]
142
138
  else
143
139
  []
144
140
  end
145
141
  end
146
142
 
147
- # FIXME: mapping is off here -- both external and tenant vlan ranges map to the same back end
148
- # params: fix this with morazi in the AM
149
- def ml2_network_vlan_ranges
150
- if self.external_network_vlan?
151
- [self.vlan_ranges_for_external_network]
143
+ def compute_vlan_ranges
144
+ if self.vlan_segmentation?
145
+ ["physnet-tenants:#{self.tenant_vlan_ranges}"]
152
146
  else
153
147
  []
154
148
  end
155
149
  end
150
+
151
+ def networker_vlan_ranges
152
+ [("physnet-tenants:#{self.tenant_vlan_ranges}" if self.vlan_segmentation?),
153
+ ("physnet-external:#{self.vlan_ranges_for_external_network}" if self.external_network_vlan?)].compact
154
+ end
155
+
156
156
  def vlan_segmentation?
157
157
  self.network_segmentation == NetworkSegmentation::VLAN
158
158
  end
@@ -161,5 +161,9 @@ module Staypuft
161
161
  self.use_external_interface? && self.use_vlan_for_external_network?
162
162
  end
163
163
 
164
+ def enable_tunneling?
165
+ [NetworkSegmentation::VXLAN, NetworkSegmentation::GRE].include?(network_segmentation)
166
+ end
167
+
164
168
  end
165
169
  end
@@ -4,6 +4,9 @@ module Staypuft
4
4
  'nova'
5
5
  end
6
6
 
7
+ INTERFACE_HELP = Deployment::NeutronService::INTERFACE_HELP
8
+ VLAN_HELP = Deployment::NeutronService::VLAN_HELP
9
+
7
10
  param_attr :network_manager, :vlan_range, :external_interface_name, :public_floating_range,
8
11
  :compute_tenant_interface, :private_fixed_range
9
12
 
@@ -20,7 +23,7 @@ module Staypuft
20
23
 
21
24
  module VlanRange
22
25
  HUMAN = N_('VLAN Range')
23
- HUMAN_AFTER = '[1-4094] (i.e. 10:100)'
26
+ HUMAN_AFTER = VLAN_HELP
24
27
  end
25
28
 
26
29
  validates :vlan_range,
@@ -31,7 +34,7 @@ module Staypuft
31
34
 
32
35
  module ExternalInterfaceName
33
36
  HUMAN = N_('Which interface to use for external networks:')
34
- HUMAN_AFTER = N_('(interface) (i.e. eth1)')
37
+ HUMAN_AFTER = INTERFACE_HELP
35
38
  end
36
39
 
37
40
  validates :external_interface_name, presence: true
@@ -47,7 +50,7 @@ module Staypuft
47
50
 
48
51
  module ComputeTenantInterface
49
52
  HUMAN = N_('Which interface to use for tenant networks:')
50
- HUMAN_AFTER = N_('(i.e. eth0, em1, etc.)')
53
+ HUMAN_AFTER = INTERFACE_HELP
51
54
  end
52
55
 
53
56
  validates :compute_tenant_interface,
@@ -56,7 +59,7 @@ module Staypuft
56
59
 
57
60
  module PrivateFixedRange
58
61
  HUMAN = N_('Private IP range for tenant networks:')
59
- HUMAN_AFTER = N_('("10.0.0.0/24", for example)')
62
+ HUMAN_AFTER = PublicFloatingRange::HUMAN_AFTER
60
63
  end
61
64
 
62
65
  validates :private_fixed_range, presence: true
@@ -212,7 +212,6 @@ module Staypuft
212
212
  Operatingsystem.where(name: 'RedHat', major: '6', minor: '5').first
213
213
  when Platform::RHEL7
214
214
  Operatingsystem.where(name: 'RedHat', major: '7', minor: '0').first
215
- Operatingsystem.where(name: 'RedHat', major: '6', minor: '5').first
216
215
  end or
217
216
  raise 'missing Operatingsystem'
218
217
  self.hostgroup.save!
@@ -10,7 +10,7 @@
10
10
  <thead>
11
11
  <tr>
12
12
  <th class="ca">
13
- <%= check_box_tag :check_all %>
13
+ <%= tag :input, type: 'checkbox', class: 'check_all' %>
14
14
  </th>
15
15
  <th><%= sort :name, :as => _('Name') %></th>
16
16
  <th class="hidden-s hidden-xs"><%= _('Deploying?') %></th>
@@ -14,7 +14,7 @@
14
14
  <thead>
15
15
  <tr>
16
16
  <th class="ca">
17
- <%= check_box_tag :check_all %>
17
+ <%= tag :input, type: 'checkbox', class: 'check_all' %>
18
18
  </th>
19
19
  <th><%= sort :name, :as => _('Name') %></th>
20
20
  <th class="hidden-s hidden-xs"><%= sort :ip, :as => _('IP Address') %></th>
@@ -10,7 +10,7 @@
10
10
  <thead>
11
11
  <tr>
12
12
  <th class="ca">
13
- <%= check_box_tag :check_all %>
13
+ <%= tag :input, type: 'checkbox', class: 'check_all' %>
14
14
  </th>
15
15
  <th><%= sort :name, :as => _('Name') %></th>
16
16
  <th class="hidden-s hidden-xs"><%= sort :ip, :as => _('IP Address') %></th>
@@ -1,50 +1,66 @@
1
- <% title _("%s Deployment - Advanced Configuration") % @deployment.name %>
1
+ <% title _("Edit - %s Configuration Parameters") % @deployment.name %>
2
2
  <% content_for(:title_actions) do %>
3
- <%= link_to _("Back to Summary"), summary_deployment_path(@deployment.id)%>
3
+ <%= link_to _("Back to Deployment"), deployment_path(@deployment.id) %>
4
+ <%= link_to _("Apply"), '',
5
+ class: "btn btn-primary",
6
+ id: 'edit_staypuft_deployment_submit' %>
7
+ <%= link_to _("Cancel"), summary_deployment_path(@deployment.id), :class => "btn btn-danger" %>
4
8
  <% end %>
5
9
 
10
+ <script>
11
+ $('#edit_staypuft_deployment_submit').click(function (e) {
12
+ $('#edit_staypuft_deployment').submit();
13
+ e.preventDefault();
14
+ });
15
+ </script>
6
16
 
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>
17
+ <%= form_for(@deployment,
18
+ :url => deployment_path, :method => 'PUT',
19
+ :html => { :class => "clearfix", id: 'edit_staypuft_deployment' }) do |f| %>
20
+ <%= base_errors_for @deployment %>
19
21
 
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" %>
22
+ <div class="col-md-12">
23
+ <div class="form-group tabbed_side_nav_form row">
24
+ <ul class="nav nav-pills nav-stacked col-md-3" data-tabs="pills">
25
+ <h3><%= _("Services") %></h3>
26
+ <% @service_hostgroup_map.each_with_index do |(service, hostgroup), i| %>
27
+ <li class="<%= 'active' if i == 0 %>">
28
+ <a href="#<%= service.name.parameterize.underscore %>" data-toggle="tab">
29
+ <%= service.name %>
30
+ </a>
31
+ </li>
32
+ <% end %>
33
+ </ul>
34
+
35
+ <div class="tab-content col-md-9">
36
+ <% @service_hostgroup_map.each_with_index do |(service, hostgroup), i| %>
37
+ <div class="tab-pane <%= 'active' if i == 0 %>" id="<%= service.name.parameterize.underscore %>">
38
+ <h3><%= "#{service.name} " + _("Service Configuration") %></h3>
39
+ <% if (params_hash = service.ui_params_for_form(hostgroup)).size > 0 %>
40
+ <% params_hash.each do |param_hash| %>
41
+ <div class="row">
42
+ <div class="col-md-4 control-label">
43
+ <%= label_tag param_hash[:param_key].key %>
44
+ </div>
45
+ <div class="col-md-5">
46
+ <%= text_field_tag format("staypuft_deployment[hostgroup_params][%s][puppetclass_params][%s][%s]",
47
+ param_hash[:hostgroup].id,
48
+ param_hash[:puppetclass].id,
49
+ param_hash[:param_key].key),
50
+ param_hash[:hostgroup].current_param_value_str(param_hash[:param_key]),
51
+ :class => "form-control",
52
+ :size => "45" %>
53
+ </div>
38
54
  </div>
39
- </div>
40
- <br/>
55
+ <br/>
56
+ <% end %>
57
+ <% else %>
58
+ <p><%= _("No configuration needed for this service.") %></p>
41
59
  <% 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 %>
60
+ <%# render "puppetclasses/classes_parameters", { :obj => service.hostgroups.first } %>
61
+ </div>
62
+ <% end %>
63
+ </div>
48
64
  </div>
49
65
  </div>
50
- </div>
66
+ <% end %>
@@ -1,36 +1,25 @@
1
1
  <% title @deployment.name %>
2
2
 
3
3
  <% content_for(:title_actions) do %>
4
-
4
+ <%= link_to(_("Advanced Configuration"), summary_deployment_path(@deployment.id), :class => '') %>
5
5
  <%= link_to(_("Revisit Setup Wizard"), if @deployment.deployed?
6
- deployment_step_path(deployment_id: @deployment, id: 'services_configuration')
7
- else
8
- deployment_steps_path(deployment_id: @deployment)
9
- end) %>
10
- <div class="btn-group dropdown keep-open">
11
- <button type="button" class="btn btn-default dropdown-toggle" role="button" href="#"
12
- data-toggle="dropdown" data-target="#">
13
- <%= _('Configuration') %>
14
- <span class="caret"></span>
15
- </button>
16
- <ul class="dropdown-menu dropdown keep-open" role="menu">
17
- <li><%= link_to(_("Summary"), summary_deployment_path(@deployment.id), :class => '') %></li>
18
- <li><%= link_to _("Advanced Configuration"), edit_deployment_path(@deployment.id)%></li>
19
- <li>
20
- <%= link_to(icon_text("cloud-upload", _("Import")),
21
- {},
22
- { :remote => true,
23
- :rel => 'popover',
24
- :data => { 'content' => "#{render partial: 'import_form'}",
25
- 'original-title' => _('Import Config'),
26
- 'placement' => 'left'} }) %>
27
- </li>
28
- <li>
29
- <%= link_to(icon_text("cloud-download", _("Export")),
30
- export_config_deployment_path(@deployment.id)) %>
31
- </li>
32
- </ul>
33
- </div>
6
+ deployment_step_path(deployment_id: @deployment, id: 'services_configuration')
7
+ else
8
+ deployment_steps_path(deployment_id: @deployment)
9
+ end) %>
10
+
11
+ <% if @deployment.in_progress? %>
12
+ <%= display_link_if_authorized(
13
+ _('Deploy in progress'),
14
+ hash_for_foreman_tasks_task_path(id: ForemanTasks::Lock.colliding_locks(@deployment, nil).first.task.id),
15
+ :class => 'btn-info') %>
16
+ <% else %>
17
+ <%= link_to(_("Deploy"),
18
+ "",
19
+ :class => %w(btn btn-primary),
20
+ :'data-toggle' => "modal",
21
+ :'data-target' => "#deploy_modal") %>
22
+ <% end %>
34
23
 
35
24
  <% if Rails.env.development? %>
36
25
  <div class="btn-group">
@@ -52,20 +41,6 @@
52
41
  </div>
53
42
  <% end %>
54
43
 
55
- <% if @deployment.in_progress? %>
56
- <%= display_link_if_authorized(
57
- _('Deploy in progress'),
58
- hash_for_foreman_tasks_task_path(id: ForemanTasks::Lock.colliding_locks(@deployment, nil).first.task.id),
59
- :class => 'btn-info') %>
60
- <% else %>
61
- <%= link_to(_("Deploy"),
62
- "",
63
- :class => %w(btn btn-primary),
64
- :'data-toggle' => "modal",
65
- :'data-target' => "#deploy_modal") %>
66
- <% end %>
67
-
68
-
69
44
  <%= help_path %>
70
45
  <% end %>
71
46
 
@@ -1,30 +1,60 @@
1
- <% title _("%s Summary") % @deployment.name %>
1
+ <% title _("%s Configuration Parameters") % @deployment.name %>
2
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)%>
3
+ <%= link_to _("Back to Deployment"), deployment_path(@deployment.id) %>
4
+ <%= link_to(icon_text("cloud-upload", _("Import")),
5
+ {},
6
+ { :remote => true,
7
+ :rel => 'popover',
8
+ :data => { 'content' => "#{render partial: 'import_form'}",
9
+ 'original-title' => _('Import Config'),
10
+ 'placement' => 'left' } }) %>
11
+ <%= link_to(icon_text("cloud-download", _("Export")),
12
+ export_config_deployment_path(@deployment.id)) %>
13
+ <%= link_to _("Edit"), edit_deployment_path(@deployment.id) %>
5
14
  <% end %>
6
15
 
7
16
  <div class="col-md-12">
8
- <% @service_hostgroup_map.each_with_index do |(service, hostgroup), i| %>
9
- <div class="well <%= 'active' if i == 0 %>" id="<%= service.name.parameterize.underscore %>">
10
- <h3><%= "#{service.name} " + _("Service Configuration") %></h3>
11
- <% if (params_hash = service.ui_params_for_form(hostgroup)).size > 0 %>
12
- <% params_hash.each do |param_hash| %>
13
- <div class="row">
14
- <div class="col-md-3 text-right">
15
- <%= label_tag param_hash[:param_key].key %>
16
- </div>
17
- <div class="col-md-9">
18
- <%= content_tag "staypuft_deployment[hostgroup_params][#{param_hash[:hostgroup].id}][puppetclass_params][#{param_hash[:puppetclass].id}][#{param_hash[:param_key].key}]", param_hash[:hostgroup].current_param_value_str(param_hash[:param_key]), :class=>"" %>
19
- </div>
20
- </div>
21
- <br/>
22
- <% end %>
23
- <% else %>
24
- <div class="row">
25
- <p class="col-md-12"><%= _("No configuration for this service.") %></p>
17
+ <div class="form-group tabbed_side_nav_form row">
18
+ <ul class="nav nav-pills nav-stacked col-md-3" data-tabs="pills">
19
+ <h3><%= _("Services") %></h3>
20
+ <% @service_hostgroup_map.each_with_index do |(service, hostgroup), i| %>
21
+ <li class="<%= 'active' if i == 0 %>">
22
+ <a href="#<%= service.name.parameterize.underscore %>" data-toggle="tab">
23
+ <%= service.name %>
24
+ </a>
25
+ </li>
26
+ <% end %>
27
+ </ul>
28
+
29
+ <div class="tab-content col-md-9">
30
+ <% @service_hostgroup_map.each_with_index do |(service, hostgroup), i| %>
31
+ <div class="tab-pane <%= 'active' if i == 0 %>" id="<%= service.name.parameterize.underscore %>">
32
+ <h3><%= "#{service.name} " + _("Service Configuration") %></h3>
33
+ <% if (params_hash = service.ui_params_for_form(hostgroup)).size > 0 %>
34
+ <% params_hash.each do |param_hash| %>
35
+ <div class="row">
36
+ <div class="col-md-4 control-label">
37
+ <%= label_tag param_hash[:param_key].key %>
38
+ </div>
39
+ <div class="col-md-8">
40
+ <%= text_field_tag format("staypuft_deployment[hostgroup_params][%s][puppetclass_params][%s][%s]",
41
+ param_hash[:hostgroup].id,
42
+ param_hash[:puppetclass].id,
43
+ param_hash[:param_key].key),
44
+ param_hash[:hostgroup].current_param_value_str(param_hash[:param_key]),
45
+ :class => "form-control",
46
+ :size => "45",
47
+ disabled: true %>
48
+ </div>
49
+ </div>
50
+ <br/>
51
+ <% end %>
52
+ <% else %>
53
+ <p><%= _("No configuration needed for this service.") %></p>
54
+ <% end %>
55
+ <% # render "puppetclasses/classes_parameters", { :obj => service.hostgroups.first } %>
26
56
  </div>
27
57
  <% end %>
28
58
  </div>
29
- <% end %>
59
+ </div>
30
60
  </div>
@@ -11,11 +11,10 @@
11
11
  <%= text_f f, :name %>
12
12
  <%= textarea_f f, :description, :rows => 3 %>
13
13
 
14
- <% { layout_name: Staypuft::Deployment::LayoutName,
15
- networking: Staypuft::Deployment::Networking,
16
- # amqp_provider: Staypuft::Deployment::AmqpProvider,
17
- # platform: Staypuft::Deployment::Platform
18
- }.
14
+ <% { layout_name: Staypuft::Deployment::LayoutName,
15
+ networking: Staypuft::Deployment::Networking,
16
+ amqp_provider: Staypuft::Deployment::AmqpProvider,
17
+ platform: Staypuft::Deployment::Platform }.
19
18
  each do |attr, constants| %>
20
19
 
21
20
  <%= field(f, attr, :label => _(constants::HUMAN)) do
@@ -40,14 +39,14 @@
40
39
 
41
40
  <div class="single_password col-md-offset-0 hide">
42
41
  <%= password_f p, :single_password,
43
- :label => _("Password"),
44
- :class => "single_password",
45
- :help_inline => _("Password should be 6 characters or more"),
46
- :placeholder => '' %>
42
+ :label => _("Password"),
43
+ :class => "single_password",
44
+ :help_inline => _("Password should be 6 characters or more"),
45
+ :placeholder => '' %>
47
46
  <%= password_f p, :single_password_confirmation,
48
- :label => _("Confirm"),
49
- :class => "single_password",
50
- :placeholder => '' %>
47
+ :label => _("Confirm"),
48
+ :class => "single_password",
49
+ :placeholder => '' %>
51
50
  </div>
52
51
  <% end %>
53
52
 
@@ -1,3 +1,3 @@
1
1
  module Staypuft
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staypuft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Staypuft team