Skip to content

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

Open

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.

Activity

  1. bwitt commented on Sep 14, 2025

    @bwitt
    Contributor

    @Tuxdiver can you try #110 and see if that fixes this issue?

  2. Tuxdiver commented on Sep 14, 2025

    @Tuxdiver
    Author

    I will try, but it will take at least two weeks, before I could do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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