Installed ansible as post-install instead of feature

This commit is contained in:
Francesco Zimbolo
2026-04-24 12:58:33 +00:00
parent 8477f5b592
commit 6f6cc10aae

View File

@@ -1,19 +1,15 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"name": "Ansible - Proxmox Post-Install",
"image": "mcr.microsoft.com/devcontainers/python:3-3.14-trixie",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers-extra/features/ansible": {},
"ghcr.io/hspaans/devcontainer-features/ansible-lint": {}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",
// Configure tool-specific properties.
// Do NOT use separate devcontainer features for ansible and ansible-lint.
// Both features use pipx and create isolated venvs, so ansible-lint ends up
// with its own internal Ansible copy that cannot see externally installed
// collections — causing syntax-check failures even after collection install.
// Installing everything via pip into the shared base Python env solves this.
"postCreateCommand": "pip install --quiet ansible ansible-lint && ansible-galaxy collection install -r ansible/requirements.yaml",
"customizations": {
"vscode": {
"settings": {
@@ -25,6 +21,4 @@
]
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}