Skip to content

fix: Make the playbook run cleanly outside AWX#6

Merged
alanbchristie merged 2 commits into
masterfrom
fix/local-python-interpreter
Jun 30, 2026
Merged

fix: Make the playbook run cleanly outside AWX#6
alanbchristie merged 2 commits into
masterfrom
fix/local-python-interpreter

Conversation

@claude-im

@claude-im claude-im commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Fixes needed to run the playbook cleanly outside AWX against a real cluster.

Changes

  • Local interpreter (inventory.yaml): replace the hard-coded ansible_python_interpreter: "/usr/bin/env python" with {{ ansible_playbook_python }}. The old value fails on hosts without a bare python on PATH (macOS, or the uv venv) — even fact-gathering aborted with "The module interpreter '/usr/bin/env python' was not found."

  • TLS verification (tasks/prep.yaml, tasks/main.yaml): load K8S_AUTH_VERIFY_SSL (default yes) and pass it to the k8s module_defaults as validate_certs. Lets clusters presenting a certificate signed by a CA outside the local trust store (e.g. Scaleway) be reached with K8S_AUTH_VERIFY_SSL=no, while keeping verification on by default.

  • Fact access (templates/deployment.yaml.j2): read the gathered fact as ansible_facts.date_time.iso8601_micro, clearing the INJECT_FACTS_AS_VARS deprecation warning (removed in ansible-core 2.24).

  • Collections path (ansible.cfg): pin a project-local collections_path so a stale kubernetes.core (2.3.0) in ~/.ansible/collections no longer shadows the uv-bundled 6.4.0. The old version emitted deprecated ansible.module_utils._text import warnings; the bundled one imports from ansible.module_utils.common.text.converters.

  • Image bump (vars/main.yaml): nginx 1.29.4-alpine1.31.2-alpine.

Verification

uv run ansible-playbook site.yaml (with K8S_AUTH_* set and K8S_AUTH_VERIFY_SSL=no) now runs to completion against a Scaleway cluster with no deprecation warnings. yamllint passes on all changed files.

🤖 Generated with Claude Code

a.b.christie and others added 2 commits June 30, 2026 17:41
The inventory hard-coded `ansible_python_interpreter: /usr/bin/env
python`, which fails on hosts without a bare `python` on PATH (e.g.
macOS, or the uv venv) — even fact-gathering aborts with "The module
interpreter '/usr/bin/env python' was not found".

For a local connection the interpreter Ansible itself launched with is
always correct and present, so use the `ansible_playbook_python` magic
variable instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Several fixes so the playbook runs cleanly outside AWX against a real
cluster:

- TLS: load 'K8S_AUTH_VERIFY_SSL' (default 'yes') in prep.yaml and wire
  it into the k8s module_defaults as 'validate_certs', so clusters with
  a CA outside the local trust store (e.g. Scaleway) can be reached via
  'K8S_AUTH_VERIFY_SSL=no'.
- Facts: read the gathered date_time fact as
  'ansible_facts.date_time.iso8601_micro' to clear the
  INJECT_FACTS_AS_VARS deprecation warning.
- Collections: pin a project-local 'collections_path' so a stale
  'kubernetes.core' in '~/.ansible/collections' can no longer shadow the
  uv-bundled version (silencing its deprecated module_utils._text
  imports).
- Bump the nginx image tag to 1.31.2-alpine.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@claude-im claude-im changed the title fix: Use ansible_playbook_python for local interpreter fix: Make the playbook run cleanly outside AWX Jun 30, 2026
@alanbchristie alanbchristie merged commit ac2778e into master Jun 30, 2026
1 check passed
@alanbchristie alanbchristie deleted the fix/local-python-interpreter branch June 30, 2026 21:39
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.

2 participants