puppetdb_foreman 6.0.0 → 6.0.2

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: 2917867afdc2d20921a278f2c2fb35aa90ee71ad3ceca28cbfb6fbff4d087bd9
4
- data.tar.gz: 3f6bd9d01c00bd9007220a95b1c0752c938cbbad24c01c670f03ae79e80fd6a5
3
+ metadata.gz: d683f14f9607acc0274d79c0c245ac9bf7c9b37ee0957f92ef2942df991f2edd
4
+ data.tar.gz: 3786bbda19883a603921ffa43b748c4ca24101c0bd237c70c8b528a765e5bd69
5
5
  SHA512:
6
- metadata.gz: 424fd00c14417f01cc1ae6eac59d468bb6b32048f5fbd2f0e646319182500a8b46349f31d2797d87efb578d86704eed14cb42710bf25097334993118a335c904
7
- data.tar.gz: 0e0ad581dbecf0ce351bb50e8fd88c348e080b64a812c82cb933da13c60a9006f681ba1bcdc6229987e36b96d5d37719895eb7be81c685a15ddb5ec1c8630121
6
+ metadata.gz: b728cb91bf886df44aa6c892d1ef6076d3892453e378a82d78453c0e3bed68973139eb48f15d72c1c4e79905b1a05d77eb547a90c8695ccb1e0e27583f3725e7
7
+ data.tar.gz: 1f8c68c45e271137f28b819e0529110ed0d3ea6100699757a051d728bd5e6ba1569a26c2f02622121c88afe1c08b7f4f46904c457725edc94e0a4a9d2ccf8fe5
data/README.md CHANGED
@@ -11,7 +11,7 @@ It does the following:
11
11
  * Compares nodes in PuppetDB to Hosts in Foreman.
12
12
  * Creates Hosts in Foreman from PuppetDB facts.
13
13
 
14
- Feel free to raise issues, ask for features, anything, in the github repository or #theforeman IRC channel in Freenode.
14
+ Feel free to raise issues, ask for features, anything, in the github repository or visit [the Foreman support pages](https://theforeman.org/support.html).
15
15
 
16
16
  ## Compatibility
17
17
 
@@ -20,11 +20,12 @@ module Orchestration
20
20
  end
21
21
 
22
22
  def del_puppetdb
23
- Rails.logger.info "Deactivating node in PuppetDB: #{name}"
24
- ::Puppetdb.client.deactivate_node(name)
23
+ Rails.logger.info "Deactivating node in PuppetDB: #{certname} (#{name})"
24
+ ::Puppetdb.client.deactivate_node(certname)
25
25
  rescue StandardError => e
26
26
  failure format(
27
- _("Failed to deactivate node %<name>s in PuppetDB: %<message>s\n "), name: name, message: e.message
27
+ _("Failed to deactivate node %<certname>s (%<name>s) in PuppetDB: %<message>s\n "),
28
+ name: name, message: e.message, certname: certname
28
29
  ), e
29
30
  end
30
31
 
@@ -2,11 +2,11 @@
2
2
 
3
3
  class MigratePuppetdbApiVersionSetting < ActiveRecord::Migration[4.2]
4
4
  def up
5
- puppetdb_address = Setting.where(category: 'Setting::Puppetdb', name: 'puppetdb_address').first.try(:value)
5
+ puppetdb_address = Setting.where(name: 'puppetdb_address').first.try(:value)
6
6
  return unless puppetdb_address
7
7
 
8
8
  api_version = URI.parse(puppetdb_address).path.start_with?('/pdb') ? 3 : 1
9
- setting = Setting.where(category: 'Setting::Puppetdb', name: 'puppetdb_api_version').first_or_create
9
+ setting = Setting.where(name: 'puppetdb_api_version').first_or_create
10
10
  setting.value = api_version
11
11
  setting.save
12
12
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ class FixPuppetdbSettingsCategoryToDsl < ActiveRecord::Migration[6.0]
4
+ def up
5
+ # rubocop:disable Rails/SkipsModelValidations
6
+ Setting.where(category: 'Setting::Puppetdb').update_all(category: 'Setting') if column_exists?(:settings, :category)
7
+ # rubocop:enable Rails/SkipsModelValidations
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PuppetdbForeman
4
- VERSION = '6.0.0'
4
+ VERSION = '6.0.2'
5
5
  end
@@ -26,7 +26,7 @@ class HostTest < ActiveSupport::TestCase
26
26
  end
27
27
 
28
28
  test '#del_puppetdb' do
29
- ::PuppetdbClient::V4.any_instance.expects(:deactivate_node).with(host.name).returns(true)
29
+ ::PuppetdbClient::V4.any_instance.expects(:deactivate_node).with(host.certname).returns(true)
30
30
  host.send(:del_puppetdb)
31
31
  end
32
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppetdb_foreman
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Lobato Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-14 00:00:00.000000000 Z
11
+ date: 2023-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -66,10 +66,10 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: 'Disable hosts on PuppetDB after they are deleted or built in Foreman.
69
+ description: Disable hosts on PuppetDB after they are deleted or built in Foreman.
70
70
  Follow https://github.com/theforeman/puppetdb_foreman and raise an issue/submit
71
- a pull request if you need extra functionality. You can also find some help in #theforeman
72
- IRC channel on Freenode.'
71
+ a pull request if you need extra functionality. You can also find some help via
72
+ the Foreman support pages (https://theforeman.org/support.html).
73
73
  email: elobatocs@gmail.com
74
74
  executables: []
75
75
  extensions: []
@@ -95,6 +95,7 @@ files:
95
95
  - config/routes.rb
96
96
  - db/migrate/20170717140010_migrate_puppetdb_api_version_setting.rb
97
97
  - db/migrate/20181001113836_remove_puppetdb_dashboard_address_setting.puppetdb_foreman.rb
98
+ - db/migrate/20221026123754_fix_puppetdb_settings_category_to_dsl.rb
98
99
  - lib/puppetdb_foreman.rb
99
100
  - lib/puppetdb_foreman/engine.rb
100
101
  - lib/puppetdb_foreman/version.rb
@@ -127,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
128
  - !ruby/object:Gem::Version
128
129
  version: '0'
129
130
  requirements: []
130
- rubygems_version: 3.3.7
131
+ rubygems_version: 3.3.26
131
132
  signing_key:
132
133
  specification_version: 4
133
134
  summary: This is a Foreman plugin to interact with PuppetDB.