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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ccf0e28e1eb6fd2a88980db29a6c6f30d1bb972bd58800d444c4507bad61b771
4
- data.tar.gz: a4828f6dd4e0df4e6210c2bbcfe624c247758a3566dcb5f514dcc2de6246ed45
3
+ metadata.gz: 06c268d86cd3905acdfcd56bc9898df23218553a632bb167c08de6c708351ee8
4
+ data.tar.gz: fc9d44ecfdd418571796ccc39a302a5ac086bae221bc155ba5e827edfd45a9f0
5
5
  SHA512:
6
- metadata.gz: 9df9c3ae3fb503fd9c3f21bd692af6a194eab2ec021846ab4089d8b21d55dcb7d68ee6b33467d98f308401abf4aad2a22dd89ca8ae78bb0555760b3ed29ca787
7
- data.tar.gz: 2a17492b79af4c0c53523b678f05b632d61e436421f19c1af37f8baa6e2259ca719416b08fe3555aab4f1533b09641feba575e60b2498747a040c41aa78c4dde
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: { host_or_hostgroup: @hostgroup, resource_type: :hostgroup }
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: { host_or_hostgroup: @host, resource_type: :host }
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
- <% host_or_hostgroup ||= local_assigns[resource_type] %>
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: host_or_hostgroup %>
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
@@ -1,3 +1,3 @@
1
1
  module ForemanPuppet
2
- VERSION = '1.0.2'.freeze
2
+ VERSION = '1.0.3'.freeze
3
3
  end
@@ -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.2
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-16 00:00:00.000000000 Z
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: