diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-08-17 12:51:33 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-08-17 12:56:19 +0200 |
commit | a7b985dd3cc4af68875733eb135335a31504f472 (patch) | |
tree | e680ed9cfa68d7ad720eda1093df919c6d4e2f7b /modules/base_installation/lib | |
parent | 7dc85dc776e158e26202362f11a72d7491ef07c8 (diff) | |
download | Puppet-a7b985dd3cc4af68875733eb135335a31504f472.tar.gz Puppet-a7b985dd3cc4af68875733eb135335a31504f472.tar.zst Puppet-a7b985dd3cc4af68875733eb135335a31504f472.zip |
Add cat_files report to notify of important changes
Diffstat (limited to 'modules/base_installation/lib')
-rw-r--r-- | modules/base_installation/lib/puppet/reports/cat_files.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/base_installation/lib/puppet/reports/cat_files.rb b/modules/base_installation/lib/puppet/reports/cat_files.rb new file mode 100644 index 0000000..9d9c068 --- /dev/null +++ b/modules/base_installation/lib/puppet/reports/cat_files.rb | |||
@@ -0,0 +1,17 @@ | |||
1 | require 'puppet' | ||
2 | |||
3 | Puppet::Reports.register_report(:cat_files) do | ||
4 | FOLLOWED_RESOURCES = [ | ||
5 | "File[/etc/puppetlabs/notifies/host_ldap.info]", | ||
6 | ] | ||
7 | |||
8 | def process | ||
9 | self.resource_statuses.each do |name, status| | ||
10 | if FOLLOWED_RESOURCES.include?(status.resource) && status.events.any? { |e| e.status == "success" } | ||
11 | puts File.open(status.title, "r").read() | ||
12 | end | ||
13 | end | ||
14 | end | ||
15 | |||
16 | end | ||
17 | |||