Skip to content

Remove of entries fails, if more than one target file is used #96

@Tuxdiver

Description

@Tuxdiver

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.32.1
  • Ruby: AIO embedded
  • Distribution: Ubuntu 22.04
  • Module version: v3.2.0

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

Do some settings with different targets:

  sysctl{'net.ipv6.conf.all.disable_ipv6': ensure => present, value => 1, target => '/etc/sysctl.d/99-disable-ipv6.conf' }
  sysctl{'net.ipv4.tcp_syncookies':         ensure => present, value => 2, target => '/etc/sysctl.d/99-ddos-abwehr.conf'}

and apply them.
Both files are created and the entries are added.

Then try to remove the second setting:

  sysctl{'net.ipv6.conf.all.disable_ipv6': ensure => present, value => 1, target => '/etc/sysctl.d/99-disable-ipv6.conf' }
  sysctl{'net.ipv4.tcp_syncookies':          ensure => absent, value => 2, target => '/etc/sysctl.d/99-ddos-abwehr.conf'}

and the apply will do nothing

If I remove the first entry (net.ipv6.conf.all.disable_ipv6) from the manifest or move the second entry to the top, it works.

What are you seeing

Puppet does not remove the second setting

What behaviour did you expect instead

Puppet should remove the second setting when ensure=>absent is active.

Output log

Nothing

Any additional information you'd like to impart

The module seems to support only one target file if you want to remove an entry. Changing values or adding entries works, regardless of the number of targets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions