Skip to content

Update module to support apt-puppetcore.puppet.com #764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 13, 2025

Conversation

joshcooper
Copy link
Contributor

This is the same as #757 but for apt.

Updates the puppet_agent::install_task so it's possible to install deb-based packages from https://apt-puppetcore.puppet.com (debian and ubuntu). Credentials are required when installing from apt-puppetcore. The username defaults to forge-key and the password must be set to your forge API token.

❯ /opt/puppetlabs/bolt/bin/bolt task run puppet_agent::install collection=puppetcore8 version=8.11.0 password=${PUPPET_FORGE_TOKEN} --targets ...
..
  23:25:51 +0000 INFO: Downloading https://apt-puppetcore.puppet.com/public/puppet8-release-jammy.deb
...
  Setting up puppet-agent (8.11.0-1jammy) ...

Also updates the puppet_agent class so it's possible to manage agent versions over time:

class { 'puppet_agent':
  package_version => '8.11.0',
  collection => 'puppetcore8',
  password => Sensitive(...)
}

And it updates the Dockerfiles used to test install and upgrades. See docker/README.md for details.

I haven't changed the default behavior of the module if the collection is unspecified or is one of the existing puppet7, puppet7-nightly, puppet8, etc collections. If no collection is specified, then it continues to use the "unversioned" release package from apt.puppet.com.

Adds support for puppetcore* collections to the apt-based install task.

When installing the puppetcore* collection, the task will download a release
package from apt-puppetcore.puppet.com/public and add the credentials to
/etc/apt/auth.conf.d/apt-puppetcore-puppet.conf. The other collections are
unaffected.

The `PUPPET_FORGE_TOKEN` environment variable must be set, which will be passed
as the `password` to the task.

Add debian 10-12 and ubuntu 18.04-24.04 to test installs in docker. By default,
it will install 8.11.0 on Ubuntu noble. The tzdata package prompts for input, so
use DEBIAN_FRONTEND=noninteractive when building the image.
Previously, apt-get install was reporting:

    debconf: unable to initialize frontend: Dialog
    debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79, <STDIN> line 1.)
    debconf: falling back to frontend: Readline
@joshcooper
Copy link
Contributor Author

@kenyon @bastelfreak Have any thoughts/concerns about this?

@joshcooper joshcooper merged commit 14b1844 into puppetlabs:main Mar 13, 2025
16 checks passed
@joshcooper joshcooper deleted the private_apt branch March 13, 2025 22:31
@mhashizume mhashizume added the enhancement New feature or request label Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants