foreman_setup 5.0.0 → 5.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/app/controllers/foreman_setup/provisioners_controller.rb +3 -3
- data/app/views/foreman_setup/provisioners/_step3.html.erb +35 -42
- data/lib/foreman_setup/version.rb +1 -1
- data/test/functional/foreman_setup/provisioners_controller_test.rb +36 -28
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 490654bc557051d61752f5245a69a2c2d3b0c077
|
4
|
+
data.tar.gz: d5ba8f8ba082ecc4f10ed8f09229bd8e7b59b1f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb3856fb4f5da2a16cc77dbc21d1fc8d46d2357d95880b6917aaa21f0190b2c0f52b44d9251556eefc66d852aa94dae89a9b7e1b376230e4579fb8723d00d353
|
7
|
+
data.tar.gz: cf09e5f85600f03e33e578c5471f7049dc75cefb3f5d706f46575d95df3092789e581d0e8d245e1f7958b4c0b8294afde01654d8bb1d14b21e86969443386df8
|
data/CHANGES.md
CHANGED
@@ -104,7 +104,7 @@ module ForemanSetup
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def step4_update
|
107
|
-
medium_id = params['foreman_setup_provisioner']['hostgroup_attributes']['medium_id'
|
107
|
+
medium_id = params['foreman_setup_provisioner']['hostgroup_attributes'].try(:[], 'medium_id')
|
108
108
|
if medium_id.to_i > 0
|
109
109
|
@medium = Medium.find(medium_id) || raise('unable to find medium')
|
110
110
|
else
|
@@ -121,9 +121,9 @@ module ForemanSetup
|
|
121
121
|
end
|
122
122
|
|
123
123
|
# Associate templates with OS and vice-versa
|
124
|
-
if @provisioner.host.os.family
|
124
|
+
if @provisioner.host.os.family && @provisioner.host.os.family.casecmp('Redhat').zero?
|
125
125
|
tmpl_name = 'Kickstart'
|
126
|
-
provision_tmpl_name = @provisioner.host.os.name
|
126
|
+
provision_tmpl_name = @provisioner.host.os.name.casecmp('Redhat').zero? ? 'Kickstart RHEL' : tmpl_name
|
127
127
|
ipxe_tmpl_name = 'Kickstart'
|
128
128
|
finish_tmpl_name = 'Kickstart default finish'
|
129
129
|
ptable_name = 'Kickstart default'
|
@@ -9,37 +9,30 @@
|
|
9
9
|
<h4><%= _("Install provisioning with DHCP") %></h4>
|
10
10
|
<div>
|
11
11
|
<pre>
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
<%= command %> \
|
20
|
-
--enable-<%= parameter[2..-1] %> \
|
21
|
-
<%= parameter %>-tftp=true \
|
22
|
-
<%= parameter %>-tftp-servername=<%= provisioner.provision_interface_data[:ip] %> \
|
23
|
-
<%= parameter %>-dhcp=true \
|
24
|
-
<%= parameter %>-dhcp-interface=<%= provisioner.provision_interface %> \
|
25
|
-
<%= parameter %>-dhcp-gateway=<%= provisioner.subnet.gateway %> \
|
12
|
+
foreman-installer \
|
13
|
+
--enable-foreman-proxy \
|
14
|
+
--foreman-proxy-tftp=true \
|
15
|
+
--foreman-proxy-tftp-servername=<%= provisioner.provision_interface_data[:ip] %> \
|
16
|
+
--foreman-proxy-dhcp=true \
|
17
|
+
--foreman-proxy-dhcp-interface=<%= provisioner.provision_interface %> \
|
18
|
+
--foreman-proxy-dhcp-gateway=<%= provisioner.subnet.gateway %> \
|
26
19
|
<% if provisioner.subnet.from.present? && provisioner.subnet.to.present? %>
|
27
|
-
|
20
|
+
--foreman-proxy-dhcp-range="<%= provisioner.subnet.from %> <%= provisioner.subnet.to %>" \
|
28
21
|
<% end %>
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
<%= provisioner.dns_forwarders.map { |f| "
|
22
|
+
--foreman-proxy-dhcp-nameservers="<%= provisioner.subnet.dns_primary %><%= ("," + provisioner.subnet.dns_secondary) unless provisioner.subnet.dns_secondary.blank? %>" \
|
23
|
+
--foreman-proxy-dns=true \
|
24
|
+
--foreman-proxy-dns-interface=<%= provisioner.provision_interface %> \
|
25
|
+
--foreman-proxy-dns-zone=<%= provisioner.domain.name %> \
|
26
|
+
--foreman-proxy-dns-reverse=<%= provisioner.rdns_zone %> \
|
27
|
+
<%= provisioner.dns_forwarders.map { |f| " --foreman-proxy-dns-forwarders=#{f} \\" }.join("\n") %>
|
35
28
|
<% if defined? Katello %>
|
36
|
-
|
37
|
-
|
38
|
-
|
29
|
+
--foreman-proxy-parent-fqdn=<%= Setting[:foreman_url] %> \
|
30
|
+
--foreman-proxy-foreman-oauth-key=<%= Setting[:oauth_consumer_key] %> \
|
31
|
+
--foreman-proxy-foreman-oauth-secret=<%= Setting[:oauth_consumer_secret] %>
|
39
32
|
<% else %>
|
40
|
-
|
41
|
-
|
42
|
-
|
33
|
+
--foreman-proxy-foreman-base-url=<%= Setting[:foreman_url] %> \
|
34
|
+
--foreman-proxy-oauth-consumer-key=<%= Setting[:oauth_consumer_key] %> \
|
35
|
+
--foreman-proxy-oauth-consumer-secret=<%= Setting[:oauth_consumer_secret] %>
|
43
36
|
<% end %>
|
44
37
|
</pre>
|
45
38
|
</div>
|
@@ -47,23 +40,23 @@
|
|
47
40
|
<h4><%= _("Install provisioning without DHCP") %></h4>
|
48
41
|
<div>
|
49
42
|
<pre>
|
50
|
-
|
51
|
-
--enable
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
<%= provisioner.dns_forwarders.map { |f| "
|
43
|
+
foreman-installer \
|
44
|
+
--enable-foreman-proxy \
|
45
|
+
--foreman-proxy-tftp=true \
|
46
|
+
--foreman-proxy-tftp-servername=<%= provisioner.provision_interface_data[:ip] %> \
|
47
|
+
--foreman-proxy-dns=true \
|
48
|
+
--foreman-proxy-dns-interface=<%= provisioner.provision_interface %> \
|
49
|
+
--foreman-proxy-dns-zone=<%= provisioner.domain.name %> \
|
50
|
+
--foreman-proxy-dns-reverse=<%= provisioner.rdns_zone %> \
|
51
|
+
<%= provisioner.dns_forwarders.map { |f| " --foreman-proxy-dns-forwarders=#{f} \\" }.join("\n") %>
|
59
52
|
<% if defined? Katello %>
|
60
|
-
|
61
|
-
|
62
|
-
|
53
|
+
--foreman-proxy-parent-fqdn=<%= Setting[:foreman_url] %> \
|
54
|
+
--foreman-proxy-foreman-oauth-key=<%= Setting[:oauth_consumer_key] %> \
|
55
|
+
--foreman-proxy-foreman-oauth-secret=<%= Setting[:oauth_consumer_secret] %>
|
63
56
|
<% else %>
|
64
|
-
|
65
|
-
|
66
|
-
|
57
|
+
--foreman-proxy-foreman-base-url=<%= Setting[:foreman_url] %> \
|
58
|
+
--foreman-proxy-oauth-consumer-key=<%= Setting[:oauth_consumer_key] %> \
|
59
|
+
--foreman-proxy-oauth-consumer-secret=<%= Setting[:oauth_consumer_secret] %>
|
67
60
|
<% end %>
|
68
61
|
</pre>
|
69
62
|
</div>
|
@@ -33,9 +33,11 @@ class ForemanSetup::ProvisionersControllerTest < ActionController::TestCase
|
|
33
33
|
|
34
34
|
prov = ForemanSetup::Provisioner.find_by_host_id(@host.id)
|
35
35
|
assert prov
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
as_admin do
|
37
|
+
assert_equal @host, prov.host
|
38
|
+
assert_equal @proxy, prov.smart_proxy
|
39
|
+
assert_equal 'eth0', prov.provision_interface
|
40
|
+
end
|
39
41
|
|
40
42
|
assert_redirected_to step2_foreman_setup_provisioner_path(prov)
|
41
43
|
end
|
@@ -69,23 +71,25 @@ class ForemanSetup::ProvisionersControllerTest < ActionController::TestCase
|
|
69
71
|
put :step2_update, {:id => prov.id, 'foreman_setup_provisioner' => {:subnet_attributes => {'name' => 'test', :network => '192.168.1.0', :mask => '255.255.255.0'}, :domain_name => prov.host.domain.name}}, set_session_user
|
70
72
|
assert_redirected_to step3_foreman_setup_provisioner_path(prov)
|
71
73
|
|
72
|
-
|
74
|
+
as_admin do
|
75
|
+
prov.reload
|
73
76
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
+
# Check new hg was created
|
78
|
+
assert Hostgroup.find_by_name("Provision from #{prov.host.name}")
|
79
|
+
assert prov.hostgroup
|
77
80
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
81
|
+
# Check nested subnet was created and saved
|
82
|
+
subnet = Subnet.find_by_network('192.168.1.0')
|
83
|
+
assert subnet
|
84
|
+
assert_equal 'test', subnet.name
|
85
|
+
assert prov.subnet
|
83
86
|
|
84
|
-
|
85
|
-
|
87
|
+
# Check domain was saved
|
88
|
+
assert_equal prov.host.domain, prov.domain
|
86
89
|
|
87
|
-
|
88
|
-
|
90
|
+
# Check domain/subnet association
|
91
|
+
assert_includes prov.domain.subnets, subnet
|
92
|
+
end
|
89
93
|
end
|
90
94
|
|
91
95
|
test '#step3' do
|
@@ -109,13 +113,15 @@ class ForemanSetup::ProvisionersControllerTest < ActionController::TestCase
|
|
109
113
|
assert_template 'foreman_setup/provisioners/_step4'
|
110
114
|
assert assigns(:medium)
|
111
115
|
|
112
|
-
|
116
|
+
as_admin do
|
117
|
+
prov.reload
|
113
118
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
+
# Check proxy feature-based assignments worked
|
120
|
+
assert_equal prov.smart_proxy.id, prov.subnet.dns_id
|
121
|
+
# assert_equal prov.smart_proxy.id, prov.domain.dns_id # BUG, not saved
|
122
|
+
assert_equal prov.smart_proxy.id, prov.subnet.dhcp_id
|
123
|
+
assert_equal prov.smart_proxy.id, prov.subnet.tftp_id
|
124
|
+
end
|
119
125
|
end
|
120
126
|
|
121
127
|
test '#step4_update' do
|
@@ -128,15 +134,17 @@ class ForemanSetup::ProvisionersControllerTest < ActionController::TestCase
|
|
128
134
|
put :step4_update, {:id => prov.id, 'foreman_setup_provisioner' => attrs}, set_session_user
|
129
135
|
assert_redirected_to step5_foreman_setup_provisioner_path(prov)
|
130
136
|
|
131
|
-
|
137
|
+
as_admin do
|
138
|
+
prov.reload
|
132
139
|
|
133
|
-
|
134
|
-
|
135
|
-
|
140
|
+
assert prov.hostgroup.medium
|
141
|
+
assert_equal 'test', prov.hostgroup.medium.name
|
142
|
+
assert_equal 'http://mirror.example.com', prov.hostgroup.medium.path
|
136
143
|
|
137
|
-
|
144
|
+
assert prov.hostgroup.ptable
|
138
145
|
|
139
|
-
|
146
|
+
# TODO: assert that the OS and templates are all correctly associated
|
147
|
+
end
|
140
148
|
end
|
141
149
|
|
142
150
|
test '#step5' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_setup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominic Cleal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Plugin for Foreman that helps set up provisioning.
|
14
14
|
email: dcleal@redhat.com
|
@@ -19,7 +19,7 @@ extra_rdoc_files:
|
|
19
19
|
- LICENSE
|
20
20
|
- README.md
|
21
21
|
files:
|
22
|
-
- .tx/config
|
22
|
+
- ".tx/config"
|
23
23
|
- CHANGES.md
|
24
24
|
- LICENSE
|
25
25
|
- README.md
|
@@ -91,17 +91,17 @@ require_paths:
|
|
91
91
|
- lib
|
92
92
|
required_ruby_version: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
|
-
- -
|
99
|
+
- - ">="
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.6.13
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Helps set up Foreman for provisioning
|