Skip to content

Add devcontainer configuration for Codespaces#8

Merged
tormachris merged 2 commits into
mainfrom
copilot/add-devcontainer-configuration
May 5, 2026
Merged

Add devcontainer configuration for Codespaces#8
tormachris merged 2 commits into
mainfrom
copilot/add-devcontainer-configuration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

Summary

Adds a .devcontainer/devcontainer.json so the repository can be opened in GitHub Codespaces or any other devcontainer-compatible tool (VS Code Dev Containers, JetBrains, etc.) with a ready-to-use Ansible development environment.

Changes

  • New file: .devcontainer/devcontainer.json
    • Base image: mcr.microsoft.com/devcontainers/python:1-3.12-bookworm (Python is the runtime for Ansible).
    • Features: common-utils, git, github-cli.
    • postCreateCommand: installs ansible, ansible-lint, yamllint, and the collections from requirements.yaml via ansible-galaxy collection install -r requirements.yaml, matching what the CI workflow expects.
    • VS Code customizations: recommends the Red Hat Ansible & YAML extensions, GitHub Actions extension, and Python extension; enables ansible-lint validation. The Red Hat Ansible extension auto-detects Ansible files via its built-in patterns, so no global *.yaml/*.ymlansible association is set — this preserves GitHub Actions schema/validation for files under .github/workflows/.

Usage

After merging, contributors can:

  • Click Code → Codespaces → Create codespace on GitHub, or
  • Run Dev Containers: Reopen in Container in VS Code locally.

The container will come up with ansible-playbook, ansible-lint, and yamllint available, and all required collections preinstalled — so the same lint/build commands used by .github/workflows/ansible-ci.yml work out of the box.

Agent-Logs-Url: https://github.com/Ctrl-Alt-GG/network-services/sessions/6c185bf9-0eb5-41b6-b3f7-0730e9d13957

Co-authored-by: tormachris <1529569+tormachris@users.noreply.github.com>
Copilot AI requested a review from tormachris May 5, 2026 12:41
@tormachris tormachris marked this pull request as ready for review May 5, 2026 12:42
Copilot AI review requested due to automatic review settings May 5, 2026 12:42
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a devcontainer definition so contributors can open this Ansible infrastructure repo in Codespaces/devcontainer tools with a preconfigured development environment.

Changes:

  • Adds a new .devcontainer/devcontainer.json based on the Python devcontainer image.
  • Installs Ansible, ansible-lint, yamllint, and the repo’s required Ansible collections after container creation.
  • Configures recommended VS Code extensions and editor settings for Ansible/YAML work.

Comment thread .devcontainer/devcontainer.json Outdated
Comment on lines +33 to +34
"*.yaml": "ansible",
"*.yml": "ansible"
@tormachris
Copy link
Copy Markdown
Member

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 5, 2026

@copilot apply changes based on the comments in this thread

Removed the global *.yaml/*.ymlansible file association in 59bcc9c so GitHub Actions workflow files keep their schema/validation. The Red Hat Ansible extension auto-detects Ansible files (playbooks, roles/*/tasks/*.yml, etc.) without needing the blanket association.

@tormachris tormachris merged commit 3b4d08d into main May 5, 2026
4 checks passed
@tormachris tormachris deleted the copilot/add-devcontainer-configuration branch May 5, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants