components/ruby/puppet/patches/puppet-04-agent-auditing.patch
author Kristina Tripp <Kristina.Tripp@oracle.com>
Fri, 12 Sep 2014 10:57:15 -0600
changeset 2081 1f1144fb0e4e
parent 1655 components/puppet/patches/puppet-04-agent-auditing.patch@2490bf4f53ea
child 5860 afd31ba91ee9
permissions -rw-r--r--
18960221 problem in UTILITY/PUPPET 18960237 Update Puppet to 3.6.2 19596952 Update facter 2.1.0 license 19612179 Prepare puppet code to support multiple or different releases of ruby

Add auditing support to agent execution

--- puppet-3.6.2/lib/puppet/agent.rb.orig	2014-06-18 09:30:30.571283131 -0600
+++ puppet-3.6.2/lib/puppet/agent.rb	2014-06-16 10:47:24.851029500 -0600
@@ -1,4 +1,7 @@
 require 'puppet/application'
+if Facter.value(:osfamily) == "Solaris"
+  require 'PuppetAudit'
+end
 
 # A general class for triggering a run of another
 # class.
@@ -37,6 +40,11 @@
       return
     end
 
+    if Facter.value(:osfamily) == "Solaris"
+        audit_handle = PuppetAudit.new
+        audit_handle.audit_start
+    end
+
     result = nil
     block_run = Puppet::Application.controlled_run do
       splay client_options.fetch :splay, Puppet[:splay]
@@ -52,6 +60,10 @@
           end
         end
       end
+      if Facter.value(:osfamily) == "Solaris"
+          audit_handle.audit_stop
+          audit_handle.audit_teardown
+      end
       true
     end
     Puppet.notice "Shutdown/restart in progress (#{Puppet::Application.run_status.inspect}); skipping run" unless block_run