voxpupuli / puppet-augeasproviders_sysctl

Augeas-based sysctl type and provider for Puppet
Apache License 2.0
10 stars 36 forks source link

Fails to edit existing value #89

Open jcpunk opened 8 months ago

jcpunk commented 8 months ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

I've got hiera that overrides the value of vm.dirty_background_ratio based on the size of the disk

What are you seeing

Failure to set the value

What behaviour did you expect instead

Success

Output log

Notice: /Stage[main]/Stdlib::Manage/Sysctl[vm.dirty_background_ratio]/value: changed configuration value from '13' to '10' (corrective)
Debug: Executing: '/usr/sbin/sysctl -w vm.dirty_background_ratio=10'
Debug: Puppet::Type::Sysctl::ProviderAugeas: Save failure details:
/augeas/files/etc/sysctl.d/kernel.sched_autogroup_enabled.conf/error/path = /files/etc/sysctl.d/kernel.sched_autogroup_enabled.conf/files/etc/sysctl.d/kernel.sched_autogroup_enabled.conf/kernel.sched_autogroup_enabled[1]
/augeas/files/etc/sysctl.d/kernel.sched_autogroup_enabled.conf/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/sysctl.aug:45.14-.40:
/augeas/files/etc/sysctl.d/kernel.sched_autogroup_enabled.conf/error/message = None of the alternatives in the union match
/augeas/files/etc/sysctl.d/kernel.yama.ptrace_scope.conf/error/path = /files/etc/sysctl.d/kernel.yama.ptrace_scope.conf/files/etc/sysctl.d/kernel.yama.ptrace_scope.conf/kernel.yama.ptrace_scope[1]
/augeas/files/etc/sysctl.d/kernel.yama.ptrace_scope.conf/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/sysctl.aug:45.14-.40:
/augeas/files/etc/sysctl.d/kernel.yama.ptrace_scope.conf/error/message = None of the alternatives in the union match
/augeas/files/etc/sysctl.d/vm.dirty_background_ratio.conf/error/path = /files/etc/sysctl.d/vm.dirty_background_ratio.conf/files/etc/sysctl.d/vm.dirty_background_ratio.conf/vm.dirty_background_ratio[1]
/augeas/files/etc/sysctl.d/vm.dirty_background_ratio.conf/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/sysctl.aug:45.14-.40:
/augeas/files/etc/sysctl.d/vm.dirty_background_ratio.conf/error/message = None of the alternatives in the union match
Error: /Stage[main]/Stdlib::Manage/Sysctl[vm.dirty_background_ratio]: Could not evaluate: Failed to save Augeas tree to file. See debug logs for details.
/opt/puppetlabs/puppet/cache/lib/puppet/provider/augeasprovider/default.rb:146:in `rescue in augsave!'
/opt/puppetlabs/puppet/cache/lib/puppet/provider/augeasprovider/default.rb:137:in `augsave!'
/opt/puppetlabs/puppet/cache/lib/puppet/provider/augeasprovider/default.rb:748:in `augsave!'
/opt/puppetlabs/puppet/cache/lib/puppet/provider/augeasprovider/default.rb:894:in `flush'
/opt/puppetlabs/puppet/cache/lib/puppet/provider/sysctl/augeas.rb:272:in `flush'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1038:in `flush'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:27:in `evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:270:in `apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:291:in `eval_resource'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:194:in `call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:194:in `block (2 levels) in evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:511:in `block in thinmark'
/opt/puppetlabs/puppet/lib/ruby/3.2.0/benchmark.rb:311:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:510:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:194:in `block in evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:124:in `traverse'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:181:in `evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:241:in `block (2 levels) in apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:511:in `block in thinmark'
/opt/puppetlabs/puppet/lib/ruby/3.2.0/benchmark.rb:311:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:510:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:240:in `block in apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:167:in `with_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:153:in `as_logging_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:239:in `apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:288:in `block (2 levels) in apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:511:in `block in thinmark'
/opt/puppetlabs/puppet/lib/ruby/3.2.0/benchmark.rb:311:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:510:in `thinmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:287:in `block in apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:190:in `block in benchmark'
/opt/puppetlabs/puppet/lib/ruby/3.2.0/benchmark.rb:311:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:189:in `benchmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:286:in `apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:504:in `run_internal'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:341:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:85:in `block (6 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:64:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:288:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:84:in `block (5 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/3.2.0/timeout.rb:189:in `block in timeout'
/opt/puppetlabs/puppet/lib/ruby/3.2.0/timeout.rb:196:in `timeout'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:83:in `block (4 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent/locker.rb:23:in `lock'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:73:in `block (3 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:164:in `with_client'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:69:in `block (2 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:129:in `run_in_fork'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:68:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:174:in `controlled_run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:49:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/agent.rb:437:in `onetime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/agent.rb:394:in `block in run_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:64:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:288:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/agent.rb:391:in `run_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:423:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:697:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:423:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:145:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:79:in `execute'
/opt/puppetlabs/puppet/bin/puppet:6:in `<main>'

Any additional information you'd like to impart

If I remove the /etc/sysctl.d/kernel.sched_autogroup_enabled.conf file, it saves to disk successfully.