puppetdb_foreman 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/puppetdb_foreman/host_extensions.rb +5 -5
- data/lib/puppetdb_foreman/engine.rb +1 -7
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43c606bf582d08e8291a8b683cef9646123cef58
|
4
|
+
data.tar.gz: 56cecd8257e72267d52d04641f934d63573e236a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43b4d5fac5e312bacdab1719059b2391b689871fafe74e95fd55675c176fab1b8801067a3b893b2cd1e1ac54e3530691b2d2f029c934d50c16949e381ebf1e2f
|
7
|
+
data.tar.gz: 227b396f7c800b06c9a7a3085d8501fc1b611720b6dda5c78203a5965099d5ca963f2017c20ebee5bd3782b2e5b0ae989c55942a7bb7240ea107d362549b9260
|
@@ -7,9 +7,9 @@ module PuppetdbForeman
|
|
7
7
|
|
8
8
|
def deactivate_host
|
9
9
|
logger.debug "Deactivating host #{name} in Puppetdb"
|
10
|
-
return false unless
|
10
|
+
return false unless puppetdb_configured?
|
11
11
|
|
12
|
-
if
|
12
|
+
if puppetdb_enabled?
|
13
13
|
begin
|
14
14
|
uri = URI.parse(Setting[:puppetdb_address])
|
15
15
|
req = Net::HTTP::Post.new(uri.path)
|
@@ -39,14 +39,14 @@ module PuppetdbForeman
|
|
39
39
|
|
40
40
|
private
|
41
41
|
|
42
|
-
def
|
43
|
-
if
|
42
|
+
def puppetdb_configured?
|
43
|
+
if puppetdb_enabled? && Setting[:puppetdb_address].blank?
|
44
44
|
errors.add(:base, _("PuppetDB plugin is enabled but not configured. Please configure it before trying to delete a host."))
|
45
45
|
end
|
46
46
|
errors.empty?
|
47
47
|
end
|
48
48
|
|
49
|
-
def
|
49
|
+
def puppetdb_enabled?
|
50
50
|
[true, 'true'].include? Setting[:puppetdb_enabled]
|
51
51
|
end
|
52
52
|
end
|
@@ -20,13 +20,7 @@ module PuppetdbForeman
|
|
20
20
|
end
|
21
21
|
|
22
22
|
config.to_prepare do
|
23
|
-
|
24
|
-
# Foreman 1.2
|
25
|
-
Host::Managed.send :include, PuppetdbForeman::HostExtensions
|
26
|
-
else
|
27
|
-
# Foreman < 1.2
|
28
|
-
Host.send :include, PuppetdbForeman::HostExtensions
|
29
|
-
end
|
23
|
+
Host::Managed.send :include, PuppetdbForeman::HostExtensions
|
30
24
|
end
|
31
25
|
end
|
32
26
|
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: 0.1.
|
4
|
+
version: 0.1.3
|
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:
|
11
|
+
date: 2015-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'Disable hosts on PuppetDB after they are deleted or built in Foreman,
|
14
14
|
and proxy the PuppetDB dashboard to Foreman. Follow https://github.com/theforeman/puppetdb_foreman
|
@@ -36,12 +36,12 @@ require_paths:
|
|
36
36
|
- lib
|
37
37
|
required_ruby_version: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- -
|
44
|
+
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '0'
|
47
47
|
requirements: []
|
@@ -51,4 +51,3 @@ signing_key:
|
|
51
51
|
specification_version: 4
|
52
52
|
summary: This is a Foreman plugin to interact with PuppetDB.
|
53
53
|
test_files: []
|
54
|
-
has_rdoc:
|