Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Ansible is a suite of software tools that enables infrastructure as code.
| Options Id | Description | Type | Default Value |
|-----|-----|-----|-----|
| version | Select the version to install. | string | latest |
| injections | Space delimitered list of python packages to inject into the main package env | string | - |



Expand Down
11 changes: 10 additions & 1 deletion src/ansible/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "ansible",
"version": "2.0.17",
"version": "2.1.0",
"name": "Ansible (via pipx)",
"documentationURL": "http://github.com/devcontainers-extra/features/tree/main/src/ansible",
"description": "Ansible is a suite of software tools that enables infrastructure as code.",
Expand All @@ -12,6 +12,15 @@
"latest"
],
"type": "string"
},
"injections": {
"default": "",
"description": "Space delimitered list of python packages to inject into the ansible package env",
"proposals": [
"hcloud",
"hcloud requests"
],
"type": "string"
}
},
"installsAfter": [
Expand Down
2 changes: 1 addition & 1 deletion src/ansible/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ $nanolayer_location \
install \
devcontainer-feature \
"ghcr.io/devcontainers-extra/features/pipx-package:1.1.9" \
--option package='ansible-core' --option injections='ansible' --option version="$VERSION"
--option package='ansible-core' --option injections="ansible $INJECTIONS" --option version="$VERSION" --option includeDeps="true"

echo 'Done!'
8 changes: 8 additions & 0 deletions test/ansible/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,13 @@
"version": "2.13.0"
}
}
},
"test_injections": {
"image": "mcr.microsoft.com/devcontainers/base:debian",
"features": {
"ansible": {
"injections": "hcloud"
}
}
}
}
9 changes: 9 additions & 0 deletions test/ansible/test_injections.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -e

source dev-container-features-test-lib

check "hcloud package is injected" bash -c "pipx list --include-injected | grep hcloud"

reportResults