Dr Bunsen Honeydew
07/28/2022, 1:17 PMpuppetlabs-scheduled_task
module at https://forge.puppet.com/puppetlabs/scheduled_task?src=slack&channel=puppetSlackbot
07/28/2022, 2:22 PMSlackbot
07/28/2022, 2:41 PMbastelfreak
07/28/2022, 2:48 PMromgo
07/28/2022, 2:53 PM$ /opt/puppetlabs/puppet/bin/gem install hiera-eyaml
ERROR: Error installing hiera-eyaml:
hiera-eyaml requires Ruby version < 4, >= 2.5.0.
vchepkov
07/28/2022, 2:54 PMvchepkov
07/28/2022, 2:54 PMvchepkov
07/28/2022, 2:55 PMvchepkov
07/28/2022, 2:56 PMrpm -ql puppet-agent|grep hiera-eyaml
/opt/puppetlabs/puppet/lib/ruby/vendor_gems/gems/hiera-eyaml-3.2.2
romgo
07/28/2022, 3:14 PMromgo
07/28/2022, 3:14 PMromgo
07/28/2022, 3:15 PMcsharpsteen
07/28/2022, 3:23 PMresource_events
.
But, the triggers consuming 26+ minutes of time had names starting with RI_ConstraintTrigger*
, so insert_resource_events_trigger
is on the wrong table and has the wrong name to be directly involved in the slowdown.romgo
07/28/2022, 3:41 PMSlackbot
07/28/2022, 4:53 PMDr Bunsen Honeydew
07/28/2022, 4:53 PMbinford2k
07/28/2022, 4:53 PMDavid
07/28/2022, 5:07 PMdef run_command
if options[:catalog]
apply
else
main
end
ensure
# clean up auditing records on Solaris
if Facter.value(:osfamily) == "Solaris"
audit_handle.audit_stop
audit_handle.audit_teardown
end
if @profiler
Puppet::Util::Profiler.remove_profiler(@profiler)
@profiler.shutdown
end
end
def apply
if options[:catalog] == "-"
text = $stdin.read
else
text = Puppet::FileSystem.read(options[:catalog], :encoding => 'utf-8')
end
env = Puppet.lookup(:environments).get(Puppet[:environment])
Puppet.override(:current_environment => env, :loaders => create_loaders(env)) do
catalog = read_catalog(text)
apply_catalog(catalog)
end
end
def main
# configure auditing on Solaris #
if Facter.value(:osfamily) == "Solaris" # This code is in the wrong place
audit_handle = PuppetAudit.new # Idiots !!!!
audit_handle.audit_start #
end #
manifest = get_manifest() # Get either a manifest or nil if apply should use content of Puppet[:code]
splay # splay if needed
facts = get_facts() # facts or nil
node = get_node() # node or error
apply_environment = get_configured_environment(node, manifest)
By changing it to this it all works…..
def run_command
# configure auditing on Solaris #
if Facter.value(:osfamily) == "Solaris" # This code was in the wrong place
audit_handle = PuppetAudit.new # Now it's in the right place
audit_handle.audit_start # Well, at least in a place where the
end # code will actually work
#
if options[:catalog]
apply
else
main
end
ensure
# clean up auditing records on Solaris
if Facter.value(:osfamily) == "Solaris"
audit_handle.audit_stop
audit_handle.audit_teardown
end
if @profiler
Puppet::Util::Profiler.remove_profiler(@profiler)
@profiler.shutdown
end
end
def apply
if options[:catalog] == "-"
text = $stdin.read
else
text = Puppet::FileSystem.read(options[:catalog], :encoding => 'utf-8')
end
env = Puppet.lookup(:environments).get(Puppet[:environment])
Puppet.override(:current_environment => env, :loaders => create_loaders(env)) do
catalog = read_catalog(text)
apply_catalog(catalog)
end
end
def main
manifest = get_manifest() # Get either a manifest or nil if apply should use content of Puppet[:code]
splay # splay if needed
facts = get_facts() # facts or nil
node = get_node() # node or error
apply_environment = get_configured_environment(node, manifest)
How does this kind of thing get past testing?binford2k
07/28/2022, 5:26 PMSlackbot
07/28/2022, 5:28 PMnwops
07/28/2022, 5:28 PMbinford2k
07/28/2022, 5:32 PMDr Bunsen Honeydew
07/28/2022, 5:45 PMbinford2k
07/28/2022, 5:48 PMbinford2k
07/28/2022, 6:01 PMbinford2k
07/28/2022, 6:01 PMSlackbot
07/28/2022, 7:23 PMJoeH
07/28/2022, 7:23 PMJoeH
07/28/2022, 7:29 PMDr Bunsen Honeydew
07/28/2022, 8:45 PM