foreman_puppet 2.0.3 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/app/controllers/concerns/foreman_puppet/extensions/api_smart_proxies_controller.rb +7 -2
- data/app/controllers/concerns/foreman_puppet/extensions/hosts_controller_extensions.rb +1 -1
- data/app/models/concerns/foreman_puppet/extensions/provisioning_template.rb +1 -1
- data/app/services/foreman_puppet/host_info_providers/puppet_info.rb +1 -1
- data/app/views/foreman_puppet/config_groups/_config_group.html.erb +5 -1
- data/app/views/hosts/_form_puppet_enc_tab.html.erb +5 -4
- 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/environments_controller_test.rb +24 -18
- data/test/controllers/foreman_puppet/api/v2/hosts_controller_test.rb +10 -0
- data/test/controllers/foreman_puppet/api/v2/smart_class_parameters_controller_test.rb +2 -2
- data/test/controllers/foreman_puppet/environments_controller_test.rb +1 -1
- data/test/controllers/foreman_puppet/hosts_controller_test.rb +4 -27
- data/test/graphql/queries/environment_query_test.rb +4 -4
- data/test/graphql/queries/puppetclass_query_test.rb +4 -4
- data/test/integration/foreman_puppet/dashboard_js_test.rb +1 -2
- data/test/integration/foreman_puppet/environment_js_test.rb +1 -2
- data/test/integration/foreman_puppet/host_js_test.rb +31 -27
- data/test/integration/foreman_puppet/hostgroup_js_test.rb +1 -2
- data/test/integration/foreman_puppet/puppetclass_js_test.rb +1 -2
- data/test/integration/foreman_puppet/smartclass_parameter_js_test.rb +1 -2
- data/test/integration_puppet_helper.rb +3 -0
- data/test/models/foreman_puppet/host_puppet_facet_test.rb +13 -2
- data/test/models/foreman_puppet/host_test.rb +22 -22
- data/test/models/foreman_puppet/provisioning_template_test.rb +3 -3
- data/test/models/foreman_puppet/puppetclass_test.rb +1 -1
- data/test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb +1 -1
- data/test/services/foreman_puppet/host_info_providers/puppet_info_test.rb +3 -3
- data/test/unit/foreman_puppet/template_rendering_test.rb +1 -1
- metadata +36 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58ee61350aa65a2356723d032bbc56f894d2d00453f58fe01a6c5e9e05909c86
|
4
|
+
data.tar.gz: 1df9c5d674dea6b7bb5316c843925998fa748c77d3cb07864ebb399c46672421
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2be066de5444cd669b80687eaa7f8d1cf9a0735a01a739ff2daa464144b5015e0501d602afe881a3cb04915d1ea5202531b065a630b45b72df1e19dea2fc66a
|
7
|
+
data.tar.gz: f43cf893d84772b5b38ba13eff4a2e5c1b7a0374bfecf5fa69fba18b8197744bfe1f7b51a7f4983949f56c799bdf97b6b04f59d6a44e7d9210fbe64f4642071a
|
data/README.md
CHANGED
@@ -37,7 +37,9 @@ You can install it on Foreman 2.5 to prepare for the Foreman update.
|
|
37
37
|
|
38
38
|
|Foreman version|Plugin version|Notes |
|
39
39
|
|---------------|--------------|------------------------------------------|
|
40
|
-
| >= 3.
|
40
|
+
| >= 3.2 | ~> 3.0 | Required |
|
41
|
+
| ~> 3.1 | ~> 2.0 | Required |
|
42
|
+
| ~> 3.0 | ~> 1.0 | Required |
|
41
43
|
| >= 2.5 | ~> 0.1 | Optional; replaces Core features |
|
42
44
|
| < 2.5 | - | Not supported (functionality is in Core) |
|
43
45
|
|
@@ -3,6 +3,8 @@ module ForemanPuppet
|
|
3
3
|
module ApiSmartProxiesController
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
|
+
NewEnvironment = Struct.new('Environment', :name)
|
7
|
+
|
6
8
|
included do
|
7
9
|
before_action :find_required_puppet_proxy, only: [:import_puppetclasses]
|
8
10
|
before_action :find_environment_id, only: [:import_puppetclasses]
|
@@ -70,7 +72,7 @@ module ForemanPuppet
|
|
70
72
|
@changed['updated'].keys + @changed['ignored'].keys).uniq.sort
|
71
73
|
|
72
74
|
@environments = environment_names.map do |name|
|
73
|
-
|
75
|
+
NewEnvironment.new(name)
|
74
76
|
end
|
75
77
|
|
76
78
|
unless @environments.any?
|
@@ -87,6 +89,7 @@ module ForemanPuppet
|
|
87
89
|
@environments.any?
|
88
90
|
end
|
89
91
|
|
92
|
+
# rubocop:disable Metrics/MethodLength
|
90
93
|
def import_changed_proxy_environments
|
91
94
|
opts = { url: @smart_proxy.url }
|
92
95
|
opts[:env] = if @environment.present?
|
@@ -98,7 +101,8 @@ module ForemanPuppet
|
|
98
101
|
changed = @importer.changes
|
99
102
|
|
100
103
|
# check if environemnt id passed in URL is name of NEW environment in puppetmaster that doesn't exist in db
|
101
|
-
|
104
|
+
@environment ||= NewEnvironment.new(@env_id) if changed['new'].key?(@env_id)
|
105
|
+
if @environment
|
102
106
|
# only return :keys equal to @environment in @changed hash
|
103
107
|
%w[new obsolete updated ignored].each do |kind|
|
104
108
|
changed[kind].slice!(@environment.name) unless changed[kind].empty?
|
@@ -115,6 +119,7 @@ module ForemanPuppet
|
|
115
119
|
render_message(msg, status: :internal_server_error)
|
116
120
|
nil
|
117
121
|
end
|
122
|
+
# rubocop:enable Metrics/MethodLength
|
118
123
|
|
119
124
|
def find_required_puppet_proxy
|
120
125
|
id = params.key?('smart_proxy_id') ? params['smart_proxy_id'] : params['id']
|
@@ -3,7 +3,7 @@ module ForemanPuppet
|
|
3
3
|
module HostsControllerExtensions
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
|
-
PUPPETMASTER_ACTIONS = %i[externalNodes
|
6
|
+
PUPPETMASTER_ACTIONS = %i[externalNodes].freeze
|
7
7
|
PUPPET_AJAX_REQUESTS = %w[hostgroup_or_environment_selected puppetclass_parameters].freeze
|
8
8
|
|
9
9
|
MULTIPLE_EDIT_ACTIONS = %w[select_multiple_environment update_multiple_environment
|
@@ -5,7 +5,7 @@ module ForemanPuppet
|
|
5
5
|
|
6
6
|
included do
|
7
7
|
has_many :environments, through: :template_combinations
|
8
|
-
before_destroy
|
8
|
+
before_destroy EnsureNotUsedBy.new(:environments)
|
9
9
|
|
10
10
|
scoped_search relation: :environments, on: :name, rename: :environment, complete_value: true
|
11
11
|
|
@@ -1,4 +1,8 @@
|
|
1
|
-
|
1
|
+
<%
|
2
|
+
li_id = "#{added ? 'selected_' : '' }config_group_#{config_group.id}"
|
3
|
+
li_class = "#{added ? 'selected_config_group' : 'config_group'} #{css_class}"
|
4
|
+
%>
|
5
|
+
<%= content_tag :li, id: li_id, class: li_class do %>
|
2
6
|
<%= hidden_field_tag("#{type}[config_group_ids][]", config_group.id) if added == 'manually' %>
|
3
7
|
<span>
|
4
8
|
<%= link_to(icon_text('plus', config_group.name), '#', :rel=>'twipsy', :class => 'config_group_name',
|
@@ -11,13 +11,14 @@
|
|
11
11
|
<% end %>
|
12
12
|
|
13
13
|
<%= render 'foreman_puppet/puppetclasses/class_selection', obj: obj, resource_type: resource_type %>
|
14
|
+
|
15
|
+
<fieldset id="puppet_klasses_parameters" data-url="<%= foreman_puppet.url_for(controller: resource_type.to_s.pluralize.to_sym, action: :puppetclass_parameters, only_path: true) %>">
|
16
|
+
<h2><%= _('Puppet Class Parameters') %></h2>
|
17
|
+
<%= render 'foreman_puppet/puppetclasses/classes_parameters', obj: subject %>
|
18
|
+
</fieldset>
|
14
19
|
<% else %>
|
15
20
|
<%= alert(class: alert_class(:info),
|
16
21
|
header: _('Notice'),
|
17
22
|
text: _('Please select an environment first')) %>
|
18
23
|
<% end %>
|
19
24
|
|
20
|
-
<fieldset id="puppet_klasses_parameters" data-url="<%= foreman_puppet.url_for(controller: resource_type.to_s.pluralize.to_sym, action: :puppetclass_parameters, only_path: true) %>">
|
21
|
-
<h2><%= _('Puppet Class Parameters') %></h2>
|
22
|
-
<%= render 'foreman_puppet/puppetclasses/classes_parameters', obj: subject %>
|
23
|
-
</fieldset>
|
Binary file
|