-
Notifications
You must be signed in to change notification settings - Fork 193
Add puppetcore support for macOS #784
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install puppetcore packages on macOS via SSH:
```
/opt/puppetlabs/bolt/bin/bolt task run puppet_agent::install \
collection=puppetcore8 \
version=8.13.1 \
username=forge-key \
password=${PUPPET_FORGE_TOKEN} \
--targets www.example.com
```
If yum_source wasn't specified, such as when installing puppetcore on apt or
mac, and a password wasn't specified, the error message incorrectly referenced
yum:
A password parameter is required to install from https://yum-puppetcore.puppet.com/public
Move the password check prior to handling yum, apt, etc sources. If installing
puppetcore packages and password isn't specified, we now report:
A password parameter is required to install from puppetcore
Since wget and curl may attempt to use credentials, report if authentication fails.
The script assumed curl was using HTTP/1.1 as it was tried to match:
404 Not Found
When using 2.0, the HTTP status text is not included in the response:
HTTP/2 404
Update the grep pattern so we handle both 1.1 and 2. If the credentials are
invalid, the task will report:
21:49:40 -0700 CRIT: ERROR 401
21:49:40 -0700 CRIT: Unable to retrieve a valid package!
If the requested package doesn't exist, the task will report:
21:56:33 -0700 CRIT: ERROR 404
21:56:33 -0700 CRIT: Unable to retrieve a valid package!
When using the puppetcore collection on macOS, if we detect the version does not
match, then upgrade the DMG. Due to a puppet bug, we cannot pass credentials in
the `source` parameter, so curl using 'netrc' to pass credentials securely.
Note facter's `os.release.major` returns the Darwin kernel version (23), but our
packages are named after the OS version (14), so use `os.macosx.version.major`.
```
class { 'puppet_agent':
package_version => '8.13.1',
collection => 'puppetcore8',
username => 'forge-key',
password => Sensitive(...)
}
include 'puppet_agent'
```
3eb8d74 to
bd2787a
Compare
Contributor
Author
InstallUpgrade |
cthorn42
approved these changes
Jul 1, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds support for installing puppetcore packages on macOS via bolt task:
And upgrading installed packages to puppetcore over time: