A Puppet module to manage Buildkite Agent on macOS.
Buildkite Agent (buildkite-agent) is a small Go binary that runs Buildkite jobs.
The buildkite_agent Puppet module:
- Installs
buildkite-agentfrom GitHub release tarball - Manages Buildkite Agent config files and settings
- Manages Buildkite Agent user LaunchAgents
Classes and defined types use default parameter values sourced from Buildkite's macOS agent documentation.
This module currently supports macOS only.
Setting the token parameter is the only requirement to get up and running.
-
In-manifest
class { 'buildkite_agent': token => '757613ad20dfaf9b7b4b37d0b4ed4b6c', }
-
Standalone
sudo puppet module install call-buildkite_agent && \ sudo puppet apply -e "class {'buildkite_agent': token => '757613ad20dfaf9b7b4b37d0b4ed4b6c'}"
Replace the value for token with your Buildkite Agent Token.
To run a single Buildkite Agent with the default LaunchAgent label of com.buildkite.buildkite-agent-primary, use the examples above.
💡 The buildkite_agent::config::user and buildkite_agent::service::user parameters use the primary_user custom fact, included with this module, as the default value.
This module only supports macOS, and has only been tested on macOS Catalina (10.15).
This module is developed using the Puppet Development Kit (PDK).
To contribute:
- Fork this repository
- Make changes
- Create a pull request
This module is tested using the following steps:
- Install
puppet-agentand this module in a GitHub Actions macOS environment - Run
puppet apply(2x) to check that desired state is configured and maintained - Validate configuration with Serverspec tests (located in the
test/directory)
GitHub Actions macOS virtual environments are hosted on MacStadium and contain some preconfigured software.
Two GitHub Actions workflows are used in the development and publishing of this module. GitHub Actions workflows are located in the .github/workflows/ directory .
forge_publish.yml- Triggered when a SemVer-style tag is pushed on any branch
- Run all PDK validations against this repository
- Run
pdk buildto build the module package - Publish module package to the Puppet Forge using the Forge API
FORGE_API_KEYmust be set as a GitHub Actions encrypted secret
macos_qa.yml- Triggered on every push
- Install
puppet-agent-6from package at downloads.puppet.com/mac/puppet6/10.14/x86_64/ - Build the module package from source with
tar - Install the module with
sudo puppet module install - Run
puppet apply -e(2x) to execute inline code declaring thebuildkite_agentclassBUILDKITE_AGENT_TOKENmust be provided as a GitHub Actions encrypted secret
- Install Serverspec gem
- Run Serverspec tests