diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ad67fb6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,24 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [5.0.0] - 2026-05-09 + +### Breaking changes + +- **`ctf deploy` no longer passes `ansible_incus_remote` as an Ansible extra variable.** + `ansible-playbook` with `-e ansible_incus_remote=` overrides inventory on every host, which broke mixed containers / VMs deployments. + + **Migration:** Do not depend on `ansible_incus_remote` being injected by deploy for + playbook-wide VM/cluster targeting. + + Use something like: + ``` + vars: + ansible_incus_remote: "{{ ansible_incus_container_remote if ansible_incus_container_remote else 'local' }}" + ``` + +[5.0.0]: https://github.com/nsec/ctf-script/compare/v4.6.2...v5.0.0 diff --git a/challenges/mock-track-apache-php/ansible/inventory b/challenges/mock-track-apache-php/ansible/inventory index b3f3bee..b9bbebb 100644 --- a/challenges/mock-track-apache-php/ansible/inventory +++ b/challenges/mock-track-apache-php/ansible/inventory @@ -5,5 +5,5 @@ all: vars: ansible_connection: community.general.incus ansible_user: root - ansible_incus_remote: local + ansible_incus_remote: "{{ ansible_incus_container_remote if ansible_incus_container_remote else 'local' }}" ansible_incus_project: mock-track-apache-php diff --git a/challenges/mock-track-python-service/ansible/inventory b/challenges/mock-track-python-service/ansible/inventory index 5a0d01c..c3f1017 100644 --- a/challenges/mock-track-python-service/ansible/inventory +++ b/challenges/mock-track-python-service/ansible/inventory @@ -5,5 +5,5 @@ all: vars: ansible_connection: community.general.incus ansible_user: root - ansible_incus_remote: local + ansible_incus_remote: "{{ ansible_incus_container_remote if ansible_incus_container_remote else 'local' }}" ansible_incus_project: mock-track-python-service diff --git a/challenges/mock-track-with-build/ansible/inventory b/challenges/mock-track-with-build/ansible/inventory index 94cd939..e6effcb 100644 --- a/challenges/mock-track-with-build/ansible/inventory +++ b/challenges/mock-track-with-build/ansible/inventory @@ -11,7 +11,7 @@ all: # Do not change these. ansible_connection: community.general.incus ansible_user: root - ansible_incus_remote: local + ansible_incus_remote: "{{ ansible_incus_container_remote if ansible_incus_container_remote else 'local' }}" # Name of your track. Do not change. ansible_incus_project: mock-track-with-build diff --git a/ctf/deploy.py b/ctf/deploy.py index 98cf95a..a4c6bd3 100644 --- a/ctf/deploy.py +++ b/ctf/deploy.py @@ -481,7 +481,7 @@ def run_ansible_playbook( extra_args += [ "-e", - f"ansible_incus_remote={remote}", + f"ansible_incus_container_remote={remote}", "-e", f"ansible_incus_vm_remote={vm_remote if vm_remote else remote}", "-e", diff --git a/ctf/templates/new/common/inventory.j2 b/ctf/templates/new/common/inventory.j2 index fd2796b..346c687 100644 --- a/ctf/templates/new/common/inventory.j2 +++ b/ctf/templates/new/common/inventory.j2 @@ -15,7 +15,7 @@ all: # Do not change these. ansible_connection: community.general.incus ansible_user: root - ansible_incus_remote: local + ansible_incus_remote: "{{ '{{' }} ansible_incus_container_remote if ansible_incus_container_remote else 'local' {{ '}}' }}" # Name of your track. Do not change. ansible_incus_project: {{ data.name }} diff --git a/pyproject.toml b/pyproject.toml index 7eb77f9..da9d2dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dependencies = [ "typer==0.24.1", "pydantic", ] -version = "4.6.3" +version = "5.0.0" classifiers = [ "Programming Language :: Python :: 3", "Operating System :: OS Independent",