voxpupuli / puppet-augeasproviders_sysctl

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

Don't try to set a comment, if apply and persist is false #29

Closed marcelfischer closed 5 years ago

marcelfischer commented 5 years ago

For some hosts we're not allowed to set a value. So we thought of setting apply and persist to false. This basically works but during each puppet run, the module tries to set a comment which fails. I think it shouldn't try to set a comment is both "apply" and "persist" is set to false.

...
Info: Loading facts
Info: Caching catalog for xxx
Info: Applying configuration version 'yyy'
Notice: /Stage[main]/Sysctl_hardening::Settings/Sysctl[net.ipv4.tcp_timestamps]/comment: comment changed '' to 'MANAGED BY PUPPET. DO NOT EDIT!'
...

  sysctl { 'net.ipv4.tcp_timestamps':
    ensure     => present,
    value       => '0',
    apply       => false,
    persist     => false,
    comment => 'MANAGED BY PUPPET. DO NOT EDIT!',
  }
raphink commented 5 years ago

I agree that a comment shouldn't be set as soon as persist is set to false.