chef_handler_foreman 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/lib/chef_handler_foreman/foreman_facts.rb +3 -1
- data/lib/chef_handler_foreman/foreman_hooks.rb +7 -2
- data/lib/chef_handler_foreman/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49c01dca38d7420f316e78ade7faa9e20fc9425b
|
4
|
+
data.tar.gz: 8531d0ada4f9a736f388818a31f5f53d75769660
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2ff1df5aaa5210bc607972e421079ee63e54bc7a48c93955be664760278bf73514fe7596e52dd2ebb1bc042e54daad17b4165d1b3efbea32a81676dd0d0fc54
|
7
|
+
data.tar.gz: c7210bcc5041df77a33258892df8cb024dd00539dc0abb7780244f5d8a579fabec525a059b5823df491fd76ed8505b9d9d15ddf35e79a140ced49a5cedf3bbc7
|
data/README.md
CHANGED
@@ -31,3 +31,13 @@ reports_log_level "notice"
|
|
31
31
|
You can also specify a second argument to foreman_reports_upload which is a number:
|
32
32
|
- 1 (default) for reporter based on more detailed ResourceReporter
|
33
33
|
- 2 not so verbose based just on run_status, actually just counts applied resources
|
34
|
+
|
35
|
+
## Chef 10 support
|
36
|
+
|
37
|
+
Chef 10 is generally supported from version 0.0.6 and above. However you must set
|
38
|
+
foreman_reports_upload mode to 2 manually. We can't get detailed reports in old
|
39
|
+
chef. The configuration line will look like this:
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
foreman_reports_upload true, 2
|
43
|
+
```
|
@@ -35,7 +35,9 @@ module ChefHandlerForeman
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def plain_attributes
|
38
|
-
|
38
|
+
# chef 10 attributes can be access by to_hash directly, chef 11 uses attributes method
|
39
|
+
attributes = node.respond_to?(:attributes) ? node.attributes : node.to_hash
|
40
|
+
plainify(attributes.to_hash).flatten.inject(&:merge)
|
39
41
|
end
|
40
42
|
|
41
43
|
def plainify(hash, prefix = nil)
|
@@ -1,6 +1,11 @@
|
|
1
1
|
require 'chef_handler_foreman/foreman_facts'
|
2
2
|
require 'chef_handler_foreman/foreman_reporting'
|
3
|
-
|
3
|
+
|
4
|
+
# this reporter is supported in chef 11 or later
|
5
|
+
unless Gem::Version.new(Chef::VERSION) < Gem::Version.new('11.0.0')
|
6
|
+
require 'chef_handler_foreman/foreman_resource_reporter'
|
7
|
+
end
|
8
|
+
|
4
9
|
require 'chef_handler_foreman/foreman_uploader'
|
5
10
|
|
6
11
|
module ChefHandlerForeman
|
@@ -38,7 +43,7 @@ module ChefHandlerForeman
|
|
38
43
|
end
|
39
44
|
when 2
|
40
45
|
@foreman_report_handler = ForemanReporting.new
|
41
|
-
@foreman_report_handler.uploader =
|
46
|
+
@foreman_report_handler.uploader = @foreman_uploader
|
42
47
|
report_handlers << @foreman_report_handler
|
43
48
|
exception_handlers << @foreman_report_handler
|
44
49
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef_handler_foreman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marek Hulan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|