Skip to content

Commit

Permalink
Merge pull request #7 from flokoe/install-bolt-puppet-feature
Browse files Browse the repository at this point in the history
Allow installation of Bolt via puppet feature
  • Loading branch information
flokoe authored Oct 10, 2023
2 parents 2cd40b8 + f6cbf66 commit ffa0670
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/puppet/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "puppet",
"version": "0.3.0",
"version": "0.4.0",
"name": "Puppet Agent and PDK",
"description": "Install and configure Puppet Agent and PDK via official Puppetlabs repository and Puppet extension for VS Code. This feature is intended for Puppet code/modules development.",
"documentationURL": "https://github.com/flokoe/devcontainer-features/tree/main/src/puppet",
Expand All @@ -16,6 +16,11 @@
],
"default": "latest",
"description": "Select Puppet version to install."
},
"installBolt": {
"type": "boolean",
"default": false,
"description": "Install Bolt, a tool to orchestrate and automate manual work without the need for an agent."
}
},
"customizations": {
Expand Down
5 changes: 5 additions & 0 deletions src/puppet/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -e

PUPPET_VERSION=${VERSION:-"latest"}
INSTALL_BOLT=${INSTALLBOLT:-"false"}
PUPPET_RELEASE_GPG_KEY="D6811ED3ADEEB8441AF5AA8F4528B6CD9E61EF26"
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com
keyserver hkps://keys.openpgp.org
Expand Down Expand Up @@ -101,6 +102,10 @@ echo "deb [arch=${ARCHITECTURE} signed-by=/usr/share/keyrings/puppet.gpg] https:
apt-get update -y
apt-get install -y puppet-agent pdk

if [[ $INSTALL_BOLT == "true" ]]; then
apt-get install -y puppet-bolt
fi

# Clean up
rm -rf /tmp/tmp-gnupg
rm -rf /var/lib/apt/lists/*
Expand Down
18 changes: 18 additions & 0 deletions test/puppet/install_bolt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -e

# Optional: Import test library bundled with the devcontainer CLI
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib
# Provides the 'check' and 'reportResults' commands.
source dev-container-features-test-lib

# Feature-specific tests
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
# check <LABEL> <cmd> [args...]
check "puppet version" puppet --version
check "bolt version" bolt --version

# Report results
# If any of the checks above exited with a non-zero exit code, the test will fail.
reportResults
8 changes: 8 additions & 0 deletions test/puppet/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,13 @@
"version": "7"
}
}
},
"install_bolt": {
"image": "debian:bullseye",
"features": {
"puppet": {
"installBolt": "true"
}
}
}
}

0 comments on commit ffa0670

Please sign in to comment.