Blame SOURCES/sos-bz1183768-puppet-collect-config.patch

c81b6a
From c5f969e8a79a2bc7e0280e11e4a02599552b326f Mon Sep 17 00:00:00 2001
c81b6a
From: Shane Bradley <sbradley@redhat.com>
c81b6a
Date: Tue, 20 Jan 2015 11:33:31 -0500
c81b6a
Subject: [PATCH] [puppet] adding new plugin for puppet
c81b6a
c81b6a
Added a new plugin to collect files for puppet.
c81b6a
c81b6a
Fixes: #473.
c81b6a
c81b6a
Signed-off-by: Shane Bradley <sbradley@redhat.com>
c81b6a
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
c81b6a
---
c81b6a
 sos/plugins/puppet.py | 43 +++++++++++++++++++++++++++++++++++++++++++
c81b6a
 1 file changed, 43 insertions(+)
c81b6a
 create mode 100644 sos/plugins/puppet.py
c81b6a
c81b6a
diff --git a/sos/plugins/puppet.py b/sos/plugins/puppet.py
c81b6a
new file mode 100644
c81b6a
index 0000000..4da95a2
c81b6a
--- /dev/null
c81b6a
+++ b/sos/plugins/puppet.py
c81b6a
@@ -0,0 +1,43 @@
c81b6a
+# This program is free software; you can redistribute it and/or modify
c81b6a
+# it under the terms of the GNU General Public License as published by
c81b6a
+# the Free Software Foundation; either version 2 of the License, or
c81b6a
+# (at your option) any later version.
c81b6a
+
c81b6a
+# This program is distributed in the hope that it will be useful,
c81b6a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
c81b6a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
c81b6a
+# GNU General Public License for more details.
c81b6a
+
c81b6a
+# You should have received a copy of the GNU General Public License
c81b6a
+# along with this program; if not, write to the Free Software
c81b6a
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
c81b6a
+
c81b6a
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
c81b6a
+from glob import glob
c81b6a
+
c81b6a
+
c81b6a
+class Puppet(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
c81b6a
+    """Puppet service
c81b6a
+    """
c81b6a
+
c81b6a
+    plugin_name = 'puppet'
c81b6a
+    profiles = ('services',)
c81b6a
+
c81b6a
+    def setup(self):
c81b6a
+        self.add_copy_spec([
c81b6a
+            "/etc/puppet/*.conf",
c81b6a
+            "/etc/puppet/rack/*",
c81b6a
+            "/etc/puppet/manifests/*",
c81b6a
+            "/var/log/puppet/*.log",
c81b6a
+        ])
c81b6a
+
c81b6a
+    def postproc(self):
c81b6a
+        for device_conf in glob("/etc/puppet/device.conf*"):
c81b6a
+            self.do_file_sub(
c81b6a
+                device_conf,
c81b6a
+                r"(.*url*.ssh://.*:).*(@.*)",
c81b6a
+                r"\1%s\2" % ('***')
c81b6a
+            )
c81b6a
+
c81b6a
+        return
c81b6a
+# vim: et ts=4 sw=4
c81b6a
-- 
c81b6a
1.8.3.1
c81b6a