Skip to content

Commit ffa0670

Browse files
authored
Merge pull request #7 from flokoe/install-bolt-puppet-feature
Allow installation of Bolt via puppet feature
2 parents 2cd40b8 + f6cbf66 commit ffa0670

4 files changed

Lines changed: 37 additions & 1 deletion

File tree

src/puppet/devcontainer-feature.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "puppet",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"name": "Puppet Agent and PDK",
55
"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.",
66
"documentationURL": "https://github.com/flokoe/devcontainer-features/tree/main/src/puppet",
@@ -16,6 +16,11 @@
1616
],
1717
"default": "latest",
1818
"description": "Select Puppet version to install."
19+
},
20+
"installBolt": {
21+
"type": "boolean",
22+
"default": false,
23+
"description": "Install Bolt, a tool to orchestrate and automate manual work without the need for an agent."
1924
}
2025
},
2126
"customizations": {

src/puppet/install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -e
44

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

105+
if [[ $INSTALL_BOLT == "true" ]]; then
106+
apt-get install -y puppet-bolt
107+
fi
108+
104109
# Clean up
105110
rm -rf /tmp/tmp-gnupg
106111
rm -rf /var/lib/apt/lists/*

test/puppet/install_bolt.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# Optional: Import test library bundled with the devcontainer CLI
6+
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib
7+
# Provides the 'check' and 'reportResults' commands.
8+
source dev-container-features-test-lib
9+
10+
# Feature-specific tests
11+
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
12+
# check <LABEL> <cmd> [args...]
13+
check "puppet version" puppet --version
14+
check "bolt version" bolt --version
15+
16+
# Report results
17+
# If any of the checks above exited with a non-zero exit code, the test will fail.
18+
reportResults

test/puppet/scenarios.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,13 @@
1313
"version": "7"
1414
}
1515
}
16+
},
17+
"install_bolt": {
18+
"image": "debian:bullseye",
19+
"features": {
20+
"puppet": {
21+
"installBolt": "true"
22+
}
23+
}
1624
}
1725
}

0 commit comments

Comments
 (0)