components/puppet/patches/puppet-05-apply-auditing.patch
branchs11-update
changeset 3458 4912663e9858
parent 3455 6bba35ecb6b8
child 3459 e1b247c39c22
equal deleted inserted replaced
3455:6bba35ecb6b8 3458:4912663e9858
     1 Add auditing hooks for puppet apply
       
     2 --- puppet-3.4.1/lib/puppet/application/apply.rb.orig	2013-06-13 12:15:55.000000000 -0600
       
     3 +++ puppet-3.4.1/lib/puppet/application/apply.rb	2013-07-01 14:02:10.263603171 -0600
       
     4 @@ -1,5 +1,8 @@
       
     5  require 'puppet/application'
       
     6  require 'puppet/configurer'
       
     7 +if Facter.value(:osfamily) == "Solaris"
       
     8 +  require 'PuppetAudit'
       
     9 +end
       
    10  
       
    11  class Puppet::Application::Apply < Puppet::Application
       
    12  
       
    13 @@ -204,6 +207,12 @@
       
    14      end
       
    15  
       
    16      begin
       
    17 +      # configure auditing on Solaris
       
    18 +      if Facter.value(:osfamily) == "Solaris"
       
    19 +          audit_handle = PuppetAudit.new
       
    20 +          audit_handle.audit_start
       
    21 +      end
       
    22 +
       
    23        # Compile our catalog
       
    24        starttime = Time.now
       
    25        catalog = Puppet::Resource::Catalog.indirection.find(node.name, :use_node => node)
       
    26 @@ -232,6 +241,12 @@
       
    27      rescue => detail
       
    28        Puppet.log_exception(detail)
       
    29        exit(1)
       
    30 +    ensure
       
    31 +      # clean up auditing records on Solaris
       
    32 +      if Facter.value(:osfamily) == "Solaris"
       
    33 +          audit_handle.audit_stop
       
    34 +          audit_handle.audit_teardown
       
    35 +      end
       
    36      end
       
    37    end
       
    38