puppetlabs / puppetlabs-apt

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

Enabling purge removes PPA sources.list.d files #1064

Closed Programie closed 1 year ago

Programie commented 1 year ago

Describe the Bug

I've configured the apt module to purge all non-managed sources.list and sources.list.d entries. Unfortunately, in combination with apt::ppa resources, this results in Puppet adding the PPA in sources.list.d and removing it again on the next Puppet run.

Expected Behavior

Puppet should not purge sources.list.d entries for apt::ppa resources.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Configure purge for sources.list.d
  2. Add any PPA using apt::ppa
  3. Execute Puppet at least two times. In the second run, it will remove the PPA added in the first run.

Environment

pebtron commented 1 year ago

I can confirm this issue and steps to reproduce with puppetlabs-apt 9.0.0 when running the following server+agent: Puppetserver Ubuntu 18.04 7.6.0-1bionic Puppet agent Ubuntu 20.04 7.18.0-1focal

Programie commented 1 year ago

One easy fix for that issue might be to add a file resource for the sources.list.d file in apt::ppa:

file { "${::apt::sources_list_d}/${sources_list_d_filename}": }
GSPatton commented 1 year ago

closing as https://github.com/puppetlabs/puppetlabs-apt/pull/1069 has been merged