foreman_puppet 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/foreman_puppet/extensions/hostgroups_controller_extensions.rb +1 -1
- data/app/controllers/concerns/foreman_puppet/extensions/hosts_controller_extensions.rb +1 -1
- data/app/views/hosts/_form_puppet_enc_tab.html.erb +3 -4
- data/db/migrate/20200803113803_migrate_environment_to_puppet_facet.foreman_puppet.rb +2 -2
- data/lib/foreman_puppet/version.rb +1 -1
- data/test/factories/host_puppet_enhancements.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06c268d86cd3905acdfcd56bc9898df23218553a632bb167c08de6c708351ee8
|
4
|
+
data.tar.gz: fc9d44ecfdd418571796ccc39a302a5ac086bae221bc155ba5e827edfd45a9f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4169751ebd02e01e6628a8583490d7257e27c7f0852e7539fc42b4b989258d3efef9324c684db31776a0d8f48e9360d0e3d40bdb12c03e8dd66d923f7d521e2
|
7
|
+
data.tar.gz: a0384e376fa23ed7dd0ada27f525d04cbeaebd19a1933e91ce97628dc3a4abe74ba79d6857040e4c920071e3afeef7858d121329ecbd3f6db2aa0486de9dba5f
|
@@ -36,7 +36,7 @@ module ForemanPuppet
|
|
36
36
|
|
37
37
|
puppet.puppetclasses = ForemanPuppet::Puppetclass.where(id: params[:hostgroup][:puppetclass_ids])
|
38
38
|
puppet.config_groups = ForemanPuppet::ConfigGroup.where(id: params[:hostgroup][:config_group_ids])
|
39
|
-
render partial: 'hosts/form_puppet_enc_tab', locals: {
|
39
|
+
render partial: 'hosts/form_puppet_enc_tab', locals: { subject: @hostgroup, resource_type: :hostgroup }
|
40
40
|
end
|
41
41
|
|
42
42
|
def puppetclass_parameters
|
@@ -41,7 +41,7 @@ module ForemanPuppet
|
|
41
41
|
set_class_variables(@host)
|
42
42
|
::Taxonomy.as_taxonomy @organization, @location do
|
43
43
|
if @environment || @hostgroup
|
44
|
-
render partial: 'hosts/form_puppet_enc_tab', locals: {
|
44
|
+
render partial: 'hosts/form_puppet_enc_tab', locals: { subject: @host, resource_type: :host }
|
45
45
|
else
|
46
46
|
logger.info 'environment_id or hostgroup_id is required to render puppetclasses'
|
47
47
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
<% resource_type ||= pagelet.opts[:resource_type] %>
|
2
|
-
<%
|
3
|
-
<% obj = (host_or_hostgroup.puppet || host_or_hostgroup.build_puppet) if %i[host hostgroup].include?(resource_type) %>
|
2
|
+
<% obj = (subject.puppet || subject.build_puppet) if %i[host hostgroup].include?(resource_type) %>
|
4
3
|
<% if resource_type == :host %>
|
5
4
|
<span id="puppet_klasses_reload_url" data-url="<%= foreman_puppet.hostgroup_or_environment_selected_hosts_path %>"></span>
|
6
5
|
<% elsif resource_type == :hostgroup %>
|
@@ -18,7 +17,7 @@
|
|
18
17
|
text: _('Please select an environment first')) %>
|
19
18
|
<% end %>
|
20
19
|
|
21
|
-
<fieldset id="puppet_klasses_parameters" data-url="<%= foreman_puppet.url_for(action: :puppetclass_parameters, only_path: true) %>">
|
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) %>">
|
22
21
|
<h2><%= _('Puppet Class Parameters') %></h2>
|
23
|
-
<%= render 'foreman_puppet/puppetclasses/classes_parameters', obj:
|
22
|
+
<%= render 'foreman_puppet/puppetclasses/classes_parameters', obj: subject %>
|
24
23
|
</fieldset>
|
@@ -2,11 +2,11 @@ class MigrateEnvironmentToPuppetFacet < ActiveRecord::Migration[6.0]
|
|
2
2
|
def up
|
3
3
|
puppet_hostgroups = ::Hostgroup.unscoped.where.not(environment_id: nil).pluck(:id, :environment_id)
|
4
4
|
puppet_hostgroups.map! { |hg_id, env_id| { hostgroup_id: hg_id, environment_id: env_id } }
|
5
|
-
ForemanPuppet::HostgroupPuppetFacet.insert_all(puppet_hostgroups) if puppet_hostgroups.any?
|
5
|
+
ForemanPuppet::HostgroupPuppetFacet.insert_all!(puppet_hostgroups) if puppet_hostgroups.any?
|
6
6
|
|
7
7
|
puppet_hosts = Host::Managed.unscoped.where.not(environment_id: nil).pluck(:id, :environment_id)
|
8
8
|
puppet_hosts.map! { |host_id, env_id| { host_id: host_id, environment_id: env_id } }
|
9
|
-
ForemanPuppet::HostPuppetFacet.insert_all(puppet_hosts) if puppet_hosts.any?
|
9
|
+
ForemanPuppet::HostPuppetFacet.insert_all!(puppet_hosts) if puppet_hosts.any?
|
10
10
|
end
|
11
11
|
|
12
12
|
def down
|
@@ -45,6 +45,9 @@ FactoryBot.modify do
|
|
45
45
|
puppet_proxy do
|
46
46
|
FactoryBot.create(:smart_proxy, features: [FactoryBot.create(:feature, :puppet)])
|
47
47
|
end
|
48
|
+
puppet_ca_proxy do
|
49
|
+
FactoryBot.create(:smart_proxy, features: [FactoryBot.create(:feature, :puppetca)])
|
50
|
+
end
|
48
51
|
end
|
49
52
|
|
50
53
|
trait :with_config_group do
|
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: 1.0.
|
4
|
+
version: 1.0.3
|
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: 2021-09-
|
12
|
+
date: 2021-09-17 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Allow assigning Puppet environmets and classes to the Foreman Hosts.
|
15
15
|
email:
|