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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d5a8af59d427af8214977639e543c4cd4f4fa5f1
4
- data.tar.gz: 68f2949405814f9f0cb1009c9cfc0303c3a4965a
3
+ metadata.gz: 490654bc557051d61752f5245a69a2c2d3b0c077
4
+ data.tar.gz: d5ba8f8ba082ecc4f10ed8f09229bd8e7b59b1f3
5
5
  SHA512:
6
- metadata.gz: 3ae2f7c5df551c5640faa48e72ed4fc44006d9bb7fa773060c2461f3ae71cf66907b3eddd01b585c13bd94bdd22cf67a9ee8cdf00adf9c2c2d8695ebaec7ad90
7
- data.tar.gz: 93eb0b0da19d50b86dfef0630d32ba86b86f051acc048e2e466cbc7c22dbebf4810c436f54b4d73875f6645dac00e8186e87964179e04de1651da5c947d24479
6
+ metadata.gz: bb3856fb4f5da2a16cc77dbc21d1fc8d46d2357d95880b6917aaa21f0190b2c0f52b44d9251556eefc66d852aa94dae89a9b7e1b376230e4579fb8723d00d353
7
+ data.tar.gz: cf09e5f85600f03e33e578c5471f7049dc75cefb3f5d706f46575d95df3092789e581d0e8d245e1f7958b4c0b8294afde01654d8bb1d14b21e86969443386df8
data/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v5.0.1
4
+ * use case-insensitive OS family comparisons
5
+ * change Katello installer commands
6
+
3
7
  ## v5.0.0
4
8
  * fix Foreman 1.13 compatibility with parameter filtering
5
9
 
@@ -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 == 'Redhat'
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 == 'Redhat' ? 'Kickstart RHEL' : tmpl_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
- <% if defined? Katello %>
13
- <% command = 'katello-installer' %>
14
- <% parameter = '--capsule' %>
15
- <% else %>
16
- <% command = 'foreman-installer' %>
17
- <% parameter = '--foreman-proxy' %>
18
- <% end%>
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
- <%= parameter %>-dhcp-range="<%= provisioner.subnet.from %> <%= provisioner.subnet.to %>" \
20
+ --foreman-proxy-dhcp-range="<%= provisioner.subnet.from %> <%= provisioner.subnet.to %>" \
28
21
  <% end %>
29
- <%= parameter %>-dhcp-nameservers="<%= provisioner.subnet.dns_primary %><%= ("," + provisioner.subnet.dns_secondary) unless provisioner.subnet.dns_secondary.blank? %>" \
30
- <%= parameter %>-dns=true \
31
- <%= parameter %>-dns-interface=<%= provisioner.provision_interface %> \
32
- <%= parameter %>-dns-zone=<%= provisioner.domain.name %> \
33
- <%= parameter %>-dns-reverse=<%= provisioner.rdns_zone %> \
34
- <%= provisioner.dns_forwarders.map { |f| " #{parameter}-dns-forwarders=#{f} \\" }.join("\n") %>
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
- <%= parameter %>-parent-fqdn=<%= Setting[:foreman_url] %> \
37
- <%= parameter %>-foreman-oauth-key=<%= Setting[:oauth_consumer_key] %> \
38
- <%= parameter %>-foreman-oauth-secret=<%= Setting[:oauth_consumer_secret] %>
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
- <%= parameter %>-foreman-base-url=<%= Setting[:foreman_url] %> \
41
- <%= parameter %>-oauth-consumer-key=<%= Setting[:oauth_consumer_key] %> \
42
- <%= parameter %>-oauth-consumer-secret=<%= Setting[:oauth_consumer_secret] %>
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
- <%= command %> \
51
- --enable-<%= parameter[2..-1] %> \
52
- <%= parameter %>-tftp=true \
53
- <%= parameter %>-tftp-servername=<%= provisioner.provision_interface_data[:ip] %> \
54
- <%= parameter %>-dns=true \
55
- <%= parameter %>-dns-interface=<%= provisioner.provision_interface %> \
56
- <%= parameter %>-dns-zone=<%= provisioner.domain.name %> \
57
- <%= parameter %>-dns-reverse=<%= provisioner.rdns_zone %> \
58
- <%= provisioner.dns_forwarders.map { |f| " #{parameter}-dns-forwarders=#{f} \\" }.join("\n") %>
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
- <%= parameter %>-parent-fqdn=<%= Setting[:foreman_url] %> \
61
- <%= parameter %>-foreman-oauth-key=<%= Setting[:oauth_consumer_key] %> \
62
- <%= parameter %>-foreman-oauth-secret=<%= Setting[:oauth_consumer_secret] %>
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
- <%= parameter %>-foreman-base-url=<%= Setting[:foreman_url] %> \
65
- <%= parameter %>-oauth-consumer-key=<%= Setting[:oauth_consumer_key] %> \
66
- <%= parameter %>-oauth-consumer-secret=<%= Setting[:oauth_consumer_secret] %>
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>
@@ -1,3 +1,3 @@
1
1
  module ForemanSetup
2
- VERSION = '5.0.0'
2
+ VERSION = '5.0.1'
3
3
  end
@@ -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
- assert_equal @host, prov.host
37
- assert_equal @proxy, prov.smart_proxy
38
- assert_equal 'eth0', prov.provision_interface
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
- prov.reload
74
+ as_admin do
75
+ prov.reload
73
76
 
74
- # Check new hg was created
75
- assert Hostgroup.find_by_name("Provision from #{prov.host.name}")
76
- assert prov.hostgroup
77
+ # Check new hg was created
78
+ assert Hostgroup.find_by_name("Provision from #{prov.host.name}")
79
+ assert prov.hostgroup
77
80
 
78
- # Check nested subnet was created and saved
79
- subnet = Subnet.find_by_network('192.168.1.0')
80
- assert subnet
81
- assert_equal 'test', subnet.name
82
- assert prov.subnet
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
- # Check domain was saved
85
- assert_equal prov.host.domain, prov.domain
87
+ # Check domain was saved
88
+ assert_equal prov.host.domain, prov.domain
86
89
 
87
- # Check domain/subnet association
88
- assert_includes prov.domain.subnets, subnet
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
- prov.reload
116
+ as_admin do
117
+ prov.reload
113
118
 
114
- # Check proxy feature-based assignments worked
115
- assert_equal prov.smart_proxy.id, prov.subnet.dns_id
116
- # assert_equal prov.smart_proxy.id, prov.domain.dns_id # BUG, not saved
117
- assert_equal prov.smart_proxy.id, prov.subnet.dhcp_id
118
- assert_equal prov.smart_proxy.id, prov.subnet.tftp_id
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
- prov.reload
137
+ as_admin do
138
+ prov.reload
132
139
 
133
- assert prov.hostgroup.medium
134
- assert_equal 'test', prov.hostgroup.medium.name
135
- assert_equal 'http://mirror.example.com', prov.hostgroup.medium.path
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
- assert prov.hostgroup.ptable
144
+ assert prov.hostgroup.ptable
138
145
 
139
- # TODO: assert that the OS and templates are all correctly associated
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.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: 2016-08-04 00:00:00.000000000 Z
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.0.6
104
+ rubygems_version: 2.6.13
105
105
  signing_key:
106
106
  specification_version: 4
107
107
  summary: Helps set up Foreman for provisioning