staypuft 0.4.9 → 0.4.10
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 +8 -8
- data/app/assets/javascripts/staypuft/host_edit.js +11 -4
- data/app/helpers/staypuft/hosts_helper.rb +7 -3
- data/app/lib/staypuft/seeder.rb +1 -0
- data/app/models/staypuft/interface_assigner.rb +1 -1
- data/app/overrides/hosts_edit_subnet_types.rb +21 -0
- data/app/views/hosts/_new_nic_fields.html.erb +1 -0
- data/app/views/hosts/_primary_interface_subnet.html.erb +14 -0
- data/app/views/nic/_subnet_id_field.html.erb +5 -2
- data/app/views/staypuft/deployments/_advanced_configuration.html.erb +6 -14
- data/app/views/staypuft/deployments/_param_field.html.erb +27 -0
- data/app/views/staypuft/deployments/edit.html.erb +5 -7
- data/lib/staypuft/version.rb +1 -1
- metadata +5 -2
- data/app/overrides/nic_base_form.rb +0 -11
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmJlNmExMjkyMzVlYjBjMzBlYzQzMDdjMDk5OGZjNmRkNTc5ZjI3OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzI0OWYxMWNmYjY0YTVjNDA2NmNhMDRlMDQzOTQ3YTVmMTBkNDlkZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjliYTY2ZDMzOTNhZTk3MzBjYmRhNzA0NDJjMDZhNDc2MjYyYjliZDFmNGU0
|
10
|
+
M2U3MGVlNDIzNDQ0OTY2YTZiYjY0MjZmNDg1ODY0M2UxZjJjYzBjZThkZjk5
|
11
|
+
NTg0YmY0YmM2ZGI4ZTc0NWJhMDc5NDRhZWY1OWEyNTE0NTJiZDI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZmJkYTcyOTg0ZDAxZTQzMDFmNTUzNzM0MjhiZDlkZDQ1OTAxOTcyYzczZDlk
|
14
|
+
NjZkNTQ0NzFlMDQ5NjIyNTBiMmE5YTcyNTA1NzdhY2ZjYTI2NWM4NDllMTMw
|
15
|
+
MDc3NTZmN2MzMjNkODZiMzliNzhlYzMwOTllMDg0Mjc4MDJiMTA=
|
@@ -75,14 +75,21 @@ $(function() {
|
|
75
75
|
|
76
76
|
|
77
77
|
$('fieldset#interface').each(function(idx, fieldset) {
|
78
|
-
|
78
|
+
subnet_select = find_network_interface_field($(fieldset), 'subnet_id', 'select');
|
79
|
+
update_subnet_types(subnet_select);
|
79
80
|
});
|
80
81
|
$(document).on('change', 'fieldset#interface select.interface_subnet', function(event) {
|
81
82
|
fieldset = $(event.target).parents('fieldset#interface');
|
82
|
-
update_subnet_types(fieldset);
|
83
|
-
});
|
84
|
-
function update_subnet_types(fieldset) {
|
85
83
|
subnet_select = find_network_interface_field($(fieldset), 'subnet_id', 'select');
|
84
|
+
update_subnet_types(subnet_select);
|
85
|
+
});
|
86
|
+
$('#host_subnet_id').each(function(idx, subnet_select) {
|
87
|
+
update_subnet_types($(subnet_select));
|
88
|
+
});
|
89
|
+
$(document).on('change', 'select#host_subnet_id', function(event) {
|
90
|
+
update_subnet_types($(event.target));
|
91
|
+
});
|
92
|
+
function update_subnet_types(subnet_select) {
|
86
93
|
subnet_types = subnet_select.data('types');
|
87
94
|
help_message = subnet_types[subnet_select.val()];
|
88
95
|
|
@@ -1,13 +1,17 @@
|
|
1
1
|
module Staypuft
|
2
2
|
module HostsHelper
|
3
3
|
|
4
|
-
def
|
4
|
+
def list_subnet_types_for_nic(nic, subnets)
|
5
|
+
list_subnet_types_for_host(nic.host, subnets)
|
6
|
+
end
|
7
|
+
|
8
|
+
def list_subnet_types_for_host(host, subnets)
|
5
9
|
types = {}
|
6
10
|
|
7
|
-
return types if
|
11
|
+
return types if host.nil? || host.deployment.nil?
|
8
12
|
|
9
13
|
subnets.each do |subnet|
|
10
|
-
types[subnet.id] = subnet_types(
|
14
|
+
types[subnet.id] = subnet_types(host.deployment, subnet)
|
11
15
|
end
|
12
16
|
|
13
17
|
return types
|
data/app/lib/staypuft/seeder.rb
CHANGED
@@ -701,6 +701,7 @@ module Staypuft
|
|
701
701
|
'pcmk_fs_options' => pcmk_fs_options },
|
702
702
|
'quickstack::pacemaker::cinder' => {
|
703
703
|
'volume' => volume,
|
704
|
+
'multiple_backends' => cinder_multiple_backends,
|
704
705
|
'backend_iscsi' => cinder_backend_iscsi,
|
705
706
|
'backend_nfs' => cinder_backend_nfs,
|
706
707
|
'backend_gluster' => cinder_backend_gluster,
|
@@ -110,7 +110,7 @@ module Staypuft
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def unassign_physicals
|
113
|
-
@host.interfaces.physical.where(:subnet_id => @subnet.id).each do |interface|
|
113
|
+
@host.interfaces.physical.non_vip.where(:subnet_id => @subnet.id).each do |interface|
|
114
114
|
unassign_physical(interface)
|
115
115
|
end
|
116
116
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# older deface requires code prefix for erb tags
|
2
|
+
if Gem.loaded_specs['deface'].version >= Gem::Version.new('1.0.0')
|
3
|
+
erb_tag = 'erb[loud]'
|
4
|
+
else
|
5
|
+
erb_tag = 'code[erb-loud]'
|
6
|
+
end
|
7
|
+
|
8
|
+
Deface::Override.new(:virtual_path => "nic/_base_form",
|
9
|
+
:name => "add_network_types_to_subnet_on_nic",
|
10
|
+
:replace => "#{erb_tag}:contains(':subnet_id')",
|
11
|
+
:template => "nic/_subnet_id_field")
|
12
|
+
|
13
|
+
Deface::Override.new(:virtual_path => "hosts/_unattended",
|
14
|
+
:name => "add_network_types_to_subnet_on_primary_interface",
|
15
|
+
:replace => "span#subnet_select",
|
16
|
+
:template => "hosts/_primary_interface_subnet")
|
17
|
+
|
18
|
+
Deface::Override.new(:virtual_path => "hosts/_unattended",
|
19
|
+
:name => "add_network_types_to_subnet_on_new_nic_form",
|
20
|
+
:replace => "#{erb_tag}:contains('new_child_fields_template')",
|
21
|
+
:template => "hosts/_new_nic_fields")
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= new_child_fields_template(f, :interfaces, {:partial => Nic::Managed.new, :object => Nic::Managed.new(:host => @host), :layout => 'nic/interface_layout'}) %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<span id="subnet_select">
|
2
|
+
<%= fields_for @host do |f| %>
|
3
|
+
<%= select_f f, :subnet_id, domain_subnets, :id, :to_label,
|
4
|
+
{ :include_blank => domain_subnets.any? ? blank_or_inherit_f(f, :subnet) : _("No subnets") },
|
5
|
+
{ :disabled => domain_subnets.empty?,
|
6
|
+
:data => { :url => SETTINGS[:unattended] ? freeip_subnets_path : '',
|
7
|
+
:subnets => subnets_ipam_data.to_json,
|
8
|
+
:types => list_subnet_types_for_host(@host, domain_subnets).to_json },
|
9
|
+
:label => _("Subnet"),
|
10
|
+
:help_inline => :indicator,
|
11
|
+
:onchange => 'subnet_selected(this);' }
|
12
|
+
%>
|
13
|
+
<% end %>
|
14
|
+
</span>
|
@@ -2,5 +2,8 @@
|
|
2
2
|
{ :include_blank => accessible_subnets.any? ? true : _("No subnets")},
|
3
3
|
{ :disabled => accessible_subnets.empty? ? true : false,
|
4
4
|
:class => 'interface_subnet',
|
5
|
-
|
6
|
-
|
5
|
+
:data => {
|
6
|
+
:url => freeip_subnets_path,
|
7
|
+
:types => list_subnet_types_for_nic(f.object, accessible_subnets).to_json
|
8
|
+
}
|
9
|
+
} %>
|
@@ -41,20 +41,12 @@
|
|
41
41
|
<%= label_tag param_hash[:param_key].key %>
|
42
42
|
</div>
|
43
43
|
<div class="col-md-8">
|
44
|
-
<%=
|
45
|
-
param_hash[:
|
46
|
-
param_hash[:
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
:size => "45",
|
51
|
-
disabled: true %>
|
52
|
-
<% if Staypuft::Concerns::LookupKeyExtensions.has_erb? value %>
|
53
|
-
<span class="help-block">
|
54
|
-
<%= _('evaluates to: ') %>
|
55
|
-
<%= Staypuft::Concerns::LookupKeyExtensions.evaluate_value param_hash[:hostgroup], value %>
|
56
|
-
</span>
|
57
|
-
<% end %>
|
44
|
+
<%= render "param_field", {:hostgroup => param_hash[:hostgroup],
|
45
|
+
:puppetclass => param_hash[:puppetclass],
|
46
|
+
:param_key => param_hash[:param_key],
|
47
|
+
:disabled => true,
|
48
|
+
:show_evaluation => true
|
49
|
+
} %>
|
58
50
|
</div>
|
59
51
|
</div>
|
60
52
|
<br/>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<% input_name = format("staypuft_deployment[hostgroup_params][%s][puppetclass_params][%s][%s]",
|
2
|
+
hostgroup.id,
|
3
|
+
puppetclass.id,
|
4
|
+
param_key.key)
|
5
|
+
param_value = hostgroup.current_param_value_str(param_key)
|
6
|
+
%>
|
7
|
+
<% unless param_key.key_type.to_sym == :hash %>
|
8
|
+
<%= text_field_tag input_name,
|
9
|
+
param_value,
|
10
|
+
{ :class => "form-control",
|
11
|
+
:size => "45",
|
12
|
+
disabled: local_assigns[:disabled] } %>
|
13
|
+
<% else %>
|
14
|
+
<%= text_area_tag input_name,
|
15
|
+
param_value,
|
16
|
+
{ :class => "form-control",
|
17
|
+
:size => "5",
|
18
|
+
disabled: local_assigns[:disabled] } %>
|
19
|
+
<% end %>
|
20
|
+
<% if local_assigns[:show_evaluation] %>
|
21
|
+
<% if Staypuft::Concerns::LookupKeyExtensions.has_erb? param_value %>
|
22
|
+
<span class="help-block">
|
23
|
+
<%= _('evaluates to: ') %>
|
24
|
+
<%= Staypuft::Concerns::LookupKeyExtensions.evaluate_value hostgroup, param_value %>
|
25
|
+
</span>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
@@ -36,13 +36,11 @@
|
|
36
36
|
<%= label_tag param_hash[:param_key].key %>
|
37
37
|
</div>
|
38
38
|
<div class="col-md-5">
|
39
|
-
<%=
|
40
|
-
param_hash[:
|
41
|
-
param_hash[:
|
42
|
-
|
43
|
-
|
44
|
-
:class => "form-control",
|
45
|
-
:size => "45" %>
|
39
|
+
<%= render "param_field", {:hostgroup => param_hash[:hostgroup],
|
40
|
+
:puppetclass => param_hash[:puppetclass],
|
41
|
+
:param_key => param_hash[:param_key],
|
42
|
+
:disabled => false
|
43
|
+
} %>
|
46
44
|
</div>
|
47
45
|
</div>
|
48
46
|
<br/>
|
data/lib/staypuft/version.rb
CHANGED
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.4.
|
4
|
+
version: 0.4.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Staypuft team
|
@@ -184,9 +184,11 @@ files:
|
|
184
184
|
- app/overrides/customize_foreman_tasks_show_page.rb
|
185
185
|
- app/overrides/foreman_hosts_edit.rb
|
186
186
|
- app/overrides/hide_subscription_manager_passwords.rb
|
187
|
-
- app/overrides/
|
187
|
+
- app/overrides/hosts_edit_subnet_types.rb
|
188
188
|
- app/overrides/select_multiple_systems_hostgroup.rb
|
189
189
|
- app/views/hosts/_fencing.html.erb
|
190
|
+
- app/views/hosts/_new_nic_fields.html.erb
|
191
|
+
- app/views/hosts/_primary_interface_subnet.html.erb
|
190
192
|
- app/views/nic/_subnet_id_field.html.erb
|
191
193
|
- app/views/staypuft/bonds/add_slave.js.erb
|
192
194
|
- app/views/staypuft/bonds/create.js.erb
|
@@ -213,6 +215,7 @@ files:
|
|
213
215
|
- app/views/staypuft/deployments/_hosts_header.html.erb
|
214
216
|
- app/views/staypuft/deployments/_hosts_table.html.erb
|
215
217
|
- app/views/staypuft/deployments/_import_form.html.erb
|
218
|
+
- app/views/staypuft/deployments/_param_field.html.erb
|
216
219
|
- app/views/staypuft/deployments/edit.html.erb
|
217
220
|
- app/views/staypuft/deployments/index.html.erb
|
218
221
|
- app/views/staypuft/deployments/show.html.erb
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# older deface requires code prefix for erb tags
|
2
|
-
if Gem.loaded_specs['deface'].version >= Gem::Version.new('1.0.0')
|
3
|
-
erb_tag = 'erb[loud]'
|
4
|
-
else
|
5
|
-
erb_tag = 'code[erb-loud]'
|
6
|
-
end
|
7
|
-
|
8
|
-
Deface::Override.new(:virtual_path => "nic/_base_form",
|
9
|
-
:name => "add_network_types_to_subnet",
|
10
|
-
:replace => "#{erb_tag}:contains(':subnet_id')",
|
11
|
-
:template => "nic/_subnet_id_field")
|