puppetlabs / puppetlabs-apt

Puppet module to help manage Apt
https://forge.puppetlabs.com/puppetlabs/apt
Apache License 2.0
216 stars 463 forks source link

Replace sources.list not working #1156

Open nem8 opened 6 months ago

nem8 commented 6 months ago

Describe the Bug

According to https://github.com/puppetlabs/puppetlabs-apt#replace-the-default-sourceslist-file i should be able to replace existing sources.list file with one containing the specified apt repositories. This does not work, it will create a file in sources.list.d tho..

Expected Behavior

I expected it to replace sources.list with content provided, not create a new sources.list.d/ file

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create or add code in puppet like: apt::source { "archive.debian.org-${facts['os']['distro']['codename']}": location => 'http://archive.debian.org/debian', repos => 'main contrib non-free', }
  2. Assign manifest file to object in foreman.
  3. Run puppet agent -t on client

Environment

Additional Context

Im testing this out as i need to change to the archive repo on all debian 9 servers. Documentation states that apt::source will edit sources.list.d , but examples say that it will replace sources.list. It didnt replace sources.list :(

kenyon commented 6 months ago

The module works by managing files in sources.list.d. The end result is equivalent to having everything in sources.list.

nem8 commented 6 months ago

So, to use the module for managing archive repos you would have to delete source.list and then let the module create archive repo in source.list.d?

kenyon commented 6 months ago

The module does this for you.

nem8 commented 6 months ago

With purge you mean? I have other repos not manage by the module so i wont want to do that, but I could do a file delete and let it create archive repo..