foreman_puppet 3.0.1 → 3.0.4
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 +4 -4
- data/app/controllers/concerns/foreman_puppet/extensions/hosts_controller_extensions.rb +1 -1
- data/app/helpers/foreman_puppet/environments_helper.rb +1 -1
- data/app/helpers/foreman_puppet/puppetclass_lookup_keys_helper.rb +1 -1
- data/app/services/foreman_puppet/host_info_providers/puppet_info.rb +1 -1
- data/app/views/foreman_puppet/config_groups/index.html.erb +3 -1
- data/app/views/hosts/_form_puppet_enc_tab.html.erb +5 -4
- data/db/migrate/20220201205305_migrate_host_class_permission.foreman_puppet.rb +9 -0
- data/db/migrate/20220208135305_migrate_environment_ignore_type.foreman_puppet.rb +15 -0
- data/db/migrate_foreman/20090905150132_create_hostgroups_puppetclasses.foreman_puppet.rb +3 -1
- data/lib/foreman_puppet/register.rb +2 -1
- data/lib/foreman_puppet/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/ca/foreman_puppet.edit.po +1095 -0
- data/locale/ca/foreman_puppet.po +70 -1
- data/locale/ca/foreman_puppet.po.time_stamp +0 -0
- data/locale/cs_CZ/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/cs_CZ/foreman_puppet.edit.po +199 -184
- data/locale/cs_CZ/foreman_puppet.po +13 -2
- data/locale/de/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/de/foreman_puppet.edit.po +1122 -0
- data/locale/de/foreman_puppet.po +25 -13
- data/locale/de/foreman_puppet.po.time_stamp +0 -0
- data/locale/en/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/en/foreman_puppet.edit.po +33 -25
- data/locale/en/foreman_puppet.po +13 -1
- data/locale/en_GB/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/en_GB/foreman_puppet.edit.po +1097 -0
- data/locale/en_GB/foreman_puppet.po +13 -2
- data/locale/en_GB/foreman_puppet.po.time_stamp +0 -0
- data/locale/es/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/es/foreman_puppet.edit.po +1104 -0
- data/locale/es/foreman_puppet.po +13 -2
- data/locale/es/foreman_puppet.po.time_stamp +0 -0
- data/locale/foreman_puppet.pot +48 -25
- data/locale/fr/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/fr/foreman_puppet.edit.po +1112 -0
- data/locale/fr/foreman_puppet.po +13 -2
- data/locale/fr/foreman_puppet.po.time_stamp +0 -0
- data/locale/gl/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/gl/foreman_puppet.edit.po +1095 -0
- data/locale/gl/foreman_puppet.po +13 -2
- data/locale/gl/foreman_puppet.po.time_stamp +0 -0
- data/locale/it/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/it/foreman_puppet.edit.po +1099 -0
- data/locale/it/foreman_puppet.po +13 -2
- data/locale/it/foreman_puppet.po.time_stamp +0 -0
- data/locale/ja/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/ja/foreman_puppet.edit.po +1107 -0
- data/locale/ja/foreman_puppet.po +15 -4
- data/locale/ja/foreman_puppet.po.time_stamp +0 -0
- data/locale/ko/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/ko/foreman_puppet.edit.po +1096 -0
- data/locale/ko/foreman_puppet.po +13 -2
- data/locale/ko/foreman_puppet.po.time_stamp +0 -0
- data/locale/nl_NL/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/nl_NL/foreman_puppet.edit.po +1100 -0
- data/locale/nl_NL/foreman_puppet.po +13 -2
- data/locale/nl_NL/foreman_puppet.po.time_stamp +0 -0
- data/locale/pl/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/pl/foreman_puppet.edit.po +1099 -0
- data/locale/pl/foreman_puppet.po +13 -2
- data/locale/pl/foreman_puppet.po.time_stamp +0 -0
- data/locale/pt_BR/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/pt_BR/foreman_puppet.edit.po +1103 -0
- data/locale/pt_BR/foreman_puppet.po +13 -2
- data/locale/pt_BR/foreman_puppet.po.time_stamp +0 -0
- data/locale/ru/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/ru/foreman_puppet.edit.po +1104 -0
- data/locale/ru/foreman_puppet.po +15 -4
- data/locale/ru/foreman_puppet.po.time_stamp +0 -0
- data/locale/sv_SE/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/sv_SE/foreman_puppet.edit.po +1099 -0
- data/locale/sv_SE/foreman_puppet.po +13 -2
- data/locale/sv_SE/foreman_puppet.po.time_stamp +0 -0
- data/locale/zh_CN/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/zh_CN/foreman_puppet.edit.po +1108 -0
- data/locale/zh_CN/foreman_puppet.po +16 -5
- data/locale/zh_CN/foreman_puppet.po.time_stamp +0 -0
- data/locale/zh_TW/LC_MESSAGES/foreman_puppet.mo +0 -0
- data/locale/zh_TW/foreman_puppet.edit.po +1098 -0
- data/locale/zh_TW/foreman_puppet.po +13 -2
- data/locale/zh_TW/foreman_puppet.po.time_stamp +0 -0
- data/test/controllers/foreman_puppet/api/v2/hosts_controller_test.rb +10 -0
- data/test/controllers/foreman_puppet/hosts_controller_test.rb +4 -27
- data/test/helpers/foreman_puppet/puppetclass_lookup_keys_helper_test.rb +34 -0
- data/test/integration/foreman_puppet/host_js_test.rb +14 -9
- data/test/models/foreman_puppet/host_puppet_facet_test.rb +11 -0
- metadata +39 -3
|
@@ -8,10 +8,9 @@
|
|
|
8
8
|
# 0868a4d1af5275b3f70b0a6dac4c99a4, 2021
|
|
9
9
|
# Bryan Kearney <bryan.kearney@gmail.com>, 2021
|
|
10
10
|
#
|
|
11
|
-
#, fuzzy
|
|
12
11
|
msgid ""
|
|
13
12
|
msgstr ""
|
|
14
|
-
"Project-Id-Version: foreman_puppet
|
|
13
|
+
"Project-Id-Version: foreman_puppet 3.0.2\n"
|
|
15
14
|
"Report-Msgid-Bugs-To: \n"
|
|
16
15
|
"PO-Revision-Date: 2021-02-03 16:30+0000\n"
|
|
17
16
|
"Last-Translator: Bryan Kearney <bryan.kearney@gmail.com>, 2021\n"
|
|
@@ -89,6 +88,9 @@ msgstr "所有環境 -(未篩選)"
|
|
|
89
88
|
msgid "Allow assigning Puppet environments and classes to the Foreman Hosts."
|
|
90
89
|
msgstr ""
|
|
91
90
|
|
|
91
|
+
msgid "Autosign entries"
|
|
92
|
+
msgstr ""
|
|
93
|
+
|
|
92
94
|
msgid "Available Classes"
|
|
93
95
|
msgstr "可用類別"
|
|
94
96
|
|
|
@@ -104,6 +106,9 @@ msgstr ""
|
|
|
104
106
|
msgid "Cancel"
|
|
105
107
|
msgstr "取消"
|
|
106
108
|
|
|
109
|
+
msgid "Certificates"
|
|
110
|
+
msgstr ""
|
|
111
|
+
|
|
107
112
|
msgid "Change Environment"
|
|
108
113
|
msgstr "更改環境"
|
|
109
114
|
|
|
@@ -341,6 +346,9 @@ msgstr ""
|
|
|
341
346
|
msgid "If true, will raise an error if there is no default value and no matcher provide a value"
|
|
342
347
|
msgstr "若為真而沒有預設值並且比對器未提供值的話,將會造成錯誤發生。"
|
|
343
348
|
|
|
349
|
+
msgid "If you are planning to use Foreman as an external node classifier you should provide information about one or more environments.<br/> This information is commonly imported from a pre-existing Puppet configuration by the use of the <a target=\"_blank\" href=${getManualURL( '4.2.2Classes' )}>Puppet classes and environment importer.</a>"
|
|
350
|
+
msgstr ""
|
|
351
|
+
|
|
344
352
|
msgid "Ignored classes in the environments: %s"
|
|
345
353
|
msgstr ""
|
|
346
354
|
|
|
@@ -677,6 +685,9 @@ msgstr "智慧類別參數"
|
|
|
677
685
|
msgid "Smart Class Parameters"
|
|
678
686
|
msgstr ""
|
|
679
687
|
|
|
688
|
+
msgid "Some Puppet Classes are unavailable in the selected environment"
|
|
689
|
+
msgstr ""
|
|
690
|
+
|
|
680
691
|
msgid "Successfully overridden all parameters of Puppet class %s"
|
|
681
692
|
msgstr "已成功置換 Puppet 類別 %s 的所有參數"
|
|
682
693
|
|
|
File without changes
|
|
@@ -79,12 +79,22 @@ module ForemanPuppet
|
|
|
79
79
|
|
|
80
80
|
test 'should update with puppet class' do
|
|
81
81
|
puppetclass = environment.puppetclasses.first
|
|
82
|
+
# uses the deprecated version of params passing without namespace, to test it works :)
|
|
82
83
|
put :update, params: { id: host.id, host: { environment_id: environment.id, puppetclass_ids: [puppetclass.id] } }
|
|
83
84
|
assert_response :success
|
|
84
85
|
response = JSON.parse(@response.body)
|
|
85
86
|
assert_equal environment.id, response['environment_id'], "Can't update host with environment #{environment}"
|
|
86
87
|
assert_equal puppetclass.id, response['puppetclasses'][0]['id'], "Can't update host with puppetclass #{puppetclass}"
|
|
87
88
|
end
|
|
89
|
+
|
|
90
|
+
test 'should remove puppetclass by passing empty array' do
|
|
91
|
+
host2 = FactoryBot.create(:host, :with_puppet_enc, :with_puppetclass)
|
|
92
|
+
|
|
93
|
+
put :update, params: { id: host2.id, host: { puppet_attributes: { puppetclass_ids: [] } } }
|
|
94
|
+
assert_response :success
|
|
95
|
+
response = JSON.parse(@response.body)
|
|
96
|
+
assert_empty(response['puppetclasses'], 'Can not remove puppetclasses')
|
|
97
|
+
end
|
|
88
98
|
end
|
|
89
99
|
|
|
90
100
|
describe '#enc' do
|
|
@@ -201,7 +201,6 @@ module ForemanPuppet
|
|
|
201
201
|
test 'hosts with a registered smart proxy on should get externalNodes successfully' do
|
|
202
202
|
User.current = nil
|
|
203
203
|
Setting[:restrict_registered_smart_proxies] = true
|
|
204
|
-
Setting[:require_ssl_smart_proxies] = false
|
|
205
204
|
|
|
206
205
|
Resolv.any_instance.stubs(:getnames).returns(['else.where'])
|
|
207
206
|
get :externalNodes, params: { name: host1.name, format: 'yml' }
|
|
@@ -211,7 +210,6 @@ module ForemanPuppet
|
|
|
211
210
|
test 'hosts without a registered smart proxy on should not be able to get externalNodes' do
|
|
212
211
|
User.current = nil
|
|
213
212
|
Setting[:restrict_registered_smart_proxies] = true
|
|
214
|
-
Setting[:require_ssl_smart_proxies] = false
|
|
215
213
|
|
|
216
214
|
Resolv.any_instance.stubs(:getnames).returns(['another.host'])
|
|
217
215
|
get :externalNodes, params: { name: host1.name, format: 'yml' }
|
|
@@ -221,7 +219,6 @@ module ForemanPuppet
|
|
|
221
219
|
test 'hosts with a registered smart proxy and SSL cert should get externalNodes successfully' do
|
|
222
220
|
User.current = nil
|
|
223
221
|
Setting[:restrict_registered_smart_proxies] = true
|
|
224
|
-
Setting[:require_ssl_smart_proxies] = true
|
|
225
222
|
|
|
226
223
|
@request.env['HTTPS'] = 'on'
|
|
227
224
|
@request.env['SSL_CLIENT_S_DN'] = 'CN=else.where'
|
|
@@ -234,7 +231,6 @@ module ForemanPuppet
|
|
|
234
231
|
test 'hosts in trusted hosts list and SSL cert should get externalNodes successfully' do
|
|
235
232
|
User.current = nil
|
|
236
233
|
Setting[:restrict_registered_smart_proxies] = true
|
|
237
|
-
Setting[:require_ssl_smart_proxies] = true
|
|
238
234
|
Setting[:trusted_hosts] = ['else.where']
|
|
239
235
|
|
|
240
236
|
@request.env['HTTPS'] = 'on'
|
|
@@ -248,7 +244,6 @@ module ForemanPuppet
|
|
|
248
244
|
test 'hosts with comma-separated SSL DN should get externalNodes successfully' do
|
|
249
245
|
User.current = nil
|
|
250
246
|
Setting[:restrict_registered_smart_proxies] = true
|
|
251
|
-
Setting[:require_ssl_smart_proxies] = true
|
|
252
247
|
Setting[:trusted_hosts] = ['foreman.example']
|
|
253
248
|
|
|
254
249
|
@request.env['HTTPS'] = 'on'
|
|
@@ -262,7 +257,6 @@ module ForemanPuppet
|
|
|
262
257
|
test 'hosts with slash-separated SSL DN should get externalNodes successfully' do
|
|
263
258
|
User.current = nil
|
|
264
259
|
Setting[:restrict_registered_smart_proxies] = true
|
|
265
|
-
Setting[:require_ssl_smart_proxies] = true
|
|
266
260
|
Setting[:trusted_hosts] = ['foreman.linux.lab.local']
|
|
267
261
|
|
|
268
262
|
@request.env['HTTPS'] = 'on'
|
|
@@ -276,53 +270,37 @@ module ForemanPuppet
|
|
|
276
270
|
test 'hosts without a registered smart proxy but with an SSL cert should not be able to get externalNodes' do
|
|
277
271
|
User.current = nil
|
|
278
272
|
Setting[:restrict_registered_smart_proxies] = true
|
|
279
|
-
Setting[:require_ssl_smart_proxies] = true
|
|
280
273
|
|
|
281
274
|
@request.env['HTTPS'] = 'on'
|
|
282
275
|
@request.env['SSL_CLIENT_S_DN'] = 'CN=another.host'
|
|
283
276
|
@request.env['SSL_CLIENT_VERIFY'] = 'SUCCESS'
|
|
284
277
|
get :externalNodes, params: { name: host1.name, format: 'yml' }
|
|
285
|
-
|
|
278
|
+
assert_response :forbidden
|
|
286
279
|
end
|
|
287
280
|
|
|
288
281
|
test 'hosts with an unverified SSL cert should not be able to get externalNodes' do
|
|
289
282
|
User.current = nil
|
|
290
283
|
Setting[:restrict_registered_smart_proxies] = true
|
|
291
|
-
Setting[:require_ssl_smart_proxies] = true
|
|
292
284
|
|
|
293
285
|
@request.env['HTTPS'] = 'on'
|
|
294
286
|
@request.env['SSL_CLIENT_S_DN'] = 'CN=else.where'
|
|
295
287
|
@request.env['SSL_CLIENT_VERIFY'] = 'FAILURE'
|
|
296
288
|
get :externalNodes, params: { name: host1.name, format: 'yml' }
|
|
297
|
-
|
|
289
|
+
assert_response :forbidden
|
|
298
290
|
end
|
|
299
291
|
|
|
300
|
-
test 'when "
|
|
292
|
+
test 'when "require_ssl" is true, HTTP requests should not be able to get externalNodes' do
|
|
301
293
|
User.current = nil
|
|
302
294
|
Setting[:restrict_registered_smart_proxies] = true
|
|
303
|
-
Setting[:require_ssl_smart_proxies] = true
|
|
304
295
|
SETTINGS[:require_ssl] = true
|
|
305
296
|
|
|
306
297
|
Resolv.any_instance.stubs(:getnames).returns(['else.where'])
|
|
307
298
|
get :externalNodes, params: { name: host1.name, format: 'yml' }
|
|
308
|
-
|
|
309
|
-
end
|
|
310
|
-
|
|
311
|
-
test 'when "require_ssl_smart_proxies" is true and "require_ssl" is false, HTTP requests should be able to get externalNodes' do
|
|
312
|
-
User.current = nil
|
|
313
|
-
# since require_ssl_smart_proxies is only applicable to HTTPS connections, both should be set
|
|
314
|
-
Setting[:restrict_registered_smart_proxies] = true
|
|
315
|
-
Setting[:require_ssl_smart_proxies] = true
|
|
316
|
-
SETTINGS[:require_ssl] = false
|
|
317
|
-
|
|
318
|
-
Resolv.any_instance.stubs(:getnames).returns(['else.where'])
|
|
319
|
-
get :externalNodes, params: { name: host1.name, format: 'yml' }
|
|
320
|
-
assert_response :success
|
|
299
|
+
assert_response :redirect
|
|
321
300
|
end
|
|
322
301
|
|
|
323
302
|
test 'authenticated users over HTTP should be able to get externalNodes' do
|
|
324
303
|
Setting[:restrict_registered_smart_proxies] = true
|
|
325
|
-
Setting[:require_ssl_smart_proxies] = true
|
|
326
304
|
SETTINGS[:require_ssl] = false
|
|
327
305
|
|
|
328
306
|
Resolv.any_instance.stubs(:getnames).returns(['users.host'])
|
|
@@ -332,7 +310,6 @@ module ForemanPuppet
|
|
|
332
310
|
|
|
333
311
|
test 'authenticated users over HTTPS should be able to get externalNodes' do
|
|
334
312
|
Setting[:restrict_registered_smart_proxies] = true
|
|
335
|
-
Setting[:require_ssl_smart_proxies] = true
|
|
336
313
|
SETTINGS[:require_ssl] = false
|
|
337
314
|
|
|
338
315
|
Resolv.any_instance.stubs(:getnames).returns(['users.host'])
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
require 'test_puppet_helper'
|
|
2
|
+
|
|
3
|
+
module ForemanPuppet
|
|
4
|
+
class PuppetclassLookupKeysHelperTest < ActionView::TestCase
|
|
5
|
+
include PuppetclassLookupKeysHelper
|
|
6
|
+
|
|
7
|
+
describe '#overridable_puppet_lookup_keys' do
|
|
8
|
+
let(:parent_puppet_var) { FactoryBot.create(:puppetclass_lookup_key) }
|
|
9
|
+
let(:parent_hg) { FactoryBot.create(:hostgroup, :with_puppet_enc, environment: parent_puppet_var.environments.first) }
|
|
10
|
+
|
|
11
|
+
context 'with new hostgroup' do
|
|
12
|
+
subject do
|
|
13
|
+
hg = Hostgroup.new(parent: parent_hg)
|
|
14
|
+
hg.build_puppet
|
|
15
|
+
hg
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it 'returns inherited parameter' do
|
|
19
|
+
keys = overridable_puppet_lookup_keys(parent_puppet_var.param_classes.first, subject)
|
|
20
|
+
_(keys).must_include(parent_puppet_var)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
context 'with new host' do
|
|
25
|
+
subject { Host.new(hostgroup: parent_hg) }
|
|
26
|
+
|
|
27
|
+
it 'returns inherited parameter' do
|
|
28
|
+
keys = overridable_puppet_lookup_keys(parent_puppet_var.param_classes.first, subject)
|
|
29
|
+
_(keys).must_include(parent_puppet_var)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -60,7 +60,8 @@ module ForemanPuppet
|
|
|
60
60
|
|
|
61
61
|
close_interfaces_modal
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
click_button('Submit')
|
|
64
|
+
find('h5', text: /myhost1*/)
|
|
64
65
|
|
|
65
66
|
host = Host::Managed.search_for('name ~ "myhost1"').first
|
|
66
67
|
assert_equal env2.name, host.puppet.environment.name
|
|
@@ -94,8 +95,8 @@ module ForemanPuppet
|
|
|
94
95
|
fill_in 'host_interfaces_attributes_0_mac', with: '00:11:11:11:11:11'
|
|
95
96
|
fill_in 'host_interfaces_attributes_0_ip', with: '1.1.1.1'
|
|
96
97
|
close_interfaces_modal
|
|
97
|
-
|
|
98
|
-
find('
|
|
98
|
+
click_button('Submit')
|
|
99
|
+
find('h5', text: /myhost1*/) # wait for host details page
|
|
99
100
|
|
|
100
101
|
host = Host::Managed.search_for('name ~ "myhost1"').first
|
|
101
102
|
assert_equal env.name, host.puppet.environment.name
|
|
@@ -111,8 +112,9 @@ module ForemanPuppet
|
|
|
111
112
|
visit edit_host_path(host)
|
|
112
113
|
|
|
113
114
|
select2 env1.name, from: 'host_puppet_attributes_environment_id'
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
click_button('Submit')
|
|
116
|
+
find('h5', text: /#{host.name}/)
|
|
117
|
+
assert_current_path(host_details_page_path(host), ignore_query: true)
|
|
116
118
|
|
|
117
119
|
host.reload
|
|
118
120
|
assert_equal env1.name, host.puppet.environment.name
|
|
@@ -201,7 +203,8 @@ module ForemanPuppet
|
|
|
201
203
|
assert puppetclass_params.has_selector?("a[data-tag='override']", visible: :hidden)
|
|
202
204
|
assert_equal('false', find("#s2id_host_lookup_values_attributes_#{lookup_key.id}_value .select2-chosen").text)
|
|
203
205
|
select2 'true', from: "host_lookup_values_attributes_#{lookup_key.id}_value"
|
|
204
|
-
|
|
206
|
+
click_button('Submit')
|
|
207
|
+
find('h5', text: /#{host.name}/)
|
|
205
208
|
|
|
206
209
|
visit edit_host_path(host)
|
|
207
210
|
switch_form_tab('Puppet ENC')
|
|
@@ -217,7 +220,8 @@ module ForemanPuppet
|
|
|
217
220
|
assert puppetclass_params.find('textarea:enabled')
|
|
218
221
|
puppetclass_params.find("a[data-tag='remove']").click
|
|
219
222
|
assert puppetclass_params.find('textarea:disabled')
|
|
220
|
-
|
|
223
|
+
click_button('Submit')
|
|
224
|
+
find('h5', text: /#{host.name}/)
|
|
221
225
|
|
|
222
226
|
visit edit_host_path(host)
|
|
223
227
|
switch_form_tab('Puppet ENC')
|
|
@@ -226,7 +230,8 @@ module ForemanPuppet
|
|
|
226
230
|
puppetclass_params.find("a[data-tag='override']").click
|
|
227
231
|
expect(puppetclass_params).must_have_selector('textarea:enabled')
|
|
228
232
|
puppetclass_params.find('textarea').set('userCustom')
|
|
229
|
-
|
|
233
|
+
click_button('Submit')
|
|
234
|
+
find('h5', text: /#{host.name}/)
|
|
230
235
|
|
|
231
236
|
visit edit_host_path(host)
|
|
232
237
|
switch_form_tab('Puppet ENC')
|
|
@@ -271,7 +276,7 @@ module ForemanPuppet
|
|
|
271
276
|
switch_form_tab('Puppet ENC')
|
|
272
277
|
assert puppetclass_params.find('textarea').disabled?
|
|
273
278
|
click_button('Submit')
|
|
274
|
-
|
|
279
|
+
find('h5', text: /#{host.name}/)
|
|
275
280
|
end
|
|
276
281
|
end
|
|
277
282
|
|
|
@@ -53,6 +53,17 @@ module ForemanPuppet
|
|
|
53
53
|
end
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
+
describe '#puppetclass_ids=' do
|
|
57
|
+
test 'allows empting classes' do
|
|
58
|
+
host = FactoryBot.create(:host, :with_puppet_enc,
|
|
59
|
+
environment: environment,
|
|
60
|
+
puppetclasses: [puppetclass_both])
|
|
61
|
+
host.attributes = { puppet_attributes: { puppetclass_ids: [] } }
|
|
62
|
+
assert host.save, 'Host could not be saved after updating puppetclasses'
|
|
63
|
+
assert_empty host.reload.all_puppetclasses, 'Puppetclasses were not removed successfuly'
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
56
67
|
describe '#all_puppetclasses' do
|
|
57
68
|
test 'should return all classes for environment only' do
|
|
58
69
|
host = FactoryBot.create(:host, :with_puppet_enc,
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_puppet
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.
|
|
4
|
+
version: 3.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ondřej Ezr
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2022-03-01 00:00:00.000000000 Z
|
|
13
13
|
dependencies: []
|
|
14
14
|
description: Allow assigning Puppet environments and classes to the Foreman Hosts.
|
|
15
15
|
email:
|
|
@@ -188,6 +188,8 @@ files:
|
|
|
188
188
|
- db/migrate/20210924103241_remove_katello_id_from_environments.foreman_puppet.rb
|
|
189
189
|
- db/migrate/20211111125003_drop_puppetclasses_direct_references.foreman_puppet.rb
|
|
190
190
|
- db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
|
|
191
|
+
- db/migrate/20220201205305_migrate_host_class_permission.foreman_puppet.rb
|
|
192
|
+
- db/migrate/20220208135305_migrate_environment_ignore_type.foreman_puppet.rb
|
|
191
193
|
- db/migrate_foreman/20090722141107_create_environments.foreman_puppet.rb
|
|
192
194
|
- db/migrate_foreman/20090802062223_create_puppetclasses.foreman_puppet.rb
|
|
193
195
|
- db/migrate_foreman/20090905150132_create_hostgroups_puppetclasses.foreman_puppet.rb
|
|
@@ -214,49 +216,81 @@ files:
|
|
|
214
216
|
- locale/Makefile
|
|
215
217
|
- locale/action_names.rb
|
|
216
218
|
- locale/ca/LC_MESSAGES/foreman_puppet.mo
|
|
219
|
+
- locale/ca/foreman_puppet.edit.po
|
|
217
220
|
- locale/ca/foreman_puppet.po
|
|
221
|
+
- locale/ca/foreman_puppet.po.time_stamp
|
|
218
222
|
- locale/cs_CZ/LC_MESSAGES/foreman_puppet.mo
|
|
219
223
|
- locale/cs_CZ/foreman_puppet.edit.po
|
|
220
224
|
- locale/cs_CZ/foreman_puppet.po
|
|
221
225
|
- locale/cs_CZ/foreman_puppet.po.time_stamp
|
|
222
226
|
- locale/de/LC_MESSAGES/foreman_puppet.mo
|
|
227
|
+
- locale/de/foreman_puppet.edit.po
|
|
223
228
|
- locale/de/foreman_puppet.po
|
|
229
|
+
- locale/de/foreman_puppet.po.time_stamp
|
|
224
230
|
- locale/en/LC_MESSAGES/foreman_puppet.mo
|
|
225
231
|
- locale/en/foreman_puppet.edit.po
|
|
226
232
|
- locale/en/foreman_puppet.po
|
|
227
233
|
- locale/en/foreman_puppet.po.time_stamp
|
|
228
234
|
- locale/en/foreman_puppet.pox
|
|
229
235
|
- locale/en_GB/LC_MESSAGES/foreman_puppet.mo
|
|
236
|
+
- locale/en_GB/foreman_puppet.edit.po
|
|
230
237
|
- locale/en_GB/foreman_puppet.po
|
|
238
|
+
- locale/en_GB/foreman_puppet.po.time_stamp
|
|
231
239
|
- locale/es/LC_MESSAGES/foreman_puppet.mo
|
|
240
|
+
- locale/es/foreman_puppet.edit.po
|
|
232
241
|
- locale/es/foreman_puppet.po
|
|
242
|
+
- locale/es/foreman_puppet.po.time_stamp
|
|
233
243
|
- locale/foreman_puppet.pot
|
|
234
244
|
- locale/fr/LC_MESSAGES/foreman_puppet.mo
|
|
245
|
+
- locale/fr/foreman_puppet.edit.po
|
|
235
246
|
- locale/fr/foreman_puppet.po
|
|
247
|
+
- locale/fr/foreman_puppet.po.time_stamp
|
|
236
248
|
- locale/gemspec.rb
|
|
237
249
|
- locale/gl/LC_MESSAGES/foreman_puppet.mo
|
|
250
|
+
- locale/gl/foreman_puppet.edit.po
|
|
238
251
|
- locale/gl/foreman_puppet.po
|
|
252
|
+
- locale/gl/foreman_puppet.po.time_stamp
|
|
239
253
|
- locale/it/LC_MESSAGES/foreman_puppet.mo
|
|
254
|
+
- locale/it/foreman_puppet.edit.po
|
|
240
255
|
- locale/it/foreman_puppet.po
|
|
256
|
+
- locale/it/foreman_puppet.po.time_stamp
|
|
241
257
|
- locale/ja/LC_MESSAGES/foreman_puppet.mo
|
|
258
|
+
- locale/ja/foreman_puppet.edit.po
|
|
242
259
|
- locale/ja/foreman_puppet.po
|
|
260
|
+
- locale/ja/foreman_puppet.po.time_stamp
|
|
243
261
|
- locale/ko/LC_MESSAGES/foreman_puppet.mo
|
|
262
|
+
- locale/ko/foreman_puppet.edit.po
|
|
244
263
|
- locale/ko/foreman_puppet.po
|
|
264
|
+
- locale/ko/foreman_puppet.po.time_stamp
|
|
245
265
|
- locale/messages.mo
|
|
246
266
|
- locale/nl_NL/LC_MESSAGES/foreman_puppet.mo
|
|
267
|
+
- locale/nl_NL/foreman_puppet.edit.po
|
|
247
268
|
- locale/nl_NL/foreman_puppet.po
|
|
269
|
+
- locale/nl_NL/foreman_puppet.po.time_stamp
|
|
248
270
|
- locale/pl/LC_MESSAGES/foreman_puppet.mo
|
|
271
|
+
- locale/pl/foreman_puppet.edit.po
|
|
249
272
|
- locale/pl/foreman_puppet.po
|
|
273
|
+
- locale/pl/foreman_puppet.po.time_stamp
|
|
250
274
|
- locale/pt_BR/LC_MESSAGES/foreman_puppet.mo
|
|
275
|
+
- locale/pt_BR/foreman_puppet.edit.po
|
|
251
276
|
- locale/pt_BR/foreman_puppet.po
|
|
277
|
+
- locale/pt_BR/foreman_puppet.po.time_stamp
|
|
252
278
|
- locale/ru/LC_MESSAGES/foreman_puppet.mo
|
|
279
|
+
- locale/ru/foreman_puppet.edit.po
|
|
253
280
|
- locale/ru/foreman_puppet.po
|
|
281
|
+
- locale/ru/foreman_puppet.po.time_stamp
|
|
254
282
|
- locale/sv_SE/LC_MESSAGES/foreman_puppet.mo
|
|
283
|
+
- locale/sv_SE/foreman_puppet.edit.po
|
|
255
284
|
- locale/sv_SE/foreman_puppet.po
|
|
285
|
+
- locale/sv_SE/foreman_puppet.po.time_stamp
|
|
256
286
|
- locale/zh_CN/LC_MESSAGES/foreman_puppet.mo
|
|
287
|
+
- locale/zh_CN/foreman_puppet.edit.po
|
|
257
288
|
- locale/zh_CN/foreman_puppet.po
|
|
289
|
+
- locale/zh_CN/foreman_puppet.po.time_stamp
|
|
258
290
|
- locale/zh_TW/LC_MESSAGES/foreman_puppet.mo
|
|
291
|
+
- locale/zh_TW/foreman_puppet.edit.po
|
|
259
292
|
- locale/zh_TW/foreman_puppet.po
|
|
293
|
+
- locale/zh_TW/foreman_puppet.po.time_stamp
|
|
260
294
|
- package.json
|
|
261
295
|
- test/controllers/foreman_puppet/api/v2/config_groups_controller_test.rb
|
|
262
296
|
- test/controllers/foreman_puppet/api/v2/environments_controller_test.rb
|
|
@@ -292,6 +326,7 @@ files:
|
|
|
292
326
|
- test/graphql/queries/puppetclass_query_test.rb
|
|
293
327
|
- test/graphql/queries/puppetclasses_query_test.rb
|
|
294
328
|
- test/helpers/foreman_puppet/hosts_and_hostgroups_helper_test.rb
|
|
329
|
+
- test/helpers/foreman_puppet/puppetclass_lookup_keys_helper_test.rb
|
|
295
330
|
- test/helpers/foreman_puppet/puppetclasses_helper_test.rb
|
|
296
331
|
- test/integration/foreman_puppet/dashboard_js_test.rb
|
|
297
332
|
- test/integration/foreman_puppet/environment_js_test.rb
|
|
@@ -364,7 +399,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
364
399
|
- !ruby/object:Gem::Version
|
|
365
400
|
version: '0'
|
|
366
401
|
requirements: []
|
|
367
|
-
rubygems_version: 3.
|
|
402
|
+
rubygems_version: 3.3.4
|
|
368
403
|
signing_key:
|
|
369
404
|
specification_version: 4
|
|
370
405
|
summary: Add Puppet features to Foreman
|
|
@@ -389,6 +424,7 @@ test_files:
|
|
|
389
424
|
- test/graphql/queries/hostgroup_puppet_query_test.rb
|
|
390
425
|
- test/graphql/queries/environments_query_test.rb
|
|
391
426
|
- test/integration_puppet_helper.rb
|
|
427
|
+
- test/helpers/foreman_puppet/puppetclass_lookup_keys_helper_test.rb
|
|
392
428
|
- test/helpers/foreman_puppet/puppetclasses_helper_test.rb
|
|
393
429
|
- test/helpers/foreman_puppet/hosts_and_hostgroups_helper_test.rb
|
|
394
430
|
- test/models/foreman_puppet/config_group_class_test.rb
|