From 785b7135ce62cb7a3c813fb01cbfffb3483a113b Mon Sep 17 00:00:00 2001 From: Daniel Petty Date: Fri, 13 Nov 2026 07:16:29 +0000 Subject: [PATCH 1/3] fix(infra): turn off the Ansible color of every playbook run ansible-runner gives ansible-playbook a pseudo-terminal, and the process runner passes TERM from the person. In a color terminal the default callback puts color codes around the text of each event. The plan reads a skip result in color as unchecked, so a plan with no terminal and its apply in a color terminal disagree at the fresh check. The plan, the fresh check and the run now set ANSIBLE_NOCOLOR=True. A skip result that does not read stays unchecked. Closes #5352 --- .../5352-infra-plan-no-color/.openspec.yaml | 2 + .../5352-infra-plan-no-color/design.md | 19 ++++++ .../5352-infra-plan-no-color/proposal.md | 39 +++++++++++ .../specs/infra-plan/spec.md | 16 +++++ .../changes/5352-infra-plan-no-color/tasks.md | 16 +++++ src/devops_cli/infra/plan.py | 12 +++- tests/commands/test_infra_apply.py | 62 ++++++++++++++--- tests/commands/test_infra_plan.py | 2 + .../infra/runner_events/site_color.jsonl | 66 +++++++++++++++++++ tests/infra/test_plan.py | 21 ++++++ tests/support/infra.py | 32 +++++++-- 11 files changed, 270 insertions(+), 17 deletions(-) create mode 100644 openspec/changes/5352-infra-plan-no-color/.openspec.yaml create mode 100644 openspec/changes/5352-infra-plan-no-color/design.md create mode 100644 openspec/changes/5352-infra-plan-no-color/proposal.md create mode 100644 openspec/changes/5352-infra-plan-no-color/specs/infra-plan/spec.md create mode 100644 openspec/changes/5352-infra-plan-no-color/tasks.md create mode 100644 tests/fixtures/infra/runner_events/site_color.jsonl diff --git a/openspec/changes/5352-infra-plan-no-color/.openspec.yaml b/openspec/changes/5352-infra-plan-no-color/.openspec.yaml new file mode 100644 index 0000000000..22ca07d756 --- /dev/null +++ b/openspec/changes/5352-infra-plan-no-color/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-11-13 diff --git a/openspec/changes/5352-infra-plan-no-color/design.md b/openspec/changes/5352-infra-plan-no-color/design.md new file mode 100644 index 0000000000..8ea8aa60fc --- /dev/null +++ b/openspec/changes/5352-infra-plan-no-color/design.md @@ -0,0 +1,19 @@ +# Design + +## Decisions + +- `_PLAN_ENV` holds `ANSIBLE_NOCOLOR=True`. `runner_env` adds `_PLAN_ENV` after the allowlist of the process runner, so every run of `Playbook.run` gets it: the plan, the fresh check and the run of an apply. The status ping (`ping_env`) parses no skip result and does not change. +- `_is_check_mode_skip` does not change. A skip result that does not read as JSON stays unchecked: the safe side. +- The tests use a real recording. `tests/fixtures/infra/runner_events/site_color.jsonl` holds the job events of the run `site` of the probe again, with `TERM=xterm-256color` and no `ANSIBLE_NOCOLOR`, as a color terminal gave them before this change. The answer of the fake `ansible-runner` (`terminal_events` in `tests/support/infra.py`) gives that recording to a run whose environment is the environment of the recording, and the recording `site` to every other run. It reads the environment of the run with `build_subprocess_env`, the function that the process runner uses, so the `TERM` of the person reaches the decision as it reaches the real run. +- Acceptance criterion 1 of the issue asks for the same plan "with and without the color codes in `stdout`". The proposed fix of the issue removes the color codes and keeps the safe side for a result that does not read. Thus the test of the plan reader shows that a skip in color stays unchecked, and the test of the apply shows that a plan with no `TERM` and its apply with `TERM=xterm-256color` get the same plan (criteria 1 and 3). The tests of the plan run and of the apply runs find `ANSIBLE_NOCOLOR=True` in the environment of each `ansible-runner` run (criterion 2). + +## Rejected alternatives + +- **Remove the color codes in the plan reader.** The cause is the color of the event text, and Ansible has a setting that turns it off. The recorded run with `TERM=xterm-256color` and `ANSIBLE_NOCOLOR=True` holds no escape code and gives the same plan as the run with no `TERM`. A reader of terminal codes is a second fix for the same cause and more code to keep, and the issue asks to keep the safe side for a result that does not read. +- **Set `ANSIBLE_NOCOLOR` in the environment of the caller.** The process runner drops it: `DEFAULT_ALLOWED_ENV_VARS` holds `TERM` and `COLORTERM`, and no allowed name or prefix matches an `ANSIBLE_` variable. The second apply of the owner with `ANSIBLE_NOCOLOR=1` stopped the same way. +- **Remove `TERM` and `COLORTERM` from the environment of the run.** The allowlist of the process runner is shared by every child. A removal for one caller needs a new option of the process runner, and Ansible has its own setting for this. +- **Read the skip result from the event data.** ansible-runner 2.4.3 puts no result in the event data of `runner_on_skipped` (`v2_runner_on_skipped` in `awx_display.py`), so the event `stdout` is the only source. + +## Limits + +- `ansible/utils/color.py` applies `ANSIBLE_FORCE_COLOR` after `ANSIBLE_NOCOLOR`. A repo whose `ansible.cfg` sets `force_color` thus gets color in every run. The plan and the fresh check then read the same text in each caller environment and agree, and each skip by a false `when` is unchecked: the safe side. diff --git a/openspec/changes/5352-infra-plan-no-color/proposal.md b/openspec/changes/5352-infra-plan-no-color/proposal.md new file mode 100644 index 0000000000..da773e1111 --- /dev/null +++ b/openspec/changes/5352-infra-plan-no-color/proposal.md @@ -0,0 +1,39 @@ +# Proposal: #5352 + +## Why + +`devops infra apply` stops at the fresh check when the plan came from a run with no terminal and the apply runs in a color terminal (#5352). ansible-runner starts `ansible-playbook` in a pseudo-terminal, and the process runner passes `TERM` and `COLORTERM` from the caller. Thus with `TERM=xterm-256color` the default callback puts color codes around the text of each event. The plan reads the skip result after ` => ` in the event `stdout` as JSON. A result in color does not read, so the plan counts the skip as unchecked (the safe side). A skip by a false `when` is then unchecked in a color terminal and not unchecked with no terminal, and the fresh check differs from the plan. Closes #5352. + +## What Changes + +- Every `ansible-runner` run of a playbook (the plan, the fresh check and the run of an apply) gets `ANSIBLE_NOCOLOR=True` in its environment. The callback then writes the same event text in a color terminal and with no terminal, and the plan of a host is the same in both. +- A skip result that does not read as JSON stays unchecked, as before. +- The change is observable: the plan of a host in a color terminal changes, and `devops infra apply` passes the fresh check that stopped it. Thus it carries a delta of the capability `infra-plan`. + +## Capabilities + +- `infra-plan`: ADDED requirement "The run output has no color". + +## Impact + +- Code: `src/devops_cli/infra/plan.py` (`_PLAN_ENV`, the docstrings of the module and of `runner_env`). +- Tests: `tests/infra/test_plan.py`, `tests/commands/test_infra_plan.py`, `tests/commands/test_infra_apply.py`, `tests/support/infra.py`, and the new recorded run `tests/fixtures/infra/runner_events/site_color.jsonl`. +- A plan record made in a color terminal before this change can show more unchecked tasks than a fresh check after it. Such a plan stops at the fresh check. Make the plan again. +- No setting, command, option or message changes. No manifest changes. The change fits one pull request. + +## Feasibility + +The premise was confirmed against `origin/main` and the pinned tools (ansible-core 2.22.0, ansible-runner 2.4.3 in the tool environment of `[python.ansible-core]`): + +- `_is_check_mode_skip` (`src/devops_cli/infra/plan.py`) returns `True` when `json.loads` of the text after ` => ` fails. `_PLAN_ENV` holds no `ANSIBLE_NOCOLOR`. +- `DEFAULT_ALLOWED_ENV_VARS` (`src/devops_cli/core/process.py`) holds `TERM` and `COLORTERM`, and no allowed name or prefix matches `ANSIBLE_NOCOLOR`. Thus a caller `ANSIBLE_NOCOLOR=1` does not reach the run, as the comment of the owner on the issue says. +- `ansible_runner/runner.py` starts the command with `pexpect`, which gives it a pseudo-terminal. `ansible_runner/display_callback/callback/awx_display.py` (`v2_runner_on_skipped`) puts no result in the event data of a skip, so the event `stdout` is the only source of the skip result. +- `ansible/utils/color.py` turns color off when `ANSIBLE_NOCOLOR` is true. Else it turns color on when `stdout` is a terminal and `curses.setupterm()` finds a terminal with colors. `ANSIBLE_NOCOLOR` is the setting `nocolor` of `ansible.cfg`, also read from `NO_COLOR` (`ansible/config/base.yml`). +- Three check-mode runs of the probe `tests/fixtures/infra/runner_events/probe/` on all hosts, as `tests/support/infra.py` says: + - With no `TERM`: 0 of 65 events hold an escape code. node-1 has 1 unchecked task and node-3 has none. + - With `TERM=xterm-256color`: 21 events hold escape codes, and a skip has the `stdout` `\x1b[0;36mskipping: [node-3.example.com] => {"changed": false, "false_condition": ...}\x1b[0m`. node-1 has 2 unchecked tasks (`Remove the old demo unit` too) and node-3 has 1 (`Download and execute K3s agent installation script`). + - With `TERM=xterm-256color` and `ANSIBLE_NOCOLOR=True`: 0 events hold an escape code, and the plan of each host is equal to the plan of the run with no `TERM`. + +## Existing Tool Considered + +Ansible has the setting `ANSIBLE_NOCOLOR` (`nocolor` in `ansible.cfg`). The change sets it and adds no new tool or library. It deletes no internal code. diff --git a/openspec/changes/5352-infra-plan-no-color/specs/infra-plan/spec.md b/openspec/changes/5352-infra-plan-no-color/specs/infra-plan/spec.md new file mode 100644 index 0000000000..9339ab940f --- /dev/null +++ b/openspec/changes/5352-infra-plan-no-color/specs/infra-plan/spec.md @@ -0,0 +1,16 @@ +## ADDED Requirements + +### Requirement: The run output has no color +Every `ansible-runner` run of a playbook, the plan, the fresh check and the run of an apply, SHALL get `ANSIBLE_NOCOLOR=True` in its environment, so the event text and the plan of a host are the same in a color terminal and with no terminal. A skip result that does not read as JSON, such as a result with color codes, SHALL stay unchecked. + +#### Scenario: The environment of the plan run +- **WHEN** a person plans `ansible/playbooks/03_k3s.yaml` +- **THEN** `ansible-runner` gets `ANSIBLE_NOCOLOR=True` + +#### Scenario: A plan with no terminal and its apply in a color terminal +- **WHEN** a person plans node-3 with no `TERM`, and applies the plan with `TERM=xterm-256color` +- **THEN** each `ansible-runner` run gets `ANSIBLE_NOCOLOR=True`, the fresh check of node-3 equals the plan, and the apply exits 0 + +#### Scenario: A skip result in color +- **WHEN** the recorded run in a color terminal skips a task of node-1 and a task of node-3 by a false `when`, with the color codes around the text of each skip +- **THEN** each of the two tasks is unchecked, and the rest of the plan of each host equals the plan of the run with no terminal diff --git a/openspec/changes/5352-infra-plan-no-color/tasks.md b/openspec/changes/5352-infra-plan-no-color/tasks.md new file mode 100644 index 0000000000..a8ebcdda89 --- /dev/null +++ b/openspec/changes/5352-infra-plan-no-color/tasks.md @@ -0,0 +1,16 @@ +# Tasks + +## 1. Turn off the color of every run of a playbook + +Kind: behavior. Reads: `src/devops_cli/infra/plan.py`, `src/devops_cli/core/process.py`, `tests/support/infra.py`. Changes: `src/devops_cli/infra/plan.py`, `tests/support/infra.py`, `tests/fixtures/infra/runner_events/site_color.jsonl`, `tests/commands/test_infra_plan.py`, `tests/commands/test_infra_apply.py`, `tests/infra/test_plan.py`. + +- [x] 1.1 Record the run `site` of the probe again with `TERM=xterm-256color` and no `ANSIBLE_NOCOLOR` as `tests/fixtures/infra/runner_events/site_color.jsonl`, and say how in `tests/support/infra.py`. Add `terminal_events` to `tests/support/infra.py`: it answers a run with the recording `site_color` when the environment of the run is the environment of that recording, else with the recording `site`. Add `ANSIBLE_NOCOLOR=True` to the environment that `test_the_run_is_check_mode_on_the_limit_without_offline_hosts_with_the_key` expects + - Verification: `$ uv run devops ci test tests/commands/test_infra_plan.py` fails on the base +- [x] 1.2 Add `test_a_plan_with_no_terminal_passes_the_fresh_check_of_its_apply_in_a_color_terminal` to `tests/commands/test_infra_apply.py`: the plan of node-3 runs with no `TERM`, the apply runs with `TERM=xterm-256color`, the apply exits 0 with each step of node-3, and each `ansible-runner` run gets `ANSIBLE_NOCOLOR=True` + - Verification: `$ uv run devops ci test tests/commands/test_infra_apply.py` fails on the base +- [x] 1.3 Add `test_a_skip_result_in_color_stays_unchecked` to `tests/infra/test_plan.py`: in the recording `site_color`, the two skips by a false `when` are unchecked, and the rest of each host plan equals the plan of the recording `site` + - Verification: `$ uv run devops ci test tests/infra/test_plan.py` passes on the base and after the change +- [x] 1.4 Add `ANSIBLE_NOCOLOR=True` to `_PLAN_ENV` in `src/devops_cli/infra/plan.py`, and say why in the docstrings of the module and of `runner_env` + - Verification: `$ uv run devops ci test tests/commands/test_infra_plan.py tests/commands/test_infra_apply.py tests/infra/test_plan.py` passes + +- Pending a person: review the diff in tuicr (tuicr -r origin/main..HEAD). diff --git a/src/devops_cli/infra/plan.py b/src/devops_cli/infra/plan.py index a12cf3c636..4803847f84 100644 --- a/src/devops_cli/infra/plan.py +++ b/src/devops_cli/infra/plan.py @@ -7,7 +7,11 @@ once for each version of the file, and runs `ansible-runner run --playbook ` with `--check --diff -v` and the limit `:!`. The run gets the repo's `ansible.cfg`, the key of `devops ssh` as `ansible_ssh_private_key_file`, host key checks on, and -the environment of the process runner, so no `ANSIBLE_` variable of the person reaches it. +the environment of the process runner, so no `ANSIBLE_` variable of the person reaches it. The +`TERM` of the person reaches it, and ansible-runner gives the run a pseudo-terminal, so in a color +terminal the default callback puts color codes around the text of each event. Every run sets +`ANSIBLE_NOCOLOR` (#5352): the event text, and so the plan, is the same in a color terminal and with +no terminal. The job events (`artifacts//job_events/*.json`) give the plan of each host, with no read of the repo's YAML: @@ -115,11 +119,13 @@ # that changes a file with a secret do not hold its text. _RUN_OPTIONS: Final[tuple[str, ...]] = ("-v",) # What the run adds to the environment of `ping_env`: the rendered arguments in each result, the -# results as JSON, and a line for each skipped host. +# results as JSON, a line for each skipped host, and no color. A skip result in color does not read +# as JSON, and the plan counts it as unchecked (#5352). _PLAN_ENV: Final[dict[str, str]] = { "ANSIBLE_INJECT_INVOCATION": "True", "ANSIBLE_CALLBACK_RESULT_FORMAT": "json", "ANSIBLE_DISPLAY_SKIPPED_HOSTS": "True", + "ANSIBLE_NOCOLOR": "True", } _EVENT_OK: Final[str] = "runner_on_ok" @@ -414,7 +420,7 @@ def _config_env(project: Path) -> dict[str, str]: def runner_env(tool: AnsibleTool, project: Path, collections: Path | None) -> dict[str, str]: """The environment that the run adds: the tool environment first on PATH, host key checks on, the repo's `ansible.cfg`, the rendered arguments in each result, the results as JSON, a line - for each skipped host, and the pinned collections.""" + for each skipped host, no color, and the pinned collections.""" env = ping_env(tool) | _PLAN_ENV | _config_env(project) if collections is not None: env["ANSIBLE_COLLECTIONS_PATH"] = str(collections) diff --git a/tests/commands/test_infra_apply.py b/tests/commands/test_infra_apply.py index 1e4b206bb7..024850d59b 100644 --- a/tests/commands/test_infra_apply.py +++ b/tests/commands/test_infra_apply.py @@ -10,7 +10,7 @@ from __future__ import annotations import json -from collections.abc import Callable +from collections.abc import Callable, Mapping from pathlib import Path from typing import Any @@ -21,6 +21,7 @@ from tests.support.fakes.github import GitHubApiFake, github_json from tests.support.fakes.process import ProcessAnswer, ProcessCall, ProcessFake from tests.support.infra import ( + COLOR_TERM, KUBE_CONTEXT, ORIGIN_COMMIT, SSH_KEY_NAME, @@ -34,6 +35,7 @@ limit_hosts, recorded_read, site_events, + terminal_events, ) REPO = "example-org/infra" @@ -64,23 +66,39 @@ def __init__( self.steps = steps self.bin_dir = bin_dir - def plan(self, limit: str, *extra: str) -> dict[str, Any]: - """Plan the playbook on `limit` at the level full, and give the plan record.""" + def plan( + self, limit: str, *extra: str, env: Mapping[str, str | None] | None = None + ) -> dict[str, Any]: + """Plan the playbook on `limit` at the level full, and give the plan record. `env` changes + the environment of the person, such as the terminal.""" self.write_entry("full") - result = self.cli("infra", "plan", REPO, PLAYBOOK, "--limit", limit, *extra, "-f", "json") + result = self.cli( + "infra", "plan", REPO, PLAYBOOK, "--limit", limit, *extra, "-f", "json", env=env + ) assert result.exit_code == 0, result.output self.steps.clear() return dict(json.loads(result.output)) - def apply(self, plan: dict[str, Any], *extra: str, level: str = "full") -> Any: + def apply( + self, + plan: dict[str, Any], + *extra: str, + level: str = "full", + env: Mapping[str, str | None] | None = None, + ) -> Any: self.write_entry(level) limit = ("--limit", plan["limit"]) if plan["limit"] else () - return self.cli( - "infra", "apply", REPO, PLAYBOOK, "--plan", plan["id"], *limit, *extra, "--auto-approve" - ) + argv = ("infra", "apply", REPO, PLAYBOOK, "--plan", plan["id"], *limit, *extra) + return self.cli(*argv, "--auto-approve", env=env) - def apply_json(self, plan: dict[str, Any], *extra: str, level: str = "full") -> Any: - return self.apply(plan, *extra, "-f", "json", level=level) + def apply_json( + self, + plan: dict[str, Any], + *extra: str, + level: str = "full", + env: Mapping[str, str | None] | None = None, + ) -> Any: + return self.apply(plan, *extra, "-f", "json", level=level, env=env) def runs(self, events: Callable[[ProcessCall, Path], list[dict[str, Any]]]) -> None: """Answer the next runs with `events`.""" @@ -216,6 +234,30 @@ def fewer_changes(call: ProcessCall, project: Path) -> list[dict[str, Any]]: assert lab.cluster.nodes["node-3"].cordoned +def test_a_plan_with_no_terminal_passes_the_fresh_check_of_its_apply_in_a_color_terminal( + lab: Lab, person_caller: None +) -> None: + """In a color terminal the callback puts color codes around the skip of node-3 by a false + `when`, and the plan reads such a skip as unchecked. Every run turns the color off, so the + fresh check equals the plan (#5352).""" + lab.runs(terminal_events) + plan = lab.plan(NODE_3, env={"TERM": None}) + + result = lab.apply_json(plan, env={"TERM": COLOR_TERM}) + + assert result.exit_code == 0, result.output + assert lab.steps == [ + "drain check node-3", + "drain node-3", + f"check {NODE_3}", + f"run {NODE_3}", + "uncordon node-3", + ] + runner = str(lab.bin_dir / "ansible-runner") + runs = [call for call in lab.process_fake.calls if call.argv[0] == runner] + assert [(call.env or {}).get("ANSIBLE_NOCOLOR") for call in runs] == ["True"] * 3 + + def test_a_task_that_changed_and_is_not_in_the_plan_stops_the_apply( lab: Lab, person_caller: None ) -> None: diff --git a/tests/commands/test_infra_plan.py b/tests/commands/test_infra_plan.py index 498bf4754d..9c532cd0a1 100644 --- a/tests/commands/test_infra_plan.py +++ b/tests/commands/test_infra_plan.py @@ -148,6 +148,7 @@ def test_the_run_is_check_mode_on_the_limit_without_offline_hosts_with_the_key( "ANSIBLE_INJECT_INVOCATION", "ANSIBLE_CALLBACK_RESULT_FORMAT", "ANSIBLE_DISPLAY_SKIPPED_HOSTS", + "ANSIBLE_NOCOLOR", ) } == { "ANSIBLE_HOST_KEY_CHECKING": "True", @@ -155,6 +156,7 @@ def test_the_run_is_check_mode_on_the_limit_without_offline_hosts_with_the_key( "ANSIBLE_INJECT_INVOCATION": "True", "ANSIBLE_CALLBACK_RESULT_FORMAT": "json", "ANSIBLE_DISPLAY_SKIPPED_HOSTS": "True", + "ANSIBLE_NOCOLOR": "True", } collections = Path(run.env["ANSIBLE_COLLECTIONS_PATH"]) assert collections.parent == Path(_option(galaxy.argv, "-p")).parent diff --git a/tests/fixtures/infra/runner_events/site_color.jsonl b/tests/fixtures/infra/runner_events/site_color.jsonl new file mode 100644 index 0000000000..d070aadbb5 --- /dev/null +++ b/tests/fixtures/infra/runner_events/site_color.jsonl @@ -0,0 +1,66 @@ +{"event":"verbose","uuid":"80f85853-9f8f-4ca9-bb41-7aecdf6b3d83","counter":1,"stdout":"\u001b[0;34mUsing {project}/ansible.cfg as config file\u001b[0m","start_line":0,"end_line":1,"runner_ident":"site_color","created":"2026-11-13T06:58:47.014626+00:00"} +{"event":"verbose","uuid":"a9b05fcc-6116-4b59-99cb-ee5f0ced3088","counter":2,"stdout":"\u001b[1;35m[WARNING]: Could not match supplied host pattern, ignoring: offline\u001b[0m","start_line":1,"end_line":2,"runner_ident":"site_color","created":"2026-11-13T06:58:47.066597+00:00"} +{"uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","counter":3,"stdout":"","start_line":2,"end_line":2,"runner_ident":"site_color","event":"playbook_on_start","pid":677835,"created":"2026-11-13T06:58:47.126474+00:00","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","counter":4,"stdout":"\r\nPLAY [Connect K3s Agent Nodes to Cluster] **************************************","start_line":2,"end_line":4,"runner_ident":"site_color","event":"playbook_on_play_start","pid":677835,"created":"2026-11-13T06:58:47.128421+00:00","parent_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","name":"Connect K3s Agent Nodes to Cluster","pattern":"k3s_agent","uuid":"9ea46fc1-9c65-2b37-55e9-000000000005"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-00000000000a","counter":5,"stdout":"\r\nTASK [k3s_agent : Create Rancher K3s configuration directory on agent] *********","start_line":4,"end_line":6,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:47.135723+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Create Rancher K3s configuration directory on agent","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000a","task_action":"ansible.builtin.file","resolved_action":"ansible.builtin.file","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:2","role":"k3s_agent","name":"k3s_agent : Create Rancher K3s configuration directory on agent","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-00000000000a"}} +{"uuid":"58b2cd14-0033-4a80-b5ac-604ac231101c","counter":6,"stdout":"","start_line":6,"end_line":6,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:47.136391+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000a","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Create Rancher K3s configuration directory on agent","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000a","task_action":"ansible.builtin.file","resolved_action":"ansible.builtin.file","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:2","role":"k3s_agent","host":"node-3.example.com","uuid":"58b2cd14-0033-4a80-b5ac-604ac231101c"}} +{"uuid":"0bde0e81-f9b2-435d-a3fd-b621d8b882bb","counter":7,"stdout":"","start_line":6,"end_line":6,"runner_ident":"site_color","event":"runner_on_file_diff","pid":677835,"created":"2026-11-13T06:58:47.446313+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000a","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Create Rancher K3s configuration directory on agent","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000a","task_action":"ansible.builtin.file","resolved_action":"ansible.builtin.file","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:2","role":"k3s_agent","host":"node-3.example.com","diff":{"before":{"path":"/srv/example"},"after":{"path":"/srv/example"}},"uuid":"0bde0e81-f9b2-435d-a3fd-b621d8b882bb"}} +{"uuid":"44a8d686-e0f5-4eeb-bdd7-0fae3ee9678c","counter":8,"stdout":"\u001b[0;32mok: [node-3.example.com] => {\"changed\": false, \"gid\": 1000, \"group\": \"root\", \"mode\": \"0755\", \"owner\": \"root\", \"path\": \"/srv/example\", \"size\": 4096, \"state\": \"directory\", \"uid\": 1000}\u001b[0m","start_line":6,"end_line":7,"runner_ident":"site_color","event":"runner_on_ok","pid":677835,"created":"2026-11-13T06:58:47.446937+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000a","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Create Rancher K3s configuration directory on agent","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000a","task_action":"ansible.builtin.file","resolved_action":"ansible.builtin.file","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:2","role":"k3s_agent","host":"node-3.example.com","remote_addr":"node-3.example.com","res":{"changed":false,"diff":{"before":{"path":"/srv/example"},"after":{"path":"/srv/example"}},"path":"/srv/example","uid":1000,"gid":1000,"owner":"root","group":"root","mode":"0755","state":"directory","size":4096,"invocation":{"module_args":{"path":"/srv/example","state":"directory","recurse":false,"force":false,"follow":true,"modification_time_format":"%Y%m%d%H%M.%S","access_time_format":"%Y%m%d%H%M.%S","unsafe_writes":false,"_original_basename":null,"_diff_peek":null,"src":null,"modification_time":null,"access_time":null,"mode":null,"owner":null,"group":null,"seuser":null,"serole":null,"selevel":null,"setype":null,"attributes":null}}},"start":"2026-11-13T06:58:47.136346+00:00","end":"2026-11-13T06:58:47.446723+00:00","duration":0.310377,"event_loop":null,"uuid":"44a8d686-e0f5-4eeb-bdd7-0fae3ee9678c"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-00000000000b","counter":9,"stdout":"\r\nTASK [k3s_agent : Read cluster join token from K3s server] *********************","start_line":7,"end_line":9,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:47.449191+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Read cluster join token from K3s server","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000b","task_action":"ansible.builtin.slurp","resolved_action":"ansible.builtin.slurp","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:7","role":"k3s_agent","name":"k3s_agent : Read cluster join token from K3s server","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-00000000000b"}} +{"uuid":"42cafba4-fba9-4cb9-9fa2-5ba9d5ab98a2","counter":10,"stdout":"","start_line":9,"end_line":9,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:47.449914+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000b","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Read cluster join token from K3s server","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000b","task_action":"ansible.builtin.slurp","resolved_action":"ansible.builtin.slurp","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:7","role":"k3s_agent","host":"node-3.example.com","uuid":"42cafba4-fba9-4cb9-9fa2-5ba9d5ab98a2"}} +{"uuid":"52616ce8-5ee8-44d6-8659-ecd94f093c11","counter":11,"stdout":"\u001b[0;32mok: [node-3.example.com] => {\"censored\": \"the output has been hidden due to the fact that 'no_log: true' was specified for this result\", \"changed\": false}\u001b[0m","start_line":9,"end_line":10,"runner_ident":"site_color","event":"runner_on_ok","pid":677835,"created":"2026-11-13T06:58:47.709104+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000b","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Read cluster join token from K3s server","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000b","task_action":"ansible.builtin.slurp","resolved_action":"ansible.builtin.slurp","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:7","role":"k3s_agent","host":"node-3.example.com","remote_addr":"node-3.example.com","res":{"censored":"the output has been hidden due to the fact that 'no_log: true' was specified for this result"},"start":"2026-11-13T06:58:47.449871+00:00","end":"2026-11-13T06:58:47.708716+00:00","duration":0.258845,"event_loop":null,"uuid":"52616ce8-5ee8-44d6-8659-ecd94f093c11"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-00000000000c","counter":12,"stdout":"\r\nTASK [k3s_agent : Set cluster join token fact] *********************************","start_line":10,"end_line":12,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:47.711778+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Set cluster join token fact","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000c","task_action":"ansible.builtin.set_fact","resolved_action":"ansible.builtin.set_fact","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:13","role":"k3s_agent","name":"k3s_agent : Set cluster join token fact","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-00000000000c"}} +{"uuid":"0c0b3a4e-9d98-4b97-acb2-42d0d630dbc1","counter":13,"stdout":"","start_line":12,"end_line":12,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:47.712585+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000c","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Set cluster join token fact","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000c","task_action":"ansible.builtin.set_fact","resolved_action":"ansible.builtin.set_fact","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:13","role":"k3s_agent","host":"node-3.example.com","uuid":"0c0b3a4e-9d98-4b97-acb2-42d0d630dbc1"}} +{"uuid":"3fc56079-6ac0-4556-8749-570b84707ac2","counter":14,"stdout":"\u001b[0;32mok: [node-3.example.com] => {\"censored\": \"the output has been hidden due to the fact that 'no_log: true' was specified for this result\", \"changed\": false}\u001b[0m","start_line":12,"end_line":13,"runner_ident":"site_color","event":"runner_on_ok","pid":677835,"created":"2026-11-13T06:58:47.737345+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000c","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Set cluster join token fact","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000c","task_action":"ansible.builtin.set_fact","resolved_action":"ansible.builtin.set_fact","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:13","role":"k3s_agent","host":"node-3.example.com","remote_addr":"node-3.example.com","res":{"censored":"the output has been hidden due to the fact that 'no_log: true' was specified for this result"},"start":"2026-11-13T06:58:47.712515+00:00","end":"2026-11-13T06:58:47.737080+00:00","duration":0.024565,"event_loop":null,"uuid":"3fc56079-6ac0-4556-8749-570b84707ac2"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-00000000000d","counter":15,"stdout":"\r\nTASK [k3s_agent : Deploy K3s agent configuration file] *************************","start_line":13,"end_line":15,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:47.739504+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Deploy K3s agent configuration file","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000d","task_action":"ansible.builtin.template","resolved_action":"ansible.builtin.template","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:18","role":"k3s_agent","name":"k3s_agent : Deploy K3s agent configuration file","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-00000000000d"}} +{"uuid":"25cd2364-d150-4349-b049-ebda590a06da","counter":16,"stdout":"","start_line":15,"end_line":15,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:47.740150+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000d","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Deploy K3s agent configuration file","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000d","task_action":"ansible.builtin.template","resolved_action":"ansible.builtin.template","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:18","role":"k3s_agent","host":"node-3.example.com","uuid":"25cd2364-d150-4349-b049-ebda590a06da"}} +{"uuid":"f61609a6-1d70-400d-85e2-7859ac88c864","counter":17,"stdout":"","start_line":15,"end_line":15,"runner_ident":"site_color","event":"runner_on_file_diff","pid":677835,"created":"2026-11-13T06:58:47.997328+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000d","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Deploy K3s agent configuration file","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000d","task_action":"ansible.builtin.template","resolved_action":"ansible.builtin.template","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:18","role":"k3s_agent","host":"node-3.example.com","diff":[],"uuid":"f61609a6-1d70-400d-85e2-7859ac88c864"}} +{"uuid":"dd980f0a-9de3-470f-a83a-342c22962175","counter":18,"stdout":"\u001b[0;33mchanged: [node-3.example.com] => {\"changed\": true}\u001b[0m","start_line":15,"end_line":16,"runner_ident":"site_color","event":"runner_on_ok","pid":677835,"created":"2026-11-13T06:58:47.997797+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000d","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Deploy K3s agent configuration file","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000d","task_action":"ansible.builtin.template","resolved_action":"ansible.builtin.template","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:18","role":"k3s_agent","host":"node-3.example.com","remote_addr":"node-3.example.com","res":{"changed":true,"diff":[],"invocation":{"dest":"/srv/example/config.yaml","mode":"0600","src":"/root/.ansible/tmp/ansible-local-677835lh714kq3/tmpg5np0mos/k3s-agent-config.yaml.j2","follow":false,"module_args":{"dest":"/srv/example/config.yaml","mode":"0600","src":"/root/.ansible/tmp/ansible-local-677835lh714kq3/tmpg5np0mos/k3s-agent-config.yaml.j2","follow":false}}},"start":"2026-11-13T06:58:47.740110+00:00","end":"2026-11-13T06:58:47.997673+00:00","duration":0.257563,"event_loop":null,"uuid":"dd980f0a-9de3-470f-a83a-342c22962175"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-00000000000e","counter":19,"stdout":"\r\nTASK [k3s_agent : Check if K3s agent binary exists] ****************************","start_line":16,"end_line":18,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:48.000825+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Check if K3s agent binary exists","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000e","task_action":"ansible.builtin.stat","resolved_action":"ansible.builtin.stat","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:26","role":"k3s_agent","name":"k3s_agent : Check if K3s agent binary exists","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-00000000000e"}} +{"uuid":"c1e7e345-8dfd-4441-9ba9-2b69a4459cb0","counter":20,"stdout":"","start_line":18,"end_line":18,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:48.001502+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000e","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Check if K3s agent binary exists","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000e","task_action":"ansible.builtin.stat","resolved_action":"ansible.builtin.stat","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:26","role":"k3s_agent","host":"node-3.example.com","uuid":"c1e7e345-8dfd-4441-9ba9-2b69a4459cb0"}} +{"uuid":"f46e84a9-4534-47f8-8b1f-f51808b699a7","counter":21,"stdout":"\u001b[0;32mok: [node-3.example.com] => {\"changed\": false, \"stat\": {\"atime\": 1794553126.641311, \"attr_flags\": \"\", \"attributes\": [], \"block_size\": 4096, \"blocks\": 8, \"charset\": \"unknown\", \"ctime\": 1794553126.6464067, \"dev\": 2096, \"device_type\": 0, \"disk_usage_bytes\": 4096, \"executable\": true, \"exists\": true, \"gid\": 1000, \"gr_name\": \"root\", \"inode\": 21958996, \"isblk\": false, \"ischr\": false, \"isdir\": true, \"isfifo\": false, \"isgid\": false, \"islnk\": false, \"isreg\": false, \"issock\": false, \"isuid\": false, \"mimetype\": \"unknown\", \"mode\": \"0755\", \"mtime\": 1794553126.6464067, \"nlink\": 2, \"path\": \"/srv/example\", \"pw_name\": \"root\", \"readable\": true, \"rgrp\": true, \"roth\": true, \"rusr\": true, \"size\": 4096, \"uid\": 1000, \"version\": null, \"wgrp\": false, \"woth\": false, \"writeable\": true, \"wusr\": true, \"xgrp\": true, \"xoth\": true, \"xusr\": true}}\u001b[0m","start_line":18,"end_line":19,"runner_ident":"site_color","event":"runner_on_ok","pid":677835,"created":"2026-11-13T06:58:48.204827+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000e","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Check if K3s agent binary exists","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000e","task_action":"ansible.builtin.stat","resolved_action":"ansible.builtin.stat","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:26","role":"k3s_agent","host":"node-3.example.com","remote_addr":"node-3.example.com","res":{"changed":false,"stat":{"exists":true,"path":"/srv/example","mode":"0755","isdir":true,"ischr":false,"isblk":false,"isreg":false,"isfifo":false,"islnk":false,"issock":false,"uid":1000,"gid":1000,"size":4096,"inode":21958996,"dev":2096,"nlink":2,"atime":1794553126.641311,"mtime":1794553126.6464067,"ctime":1794553126.6464067,"wusr":true,"rusr":true,"xusr":true,"wgrp":false,"rgrp":true,"xgrp":true,"woth":false,"roth":true,"xoth":true,"isuid":false,"isgid":false,"blocks":8,"disk_usage_bytes":4096,"block_size":4096,"device_type":0,"readable":true,"writeable":true,"executable":true,"pw_name":"root","gr_name":"root","mimetype":"unknown","charset":"unknown","version":null,"attributes":[],"attr_flags":""},"invocation":{"module_args":{"path":"/srv/example","follow":false,"get_checksum":true,"get_mime":true,"get_attributes":true,"get_selinux_context":false,"checksum_algorithm":"sha1"}}},"start":"2026-11-13T06:58:48.001462+00:00","end":"2026-11-13T06:58:48.204009+00:00","duration":0.202547,"event_loop":null,"uuid":"f46e84a9-4534-47f8-8b1f-f51808b699a7"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-00000000000f","counter":22,"stdout":"\r\nTASK [k3s_agent : Download and execute K3s agent installation script] **********","start_line":19,"end_line":21,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:48.207844+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Download and execute K3s agent installation script","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000f","task_action":"ansible.builtin.shell","resolved_action":"ansible.builtin.shell","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:31","role":"k3s_agent","name":"k3s_agent : Download and execute K3s agent installation script","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-00000000000f"}} +{"uuid":"a0629bbe-651a-4723-9ed2-c895c7b548e9","counter":23,"stdout":"","start_line":21,"end_line":21,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:48.208604+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000f","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Download and execute K3s agent installation script","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000f","task_action":"ansible.builtin.shell","resolved_action":"ansible.builtin.shell","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:31","role":"k3s_agent","host":"node-3.example.com","uuid":"a0629bbe-651a-4723-9ed2-c895c7b548e9"}} +{"uuid":"38bdac32-5a94-4f82-bf93-f40bc3540bcc","counter":24,"stdout":"\u001b[0;36mskipping: [node-3.example.com] => {\"changed\": false, \"false_condition\": \"not k3s_agent_binary.stat.exists\", \"skip_reason\": \"Conditional result was False\"}\u001b[0m","start_line":21,"end_line":22,"runner_ident":"site_color","event":"runner_on_skipped","pid":677835,"created":"2026-11-13T06:58:48.219671+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000f","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Download and execute K3s agent installation script","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000000f","task_action":"ansible.builtin.shell","resolved_action":"ansible.builtin.shell","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:31","role":"k3s_agent","host":"node-3.example.com","remote_addr":"node-3.example.com","start":"2026-11-13T06:58:48.208555+00:00","end":"2026-11-13T06:58:48.219487+00:00","duration":0.010932,"event_loop":null,"uuid":"38bdac32-5a94-4f82-bf93-f40bc3540bcc"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-000000000010","counter":25,"stdout":"\r\nTASK [k3s_agent : Remove join token and server URL from K3s agent systemd environment file] ***","start_line":22,"end_line":24,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:48.221770+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Remove join token and server URL from K3s agent systemd environment file","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000010","task_action":"ansible.builtin.lineinfile","resolved_action":"ansible.builtin.lineinfile","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:36","role":"k3s_agent","name":"k3s_agent : Remove join token and server URL from K3s agent systemd environment file","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-000000000010"}} +{"uuid":"846d5593-6fe9-4dbc-9734-5e075c0c50a0","counter":26,"stdout":"","start_line":24,"end_line":24,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:48.222524+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000010","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Remove join token and server URL from K3s agent systemd environment file","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000010","task_action":"ansible.builtin.lineinfile","resolved_action":"ansible.builtin.lineinfile","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:36","role":"k3s_agent","host":"node-3.example.com","uuid":"846d5593-6fe9-4dbc-9734-5e075c0c50a0"}} +{"uuid":"027d4775-9b2e-4f2e-9f29-03494254be6f","counter":27,"stdout":"\u001b[0;32mok: [node-3.example.com] => {\"changed\": false, \"msg\": \"file not present\"}\u001b[0m","start_line":24,"end_line":25,"runner_ident":"site_color","event":"runner_on_ok","pid":677835,"created":"2026-11-13T06:58:48.485894+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000010","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Remove join token and server URL from K3s agent systemd environment file","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000010","task_action":"ansible.builtin.lineinfile","resolved_action":"ansible.builtin.lineinfile","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:36","role":"k3s_agent","host":"node-3.example.com","remote_addr":"node-3.example.com","res":{"changed":false,"msg":"file not present","invocation":{"module_args":{"path":"/srv/example/absent.env","regexp":"^K3S_(TOKEN|URL)=","state":"absent","encoding":"utf-8","backrefs":false,"create":false,"backup":false,"firstmatch":false,"unsafe_writes":false,"search_string":null,"line":null,"insertafter":null,"insertbefore":null,"validate":null,"mode":null,"owner":null,"group":null,"seuser":null,"serole":null,"selevel":null,"setype":null,"attributes":null}}},"start":"2026-11-13T06:58:48.222483+00:00","end":"2026-11-13T06:58:48.485494+00:00","duration":0.263011,"event_loop":null,"uuid":"027d4775-9b2e-4f2e-9f29-03494254be6f"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-000000000011","counter":28,"stdout":"\r\nTASK [k3s_agent : Ensure K3s-agent systemd service is started and enabled] *****","start_line":25,"end_line":27,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:48.487884+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Ensure K3s-agent systemd service is started and enabled","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000011","task_action":"ansible.builtin.systemd","resolved_action":"ansible.builtin.systemd","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:43","role":"k3s_agent","name":"k3s_agent : Ensure K3s-agent systemd service is started and enabled","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-000000000011"}} +{"uuid":"ee26fdfd-d039-45bf-b9a8-1474ae72c3e9","counter":29,"stdout":"","start_line":27,"end_line":27,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:48.488598+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000011","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Ensure K3s-agent systemd service is started and enabled","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000011","task_action":"ansible.builtin.systemd","resolved_action":"ansible.builtin.systemd","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:43","role":"k3s_agent","host":"node-3.example.com","uuid":"ee26fdfd-d039-45bf-b9a8-1474ae72c3e9"}} +{"uuid":"ebd82b15-57e7-4137-af30-a9b48ff4c819","counter":30,"stdout":"\u001b[0;33mchanged: [node-3.example.com] => {\"changed\": true, \"name\": \"k3s-agent\", \"state\": \"started\", \"status\": {\"ActiveState\": \"active\", \"Id\": \"demo.service\", \"LoadState\": \"loaded\", \"Names\": \"demo.service\", \"SubState\": \"running\", \"UnitFileState\": \"enabled\"}}\u001b[0m","start_line":27,"end_line":28,"runner_ident":"site_color","event":"runner_on_ok","pid":677835,"created":"2026-11-13T06:58:48.917767+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000011","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Connect K3s Agent Nodes to Cluster","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000005","play_pattern":"k3s_agent","task":"Ensure K3s-agent systemd service is started and enabled","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000011","task_action":"ansible.builtin.systemd","resolved_action":"ansible.builtin.systemd","task_args":"","task_path":"{project}/ansible/roles/k3s_agent/tasks/main.yaml:43","role":"k3s_agent","host":"node-3.example.com","remote_addr":"node-3.example.com","res":{"changed":true,"name":"k3s-agent","status":{"Id":"demo.service","Names":"demo.service","LoadState":"loaded","ActiveState":"active","SubState":"running","UnitFileState":"enabled"},"state":"started","invocation":{"module_args":{"name":"k3s-agent","state":"restarted","daemon_reload":false,"daemon_reexec":false,"scope":"system","no_block":false,"enabled":null,"force":null,"masked":null}}},"start":"2026-11-13T06:58:48.488519+00:00","end":"2026-11-13T06:58:48.917094+00:00","duration":0.428575,"event_loop":null,"uuid":"ebd82b15-57e7-4137-af30-a9b48ff4c819"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","counter":31,"stdout":"\r\nPLAY [Configure the demo unit] *************************************************","start_line":28,"end_line":30,"runner_ident":"site_color","event":"playbook_on_play_start","pid":677835,"created":"2026-11-13T06:58:48.923147+00:00","parent_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","name":"Configure the demo unit","pattern":"demo","uuid":"9ea46fc1-9c65-2b37-55e9-000000000012"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-000000000017","counter":32,"stdout":"\r\nTASK [demo : Write the demo config] ********************************************","start_line":30,"end_line":32,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:48.925711+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Write the demo config","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000017","task_action":"ansible.builtin.template","resolved_action":"ansible.builtin.template","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:2","role":"demo","name":"demo : Write the demo config","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-000000000017"}} +{"uuid":"93a3fe34-e17e-413e-9ce8-7cccbea10277","counter":33,"stdout":"","start_line":32,"end_line":32,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:48.926259+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000017","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Write the demo config","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000017","task_action":"ansible.builtin.template","resolved_action":"ansible.builtin.template","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:2","role":"demo","host":"node-1.example.com","uuid":"93a3fe34-e17e-413e-9ce8-7cccbea10277"}} +{"uuid":"1cb7994a-ce32-4317-905a-064283021a5e","counter":34,"stdout":"\u001b[0;31m--- before: /srv/example/demo.yaml\u001b[0m\r\n\u001b[0;31m\u001b[0m\u001b[0;32m+++ after: /root/.ansible/tmp/ansible-local-677835lh714kq3/tmpk9ckrc13/demo.yaml.j2\u001b[0m\r\n\u001b[0;32m\u001b[0m\u001b[0;36m@@ -1 +1 @@\u001b[0m\r\n\u001b[0;36m\u001b[0m\u001b[0;31m-value: 41\u001b[0m\r\n\u001b[0;31m\u001b[0m\u001b[0;32m+value: 42\u001b[0m\r\n\u001b[0;32m\u001b[0m","start_line":32,"end_line":38,"runner_ident":"site_color","event":"runner_on_file_diff","pid":677835,"created":"2026-11-13T06:58:49.461790+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000017","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Write the demo config","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000017","task_action":"ansible.builtin.template","resolved_action":"ansible.builtin.template","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:2","role":"demo","host":"node-1.example.com","diff":[{"before_header":"/srv/example/demo.yaml","before":"value: 41\n","after_header":"/root/.ansible/tmp/ansible-local-677835lh714kq3/tmpk9ckrc13/demo.yaml.j2","after":"value: 42\n"}],"uuid":"1cb7994a-ce32-4317-905a-064283021a5e"}} +{"uuid":"65d5e348-1015-4d8f-8ab2-fba78f122bcc","counter":35,"stdout":"\u001b[0;33mchanged: [node-1.example.com] => {\"changed\": true}\u001b[0m","start_line":38,"end_line":39,"runner_ident":"site_color","event":"runner_on_ok","pid":677835,"created":"2026-11-13T06:58:49.462608+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000017","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Write the demo config","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000017","task_action":"ansible.builtin.template","resolved_action":"ansible.builtin.template","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:2","role":"demo","host":"node-1.example.com","remote_addr":"node-1.example.com","res":{"changed":true,"diff":[{"before_header":"/srv/example/demo.yaml","before":"value: 41\n","after_header":"/root/.ansible/tmp/ansible-local-677835lh714kq3/tmpk9ckrc13/demo.yaml.j2","after":"value: 42\n"}],"invocation":{"dest":"/srv/example/demo.yaml","mode":"0644","src":"/root/.ansible/tmp/ansible-local-677835lh714kq3/tmpk9ckrc13/demo.yaml.j2","follow":false,"module_args":{"dest":"/srv/example/demo.yaml","mode":"0644","src":"/root/.ansible/tmp/ansible-local-677835lh714kq3/tmpk9ckrc13/demo.yaml.j2","follow":false}}},"start":"2026-11-13T06:58:48.926221+00:00","end":"2026-11-13T06:58:49.462509+00:00","duration":0.536288,"event_loop":null,"uuid":"65d5e348-1015-4d8f-8ab2-fba78f122bcc"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-000000000018","counter":36,"stdout":"\r\nTASK [demo : Write the demo token with the diff hidden] ************************","start_line":39,"end_line":41,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:49.464715+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Write the demo token with the diff hidden","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000018","task_action":"ansible.builtin.copy","resolved_action":"ansible.builtin.copy","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:9","role":"demo","name":"demo : Write the demo token with the diff hidden","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-000000000018"}} +{"uuid":"d53b46d2-4ce6-4375-9d72-37fc91f2db2e","counter":37,"stdout":"","start_line":41,"end_line":41,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:49.465329+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000018","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Write the demo token with the diff hidden","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000018","task_action":"ansible.builtin.copy","resolved_action":"ansible.builtin.copy","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:9","role":"demo","host":"node-1.example.com","uuid":"d53b46d2-4ce6-4375-9d72-37fc91f2db2e"}} +{"uuid":"98116f69-1bf8-4cfe-9142-7dfb5079ffee","counter":38,"stdout":"","start_line":41,"end_line":41,"runner_ident":"site_color","event":"runner_on_file_diff","pid":677835,"created":"2026-11-13T06:58:49.657226+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000018","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Write the demo token with the diff hidden","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000018","task_action":"ansible.builtin.copy","resolved_action":"ansible.builtin.copy","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:9","role":"demo","host":"node-1.example.com","diff":[],"uuid":"98116f69-1bf8-4cfe-9142-7dfb5079ffee"}} +{"uuid":"cf93a1a0-92db-45f6-b1fb-171e1f1a8bfa","counter":39,"stdout":"\u001b[0;33mchanged: [node-1.example.com] => {\"changed\": true}\u001b[0m","start_line":41,"end_line":42,"runner_ident":"site_color","event":"runner_on_ok","pid":677835,"created":"2026-11-13T06:58:49.657836+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000018","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Write the demo token with the diff hidden","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000018","task_action":"ansible.builtin.copy","resolved_action":"ansible.builtin.copy","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:9","role":"demo","host":"node-1.example.com","remote_addr":"node-1.example.com","res":{"changed":true,"diff":[],"invocation":{"content":"CENSORED: content is a no_log parameter","dest":"/srv/example/demo-token","mode":"0600","module_args":{"content":"VALUE_SPECIFIED_IN_NO_LOG_PARAMETER","dest":"/srv/example/demo-token","mode":"0600"}}},"start":"2026-11-13T06:58:49.465292+00:00","end":"2026-11-13T06:58:49.657670+00:00","duration":0.192378,"event_loop":null,"uuid":"cf93a1a0-92db-45f6-b1fb-171e1f1a8bfa"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-000000000019","counter":40,"stdout":"\r\nTASK [demo : Write the demo secret with no log] ********************************","start_line":42,"end_line":44,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:49.660174+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Write the demo secret with no log","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000019","task_action":"ansible.builtin.copy","resolved_action":"ansible.builtin.copy","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:16","role":"demo","name":"demo : Write the demo secret with no log","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-000000000019"}} +{"uuid":"65458a41-9220-4ff2-835c-70a10e6a256e","counter":41,"stdout":"","start_line":44,"end_line":44,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:49.660902+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000019","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Write the demo secret with no log","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000019","task_action":"ansible.builtin.copy","resolved_action":"ansible.builtin.copy","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:16","role":"demo","host":"node-1.example.com","uuid":"65458a41-9220-4ff2-835c-70a10e6a256e"}} +{"uuid":"d3f89bba-396f-45c9-b178-05f39a563c4f","counter":42,"stdout":"","start_line":44,"end_line":44,"runner_ident":"site_color","event":"runner_on_file_diff","pid":677835,"created":"2026-11-13T06:58:50.054336+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000019","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Write the demo secret with no log","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000019","task_action":"ansible.builtin.copy","resolved_action":"ansible.builtin.copy","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:16","role":"demo","host":"node-1.example.com","diff":null,"uuid":"d3f89bba-396f-45c9-b178-05f39a563c4f"}} +{"uuid":"f43136bb-2d20-440f-b074-5d71f338248b","counter":43,"stdout":"\u001b[0;33mchanged: [node-1.example.com] => {\"censored\": \"the output has been hidden due to the fact that 'no_log: true' was specified for this result\", \"changed\": true}\u001b[0m","start_line":44,"end_line":45,"runner_ident":"site_color","event":"runner_on_ok","pid":677835,"created":"2026-11-13T06:58:50.055139+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000019","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Write the demo secret with no log","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000019","task_action":"ansible.builtin.copy","resolved_action":"ansible.builtin.copy","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:16","role":"demo","host":"node-1.example.com","remote_addr":"node-1.example.com","res":{"censored":"the output has been hidden due to the fact that 'no_log: true' was specified for this result"},"start":"2026-11-13T06:58:49.660857+00:00","end":"2026-11-13T06:58:50.054960+00:00","duration":0.394103,"event_loop":null,"uuid":"f43136bb-2d20-440f-b074-5d71f338248b"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-00000000001a","counter":44,"stdout":"\r\nTASK [demo : Load the demo module] *********************************************","start_line":45,"end_line":47,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:50.057387+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Load the demo module","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001a","task_action":"ansible.builtin.command","resolved_action":"ansible.builtin.command","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:23","role":"demo","name":"demo : Load the demo module","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-00000000001a"}} +{"uuid":"aa364639-0efb-4bac-a982-e1a3875f59e8","counter":45,"stdout":"","start_line":47,"end_line":47,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:50.058078+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001a","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Load the demo module","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001a","task_action":"ansible.builtin.command","resolved_action":"ansible.builtin.command","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:23","role":"demo","host":"node-1.example.com","uuid":"aa364639-0efb-4bac-a982-e1a3875f59e8"}} +{"uuid":"602bad5d-fa25-497c-ba27-793177fb7901","counter":46,"stdout":"\u001b[0;36mskipping: [node-1.example.com] => {\"changed\": false, \"cmd\": [\"/bin/true\"], \"delta\": null, \"end\": null, \"msg\": \"Command would have run if not in check mode\", \"rc\": 0, \"start\": null, \"stderr\": \"\", \"stderr_lines\": [], \"stdout\": \"\", \"stdout_lines\": []}\u001b[0m","start_line":47,"end_line":48,"runner_ident":"site_color","event":"runner_on_skipped","pid":677835,"created":"2026-11-13T06:58:50.347513+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001a","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Load the demo module","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001a","task_action":"ansible.builtin.command","resolved_action":"ansible.builtin.command","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:23","role":"demo","host":"node-1.example.com","remote_addr":"node-1.example.com","start":"2026-11-13T06:58:50.058034+00:00","end":"2026-11-13T06:58:50.347353+00:00","duration":0.289319,"event_loop":null,"uuid":"602bad5d-fa25-497c-ba27-793177fb7901"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-00000000001b","counter":47,"stdout":"\r\nTASK [demo : Remove the old demo unit] *****************************************","start_line":48,"end_line":50,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:50.349862+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Remove the old demo unit","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001b","task_action":"ansible.builtin.command","resolved_action":"ansible.builtin.command","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:27","role":"demo","name":"demo : Remove the old demo unit","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-00000000001b"}} +{"uuid":"78f098ba-5f58-4edd-b393-a3247d0c36da","counter":48,"stdout":"","start_line":50,"end_line":50,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:50.350563+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001b","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Remove the old demo unit","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001b","task_action":"ansible.builtin.command","resolved_action":"ansible.builtin.command","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:27","role":"demo","host":"node-1.example.com","uuid":"78f098ba-5f58-4edd-b393-a3247d0c36da"}} +{"uuid":"56d6776f-0a85-4d16-af63-ab9a8c654583","counter":49,"stdout":"\u001b[0;36mskipping: [node-1.example.com] => {\"changed\": false, \"false_condition\": false, \"skip_reason\": \"Conditional result was False\"}\u001b[0m","start_line":50,"end_line":51,"runner_ident":"site_color","event":"runner_on_skipped","pid":677835,"created":"2026-11-13T06:58:50.356954+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001b","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Remove the old demo unit","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001b","task_action":"ansible.builtin.command","resolved_action":"ansible.builtin.command","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:27","role":"demo","host":"node-1.example.com","remote_addr":"node-1.example.com","start":"2026-11-13T06:58:50.350527+00:00","end":"2026-11-13T06:58:50.356866+00:00","duration":0.006339,"event_loop":null,"uuid":"56d6776f-0a85-4d16-af63-ab9a8c654583"}} +{"uuid":"d449761e-3c37-4d69-b32f-c4cf6c0ada14","counter":50,"stdout":"","start_line":51,"end_line":51,"runner_ident":"site_color","event":"playbook_on_notify","pid":677835,"created":"2026-11-13T06:58:50.359251+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001b","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Remove the old demo unit","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001b","task_action":"ansible.builtin.command","resolved_action":"ansible.builtin.command","task_args":"","task_path":"{project}/ansible/roles/demo/tasks/main.yaml:27","role":"demo","host":"node-1.example.com","handler":"demo : Restart the demo unit","uuid":"d449761e-3c37-4d69-b32f-c4cf6c0ada14"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-00000000001d","counter":51,"stdout":"\r\nRUNNING HANDLER [demo : Restart the demo unit] *********************************","start_line":51,"end_line":53,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:50.360017+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Restart the demo unit","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001d","task_action":"ansible.builtin.systemd_service","resolved_action":"ansible.builtin.systemd_service","task_args":"","task_path":"{project}/ansible/roles/demo/handlers/main.yaml:2","role":"demo","name":"demo : Restart the demo unit","uuid":"9ea46fc1-9c65-2b37-55e9-00000000001d","is_conditional":true}} +{"uuid":"65be0a83-7ec5-40c3-8a0d-10db79fbe75c","counter":52,"stdout":"","start_line":53,"end_line":53,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:50.360584+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001d","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Restart the demo unit","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001d","task_action":"ansible.builtin.systemd_service","resolved_action":"ansible.builtin.systemd_service","task_args":"","task_path":"{project}/ansible/roles/demo/handlers/main.yaml:2","role":"demo","host":"node-1.example.com","uuid":"65be0a83-7ec5-40c3-8a0d-10db79fbe75c"}} +{"uuid":"5e3eec13-bf22-4a6f-8e85-8e01018b66f1","counter":53,"stdout":"\u001b[0;33mchanged: [node-1.example.com] => {\"changed\": true, \"name\": \"demo\", \"state\": \"started\", \"status\": {\"ActiveState\": \"active\", \"Id\": \"demo.service\", \"LoadState\": \"loaded\", \"Names\": \"demo.service\", \"SubState\": \"running\", \"UnitFileState\": \"enabled\"}}\u001b[0m","start_line":53,"end_line":54,"runner_ident":"site_color","event":"runner_on_ok","pid":677835,"created":"2026-11-13T06:58:50.773999+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001d","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Configure the demo unit","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000012","play_pattern":"demo","task":"Restart the demo unit","task_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001d","task_action":"ansible.builtin.systemd_service","resolved_action":"ansible.builtin.systemd_service","task_args":"","task_path":"{project}/ansible/roles/demo/handlers/main.yaml:2","role":"demo","host":"node-1.example.com","remote_addr":"node-1.example.com","res":{"changed":true,"name":"demo","status":{"Id":"demo.service","Names":"demo.service","LoadState":"loaded","ActiveState":"active","SubState":"running","UnitFileState":"enabled"},"state":"started","invocation":{"module_args":{"name":"demo","state":"restarted","daemon_reload":false,"daemon_reexec":false,"scope":"system","no_block":false,"enabled":null,"force":null,"masked":null}}},"start":"2026-11-13T06:58:50.360547+00:00","end":"2026-11-13T06:58:50.773203+00:00","duration":0.412656,"event_loop":null,"uuid":"5e3eec13-bf22-4a6f-8e85-8e01018b66f1"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-00000000001e","counter":54,"stdout":"\r\nPLAY [Reboot the node] *********************************************************","start_line":54,"end_line":56,"runner_ident":"site_color","event":"playbook_on_play_start","pid":677835,"created":"2026-11-13T06:58:50.776756+00:00","parent_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Reboot the node","play_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001e","play_pattern":"reboot","name":"Reboot the node","pattern":"reboot","uuid":"9ea46fc1-9c65-2b37-55e9-00000000001e"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-000000000020","counter":55,"stdout":"\r\nTASK [Reboot the host] *********************************************************","start_line":56,"end_line":58,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:50.780006+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001e","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Reboot the node","play_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001e","play_pattern":"reboot","task":"Reboot the host","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000020","task_action":"ansible.builtin.reboot","resolved_action":"ansible.builtin.reboot","task_args":"","task_path":"{project}/ansible/playbooks/site.yaml:22","name":"Reboot the host","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-000000000020"}} +{"uuid":"9d4090e2-5adb-4cd4-844c-c36ae3ab1843","counter":56,"stdout":"","start_line":58,"end_line":58,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:50.780555+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000020","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Reboot the node","play_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001e","play_pattern":"reboot","task":"Reboot the host","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000020","task_action":"ansible.builtin.reboot","resolved_action":"ansible.builtin.reboot","task_args":"","task_path":"{project}/ansible/playbooks/site.yaml:22","host":"node-2.example.com","uuid":"9d4090e2-5adb-4cd4-844c-c36ae3ab1843"}} +{"uuid":"a8c91f6a-d62b-40f4-a116-b7132c8bf8e6","counter":57,"stdout":"\u001b[0;33mchanged: [node-2.example.com] => {\"changed\": true, \"elapsed\": 0, \"rebooted\": true}\u001b[0m","start_line":58,"end_line":59,"runner_ident":"site_color","event":"runner_on_ok","pid":677835,"created":"2026-11-13T06:58:50.791829+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000020","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Reboot the node","play_uuid":"9ea46fc1-9c65-2b37-55e9-00000000001e","play_pattern":"reboot","task":"Reboot the host","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000020","task_action":"ansible.builtin.reboot","resolved_action":"ansible.builtin.reboot","task_args":"","task_path":"{project}/ansible/playbooks/site.yaml:22","host":"node-2.example.com","remote_addr":"node-2.example.com","res":{"changed":true,"elapsed":0,"rebooted":true},"start":"2026-11-13T06:58:50.780513+00:00","end":"2026-11-13T06:58:50.791541+00:00","duration":0.011028,"event_loop":null,"uuid":"a8c91f6a-d62b-40f4-a116-b7132c8bf8e6"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-000000000021","counter":58,"stdout":"\r\nPLAY [Run a task that fails] ***************************************************","start_line":59,"end_line":61,"runner_ident":"site_color","event":"playbook_on_play_start","pid":677835,"created":"2026-11-13T06:58:50.793870+00:00","parent_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Run a task that fails","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000021","play_pattern":"failing","name":"Run a task that fails","pattern":"failing","uuid":"9ea46fc1-9c65-2b37-55e9-000000000021"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-000000000023","counter":59,"stdout":"\r\nTASK [Write the failing config] ************************************************","start_line":61,"end_line":63,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:50.795987+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000021","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Run a task that fails","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000021","play_pattern":"failing","task":"Write the failing config","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000023","task_action":"ansible.builtin.copy","resolved_action":"ansible.builtin.copy","task_args":"","task_path":"{project}/ansible/playbooks/site.yaml:30","name":"Write the failing config","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-000000000023"}} +{"uuid":"40217f7f-0e2f-4bd8-9c27-b8de5ad23568","counter":60,"stdout":"","start_line":63,"end_line":63,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:50.796465+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000023","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Run a task that fails","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000021","play_pattern":"failing","task":"Write the failing config","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000023","task_action":"ansible.builtin.copy","resolved_action":"ansible.builtin.copy","task_args":"","task_path":"{project}/ansible/playbooks/site.yaml:30","host":"node-4.example.com","uuid":"40217f7f-0e2f-4bd8-9c27-b8de5ad23568"}} +{"uuid":"0623c06a-554b-4faf-a1db-64bac49811c7","counter":61,"stdout":"\u001b[0;31m--- before\u001b[0m\r\n\u001b[0;31m\u001b[0m\u001b[0;32m+++ after: /srv/example/failing.yaml\u001b[0m\r\n\u001b[0;32m\u001b[0m\u001b[0;36m@@ -0,0 +1 @@\u001b[0m\r\n\u001b[0;36m\u001b[0m\u001b[0;32m+value: 1\u001b[0m\r\n\u001b[0;32m\u001b[0m","start_line":63,"end_line":68,"runner_ident":"site_color","event":"runner_on_file_diff","pid":677835,"created":"2026-11-13T06:58:51.161636+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000023","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Run a task that fails","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000021","play_pattern":"failing","task":"Write the failing config","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000023","task_action":"ansible.builtin.copy","resolved_action":"ansible.builtin.copy","task_args":"","task_path":"{project}/ansible/playbooks/site.yaml:30","host":"node-4.example.com","diff":[{"before":"","after_header":"/srv/example/failing.yaml","after":"value: 1\n"}],"uuid":"0623c06a-554b-4faf-a1db-64bac49811c7"}} +{"uuid":"a56a862e-9684-4653-81f9-a181538a94dd","counter":62,"stdout":"\u001b[0;33mchanged: [node-4.example.com] => {\"changed\": true}\u001b[0m","start_line":68,"end_line":69,"runner_ident":"site_color","event":"runner_on_ok","pid":677835,"created":"2026-11-13T06:58:51.162484+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000023","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Run a task that fails","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000021","play_pattern":"failing","task":"Write the failing config","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000023","task_action":"ansible.builtin.copy","resolved_action":"ansible.builtin.copy","task_args":"","task_path":"{project}/ansible/playbooks/site.yaml:30","host":"node-4.example.com","remote_addr":"node-4.example.com","res":{"changed":true,"diff":[{"before":"","after_header":"/srv/example/failing.yaml","after":"value: 1\n"}],"invocation":{"content":"CENSORED: content is a no_log parameter","dest":"/srv/example/failing.yaml","mode":"0644","module_args":{"content":"VALUE_SPECIFIED_IN_NO_LOG_PARAMETER","dest":"/srv/example/failing.yaml","mode":"0644"}}},"start":"2026-11-13T06:58:50.796428+00:00","end":"2026-11-13T06:58:51.162317+00:00","duration":0.365889,"event_loop":null,"uuid":"a56a862e-9684-4653-81f9-a181538a94dd"}} +{"uuid":"9ea46fc1-9c65-2b37-55e9-000000000024","counter":63,"stdout":"\r\nTASK [Read the cluster state] **************************************************","start_line":69,"end_line":71,"runner_ident":"site_color","event":"playbook_on_task_start","pid":677835,"created":"2026-11-13T06:58:51.164200+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000021","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Run a task that fails","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000021","play_pattern":"failing","task":"Read the cluster state","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000024","task_action":"ansible.builtin.command","resolved_action":"ansible.builtin.command","task_args":"","task_path":"{project}/ansible/playbooks/site.yaml:35","name":"Read the cluster state","is_conditional":false,"uuid":"9ea46fc1-9c65-2b37-55e9-000000000024"}} +{"uuid":"95ab37d7-3d0a-4a3d-9485-13d1f73a780b","counter":64,"stdout":"","start_line":71,"end_line":71,"runner_ident":"site_color","event":"runner_on_start","pid":677835,"created":"2026-11-13T06:58:51.164837+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000024","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Run a task that fails","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000021","play_pattern":"failing","task":"Read the cluster state","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000024","task_action":"ansible.builtin.command","resolved_action":"ansible.builtin.command","task_args":"","task_path":"{project}/ansible/playbooks/site.yaml:35","host":"node-4.example.com","uuid":"95ab37d7-3d0a-4a3d-9485-13d1f73a780b"}} +{"uuid":"779cea3b-797d-4b6d-922a-230233dcdc10","counter":65,"stdout":"\u001b[0;31m[ERROR]: Task failed: Module failed: The command exited with a non-zero return code.\u001b[0m\r\n\u001b[0;31mOrigin: {project}/ansible/playbooks/site.yaml:35:7\u001b[0m\r\n\u001b[0;31m\u001b[0m\r\n\u001b[0;31m33 dest: \"{{ state_dir }}/failing.yaml\"\u001b[0m\r\n\u001b[0;31m34 mode: \"0644\"\u001b[0m\r\n\u001b[0;31m35 - name: Read the cluster state\u001b[0m\r\n\u001b[0;31m ^ column 7\u001b[0m\r\n\u001b[0;31m\u001b[0m\r\n\u001b[0;31mfatal: [node-4.example.com]: FAILED! => {\"changed\": false, \"changed_when_result\": false, \"cmd\": [\"/bin/false\"], \"delta\": \"0:00:00.002189\", \"end\": \"2026-11-13 06:58:51.350006\", \"msg\": \"The command exited with a non-zero return code.\", \"rc\": 1, \"start\": \"2026-11-13 06:58:51.347817\", \"stderr\": \"\", \"stderr_lines\": [], \"stdout\": \"\", \"stdout_lines\": []}\u001b[0m","start_line":71,"end_line":80,"runner_ident":"site_color","event":"runner_on_failed","pid":677835,"created":"2026-11-13T06:58:51.374297+00:00","parent_uuid":"9ea46fc1-9c65-2b37-55e9-000000000024","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","play":"Run a task that fails","play_uuid":"9ea46fc1-9c65-2b37-55e9-000000000021","play_pattern":"failing","task":"Read the cluster state","task_uuid":"9ea46fc1-9c65-2b37-55e9-000000000024","task_action":"ansible.builtin.command","resolved_action":"ansible.builtin.command","task_args":"","task_path":"{project}/ansible/playbooks/site.yaml:35","host":"node-4.example.com","remote_addr":"node-4.example.com","res":{"changed":false,"exception":"(traceback unavailable)","msg":"The command exited with a non-zero return code.","rc":1,"changed_when_result":false,"stdout":"","stderr":"","cmd":["/bin/false"],"start":"2026-11-13 06:58:51.347817","end":"2026-11-13 06:58:51.350006","delta":"0:00:00.002189","invocation":{"module_args":{"_raw_params":"/bin/false","_uses_shell":false,"expand_argument_vars":true,"stdin_add_newline":true,"strip_empty_ends":true,"cmd":null,"argv":null,"chdir":null,"executable":null,"creates":null,"removes":null,"stdin":null}},"stdout_lines":[],"stderr_lines":[]},"start":"2026-11-13T06:58:51.164796+00:00","end":"2026-11-13T06:58:51.373614+00:00","duration":0.208818,"ignore_errors":false,"event_loop":null,"uuid":"779cea3b-797d-4b6d-922a-230233dcdc10"}} +{"uuid":"0b0cf7f8-d4bd-4cf4-a430-90eb9dfdd2e4","counter":66,"stdout":"\r\nPLAY RECAP *********************************************************************\r\n\u001b[0;33mnode-1.example.com\u001b[0m : \u001b[0;32mok=4 \u001b[0m \u001b[0;33mchanged=4 \u001b[0m unreachable=0 failed=0 \u001b[0;36mskipped=2 \u001b[0m rescued=0 ignored=0 \r\n\u001b[0;33mnode-2.example.com\u001b[0m : \u001b[0;32mok=1 \u001b[0m \u001b[0;33mchanged=1 \u001b[0m unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 \r\n\u001b[0;33mnode-3.example.com\u001b[0m : \u001b[0;32mok=7 \u001b[0m \u001b[0;33mchanged=2 \u001b[0m unreachable=0 failed=0 \u001b[0;36mskipped=1 \u001b[0m rescued=0 ignored=0 \r\n\u001b[0;31mnode-4.example.com\u001b[0m : \u001b[0;32mok=1 \u001b[0m \u001b[0;33mchanged=1 \u001b[0m unreachable=0 \u001b[0;31mfailed=1 \u001b[0m skipped=0 rescued=0 ignored=0 ","start_line":80,"end_line":87,"runner_ident":"site_color","event":"playbook_on_stats","pid":677835,"created":"2026-11-13T06:58:51.375711+00:00","parent_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","event_data":{"playbook":"ansible/playbooks/site.yaml","playbook_uuid":"3dc72d1f-7023-4d6d-aa0c-642f5cbb1d11","changed":{"node-3.example.com":2,"node-1.example.com":4,"node-2.example.com":1,"node-4.example.com":1},"dark":{},"failures":{"node-4.example.com":1},"ignored":{},"ok":{"node-3.example.com":7,"node-1.example.com":4,"node-2.example.com":1,"node-4.example.com":1},"processed":{"node-3.example.com":1,"node-1.example.com":1,"node-2.example.com":1,"node-4.example.com":1},"rescued":{},"skipped":{"node-3.example.com":1,"node-1.example.com":2},"artifact_data":{},"uuid":"0b0cf7f8-d4bd-4cf4-a430-90eb9dfdd2e4"}} diff --git a/tests/infra/test_plan.py b/tests/infra/test_plan.py index 08f73a47af..3bea044112 100644 --- a/tests/infra/test_plan.py +++ b/tests/infra/test_plan.py @@ -104,6 +104,27 @@ def test_each_change_skip_and_handler_of_a_host_is_in_the_plan(tmp_path: Path) - ) +def test_a_skip_result_in_color_stays_unchecked(tmp_path: Path) -> None: + """In a color terminal the callback puts color codes around the text of each skip, so the + result after `=> ` does not read as JSON, and a skip by a false `when` is unchecked: the safe + side. The run turns the color off (#5352), so a plan does not read such a skip.""" + remove_unit = PlanTask( + name="Remove the old demo unit", path=f"{_DEMO}:27", action="ansible.builtin.command" + ) + install_agent = PlanTask( + name="Download and execute K3s agent installation script", + path=f"{_K3S_AGENT}:31", + action="ansible.builtin.shell", + ) + added = {"node-1.example.com": (remove_unit,), "node-3.example.com": (install_agent,)} + plain = _hosts("site", tmp_path) + + assert _hosts("site_color", tmp_path) == { + host: plan.model_copy(update={"unchecked": plan.unchecked + added.get(host, ())}) + for host, plan in plain.items() + } + + def test_a_reboot_task_is_disruptive(tmp_path: Path) -> None: assert _hosts("site", tmp_path)["node-2.example.com"] == HostPlan( host="node-2.example.com", diff --git a/tests/support/infra.py b/tests/support/infra.py index 79a4af1f44..8ef3db5da0 100644 --- a/tests/support/infra.py +++ b/tests/support/infra.py @@ -31,6 +31,12 @@ Then put `{project}` in place of `/project`, `/srv/example` in place of `/state`, and `/root` in place of the home folder and its user. +`site_color` is the run `site` in a color terminal before #5352 (`--limit all:!offline`, exit code 2, +status `failed`): record it as above with `TERM=xterm-256color` and with no `ANSIBLE_NOCOLOR` in the +environment of `runner_env`. ansible-runner gives the run a pseudo-terminal, so the default +callback puts color codes around the text of each event. `terminal_events` answers a run with this +recording when the environment of the run is the environment of the recording. + An apply (#5125) runs the playbook on a few hosts at a time. `answer_runs` answers each run with the recorded events of `site` of the hosts of its `--limit` only (`site_events`), with no failure, and `FakeCluster` answers `kubectl` from a set of nodes: the reads, the drain check, the drain and @@ -50,6 +56,7 @@ import pytest +from devops_cli.core.process import build_subprocess_env from devops_cli.tools_lock import load_tools_lock, tool_install_dir from tests.support.fakes.process import ProcessAnswer, ProcessCall, ProcessFake from tests.support.paths import FIXTURES @@ -61,7 +68,11 @@ RECORDED_RUNS: Final[dict[str, tuple[int, str]]] = { "agent": (0, "successful"), "site": (2, "failed"), + "site_color": (2, "failed"), } +# The `TERM` of the recorded run `site_color`: a color terminal. +COLOR_TERM: Final[str] = "xterm-256color" +_NOCOLOR: Final[str] = "ANSIBLE_NOCOLOR" _PROJECT_MARK: Final[str] = "{project}" INFRA_REPO_SHAPE: Final[Path] = INFRA_FIXTURES / "homelab_shape" KUBE_CONTEXT: Final[str] = "homelab-example" @@ -250,17 +261,30 @@ def ssh_key_dir(tmp_path: Path) -> Path: return key_dir -def site_events(project: Path, hosts: Collection[str]) -> list[dict[str, Any]]: - """The job events of the recorded run `site` of `hosts` only, without the failed task of - node-4, so the run ends successful.""" +def site_events(project: Path, hosts: Collection[str], run: str = "site") -> list[dict[str, Any]]: + """The job events of the recorded run `run` of all hosts (`site` or `site_color`) of `hosts` + only, without the failed task of node-4, so the run ends successful.""" events = [] - for event in recorded_events("site", project): + for event in recorded_events(run, project): host = (event.get("event_data") or {}).get("host") if event["event"] != "runner_on_failed" and (host is None or host in hosts): events.append(event) return events +def terminal_events(call: ProcessCall, project: Path) -> list[dict[str, Any]]: + """The job events of the hosts of the limit of `call` as the terminal of the run gives them: + the recorded run `site_color` when the environment of the run is the environment of that + recording (the `TERM` of a color terminal and no `ANSIBLE_NOCOLOR`), else the run `site`. The + environment is the one that the process runner gives the child, with the `TERM` of the + person.""" + env = build_subprocess_env( + call.env, isolate_env=call.isolate_env, extra_allowed_keys=call.extra_allowed_env + ) + color = env.get("TERM") == COLOR_TERM and _NOCOLOR not in env + return site_events(project, limit_hosts(call), "site_color" if color else "site") + + def limit_hosts(call: ProcessCall) -> tuple[str, ...]: """The hosts of the `--limit` of an `ansible-runner run`, before `:!`.""" pattern = call.argv[call.argv.index("--limit") + 1] From 45d446fde4cfb3c0821e43ed3a7711f2c1d075f8 Mon Sep 17 00:00:00 2001 From: Daniel Petty Date: Fri, 13 Nov 2026 07:24:03 +0000 Subject: [PATCH 2/3] fix(infra): turn off the forced color of a repo ansible.cfg too ansible/utils/color.py applies ANSIBLE_FORCE_COLOR after ANSIBLE_NOCOLOR. A repo whose ansible.cfg sets force_color thus got color codes in each event with ANSIBLE_NOCOLOR only, and the plan counted each skip by a false when as unchecked. The run now also gets ANSIBLE_FORCE_COLOR=False, which replaces the setting of ansible.cfg. --- openspec/changes/5352-infra-plan-no-color/design.md | 8 ++------ openspec/changes/5352-infra-plan-no-color/proposal.md | 5 +++-- .../5352-infra-plan-no-color/specs/infra-plan/spec.md | 6 +++--- openspec/changes/5352-infra-plan-no-color/tasks.md | 2 ++ src/devops_cli/infra/plan.py | 10 ++++++---- tests/commands/test_infra_apply.py | 4 +++- tests/commands/test_infra_plan.py | 2 ++ 7 files changed, 21 insertions(+), 16 deletions(-) diff --git a/openspec/changes/5352-infra-plan-no-color/design.md b/openspec/changes/5352-infra-plan-no-color/design.md index 8ea8aa60fc..bf680e0f03 100644 --- a/openspec/changes/5352-infra-plan-no-color/design.md +++ b/openspec/changes/5352-infra-plan-no-color/design.md @@ -2,10 +2,10 @@ ## Decisions -- `_PLAN_ENV` holds `ANSIBLE_NOCOLOR=True`. `runner_env` adds `_PLAN_ENV` after the allowlist of the process runner, so every run of `Playbook.run` gets it: the plan, the fresh check and the run of an apply. The status ping (`ping_env`) parses no skip result and does not change. +- `_PLAN_ENV` holds `ANSIBLE_NOCOLOR=True` and `ANSIBLE_FORCE_COLOR=False`. `ansible/utils/color.py` applies `ANSIBLE_FORCE_COLOR` after `ANSIBLE_NOCOLOR`, so `ANSIBLE_NOCOLOR` alone does not turn off the color of a repo whose `ansible.cfg` sets `force_color`. The environment variable replaces that setting of `ansible.cfg`, as `ANSIBLE_CALLBACK_RESULT_FORMAT` replaces `result_format`. `runner_env` adds `_PLAN_ENV` after the allowlist of the process runner, so every run of `Playbook.run` gets it: the plan, the fresh check and the run of an apply. The status ping (`ping_env`) parses no skip result and does not change. - `_is_check_mode_skip` does not change. A skip result that does not read as JSON stays unchecked: the safe side. - The tests use a real recording. `tests/fixtures/infra/runner_events/site_color.jsonl` holds the job events of the run `site` of the probe again, with `TERM=xterm-256color` and no `ANSIBLE_NOCOLOR`, as a color terminal gave them before this change. The answer of the fake `ansible-runner` (`terminal_events` in `tests/support/infra.py`) gives that recording to a run whose environment is the environment of the recording, and the recording `site` to every other run. It reads the environment of the run with `build_subprocess_env`, the function that the process runner uses, so the `TERM` of the person reaches the decision as it reaches the real run. -- Acceptance criterion 1 of the issue asks for the same plan "with and without the color codes in `stdout`". The proposed fix of the issue removes the color codes and keeps the safe side for a result that does not read. Thus the test of the plan reader shows that a skip in color stays unchecked, and the test of the apply shows that a plan with no `TERM` and its apply with `TERM=xterm-256color` get the same plan (criteria 1 and 3). The tests of the plan run and of the apply runs find `ANSIBLE_NOCOLOR=True` in the environment of each `ansible-runner` run (criterion 2). +- Acceptance criterion 1 of the issue asks for the same plan "with and without the color codes in `stdout`". The proposed fix of the issue removes the color codes and keeps the safe side for a result that does not read. Thus the test of the plan reader shows that a skip in color stays unchecked, and the test of the apply shows that a plan with no `TERM` and its apply with `TERM=xterm-256color` get the same plan (criteria 1 and 3). The tests of the plan run and of the apply runs find `ANSIBLE_NOCOLOR=True` and `ANSIBLE_FORCE_COLOR=False` in the environment of each `ansible-runner` run (criterion 2). ## Rejected alternatives @@ -13,7 +13,3 @@ - **Set `ANSIBLE_NOCOLOR` in the environment of the caller.** The process runner drops it: `DEFAULT_ALLOWED_ENV_VARS` holds `TERM` and `COLORTERM`, and no allowed name or prefix matches an `ANSIBLE_` variable. The second apply of the owner with `ANSIBLE_NOCOLOR=1` stopped the same way. - **Remove `TERM` and `COLORTERM` from the environment of the run.** The allowlist of the process runner is shared by every child. A removal for one caller needs a new option of the process runner, and Ansible has its own setting for this. - **Read the skip result from the event data.** ansible-runner 2.4.3 puts no result in the event data of `runner_on_skipped` (`v2_runner_on_skipped` in `awx_display.py`), so the event `stdout` is the only source. - -## Limits - -- `ansible/utils/color.py` applies `ANSIBLE_FORCE_COLOR` after `ANSIBLE_NOCOLOR`. A repo whose `ansible.cfg` sets `force_color` thus gets color in every run. The plan and the fresh check then read the same text in each caller environment and agree, and each skip by a false `when` is unchecked: the safe side. diff --git a/openspec/changes/5352-infra-plan-no-color/proposal.md b/openspec/changes/5352-infra-plan-no-color/proposal.md index da773e1111..2e049294ef 100644 --- a/openspec/changes/5352-infra-plan-no-color/proposal.md +++ b/openspec/changes/5352-infra-plan-no-color/proposal.md @@ -6,7 +6,7 @@ ## What Changes -- Every `ansible-runner` run of a playbook (the plan, the fresh check and the run of an apply) gets `ANSIBLE_NOCOLOR=True` in its environment. The callback then writes the same event text in a color terminal and with no terminal, and the plan of a host is the same in both. +- Every `ansible-runner` run of a playbook (the plan, the fresh check and the run of an apply) gets `ANSIBLE_NOCOLOR=True` and `ANSIBLE_FORCE_COLOR=False` in its environment. `ANSIBLE_FORCE_COLOR=False` replaces a `force_color` of the repo's `ansible.cfg`, as `ANSIBLE_CALLBACK_RESULT_FORMAT` replaces its `result_format`. The callback then writes the same event text in a color terminal and with no terminal, and the plan of a host is the same in both. - A skip result that does not read as JSON stays unchecked, as before. - The change is observable: the plan of a host in a color terminal changes, and `devops infra apply` passes the fresh check that stopped it. Thus it carries a delta of the capability `infra-plan`. @@ -16,7 +16,7 @@ ## Impact -- Code: `src/devops_cli/infra/plan.py` (`_PLAN_ENV`, the docstrings of the module and of `runner_env`). +- Code: `src/devops_cli/infra/plan.py` (`_PLAN_ENV` and its comment, the docstrings of the module and of `runner_env`). - Tests: `tests/infra/test_plan.py`, `tests/commands/test_infra_plan.py`, `tests/commands/test_infra_apply.py`, `tests/support/infra.py`, and the new recorded run `tests/fixtures/infra/runner_events/site_color.jsonl`. - A plan record made in a color terminal before this change can show more unchecked tasks than a fresh check after it. Such a plan stops at the fresh check. Make the plan again. - No setting, command, option or message changes. No manifest changes. The change fits one pull request. @@ -33,6 +33,7 @@ The premise was confirmed against `origin/main` and the pinned tools (ansible-co - With no `TERM`: 0 of 65 events hold an escape code. node-1 has 1 unchecked task and node-3 has none. - With `TERM=xterm-256color`: 21 events hold escape codes, and a skip has the `stdout` `\x1b[0;36mskipping: [node-3.example.com] => {"changed": false, "false_condition": ...}\x1b[0m`. node-1 has 2 unchecked tasks (`Remove the old demo unit` too) and node-3 has 1 (`Download and execute K3s agent installation script`). - With `TERM=xterm-256color` and `ANSIBLE_NOCOLOR=True`: 0 events hold an escape code, and the plan of each host is equal to the plan of the run with no `TERM`. +- `ansible/utils/color.py` applies `ANSIBLE_FORCE_COLOR` after `ANSIBLE_NOCOLOR`, and `force_color` turns color on also with no terminal. An environment variable replaces the same setting of `ansible.cfg`: with `force_color = True` in `ansible.cfg` and `ANSIBLE_FORCE_COLOR=False` in the environment, `ansible-config dump --only-changed` shows `ANSIBLE_FORCE_COLOR(env: ANSIBLE_FORCE_COLOR) = False`. A check-mode run of a playbook with one skip by a false `when`, with `TERM=xterm-256color` and that `ansible.cfg`, gives the skip `stdout` `\x1b[0;36mskipping: [localhost] => {"false_condition": false}\x1b[0m` with `ANSIBLE_NOCOLOR=True` only, and `skipping: [localhost] => {"false_condition": false}` with `ANSIBLE_FORCE_COLOR=False` too. ## Existing Tool Considered diff --git a/openspec/changes/5352-infra-plan-no-color/specs/infra-plan/spec.md b/openspec/changes/5352-infra-plan-no-color/specs/infra-plan/spec.md index 9339ab940f..ea16424893 100644 --- a/openspec/changes/5352-infra-plan-no-color/specs/infra-plan/spec.md +++ b/openspec/changes/5352-infra-plan-no-color/specs/infra-plan/spec.md @@ -1,15 +1,15 @@ ## ADDED Requirements ### Requirement: The run output has no color -Every `ansible-runner` run of a playbook, the plan, the fresh check and the run of an apply, SHALL get `ANSIBLE_NOCOLOR=True` in its environment, so the event text and the plan of a host are the same in a color terminal and with no terminal. A skip result that does not read as JSON, such as a result with color codes, SHALL stay unchecked. +Every `ansible-runner` run of a playbook, the plan, the fresh check and the run of an apply, SHALL get `ANSIBLE_NOCOLOR=True` and `ANSIBLE_FORCE_COLOR=False` in its environment, also when the repo's `ansible.cfg` sets `force_color`, so the event text and the plan of a host are the same in a color terminal and with no terminal. A skip result that does not read as JSON, such as a result with color codes, SHALL stay unchecked. #### Scenario: The environment of the plan run - **WHEN** a person plans `ansible/playbooks/03_k3s.yaml` -- **THEN** `ansible-runner` gets `ANSIBLE_NOCOLOR=True` +- **THEN** `ansible-runner` gets `ANSIBLE_NOCOLOR=True` and `ANSIBLE_FORCE_COLOR=False` #### Scenario: A plan with no terminal and its apply in a color terminal - **WHEN** a person plans node-3 with no `TERM`, and applies the plan with `TERM=xterm-256color` -- **THEN** each `ansible-runner` run gets `ANSIBLE_NOCOLOR=True`, the fresh check of node-3 equals the plan, and the apply exits 0 +- **THEN** each `ansible-runner` run gets `ANSIBLE_NOCOLOR=True` and `ANSIBLE_FORCE_COLOR=False`, the fresh check of node-3 equals the plan, and the apply exits 0 #### Scenario: A skip result in color - **WHEN** the recorded run in a color terminal skips a task of node-1 and a task of node-3 by a false `when`, with the color codes around the text of each skip diff --git a/openspec/changes/5352-infra-plan-no-color/tasks.md b/openspec/changes/5352-infra-plan-no-color/tasks.md index a8ebcdda89..830d38c9cf 100644 --- a/openspec/changes/5352-infra-plan-no-color/tasks.md +++ b/openspec/changes/5352-infra-plan-no-color/tasks.md @@ -12,5 +12,7 @@ Kind: behavior. Reads: `src/devops_cli/infra/plan.py`, `src/devops_cli/core/proc - Verification: `$ uv run devops ci test tests/infra/test_plan.py` passes on the base and after the change - [x] 1.4 Add `ANSIBLE_NOCOLOR=True` to `_PLAN_ENV` in `src/devops_cli/infra/plan.py`, and say why in the docstrings of the module and of `runner_env` - Verification: `$ uv run devops ci test tests/commands/test_infra_plan.py tests/commands/test_infra_apply.py tests/infra/test_plan.py` passes +- [x] 1.5 Expect `ANSIBLE_FORCE_COLOR=False` beside `ANSIBLE_NOCOLOR=True` in the tests of 1.1 and 1.2, then add it to `_PLAN_ENV`, so a `force_color` of the repo's `ansible.cfg` does not turn the color on again + - Verification: `$ uv run devops ci test tests/commands/test_infra_plan.py tests/commands/test_infra_apply.py` fails before the change of `_PLAN_ENV` and passes after it - Pending a person: review the diff in tuicr (tuicr -r origin/main..HEAD). diff --git a/src/devops_cli/infra/plan.py b/src/devops_cli/infra/plan.py index 4803847f84..2f8033bf75 100644 --- a/src/devops_cli/infra/plan.py +++ b/src/devops_cli/infra/plan.py @@ -10,8 +10,8 @@ the environment of the process runner, so no `ANSIBLE_` variable of the person reaches it. The `TERM` of the person reaches it, and ansible-runner gives the run a pseudo-terminal, so in a color terminal the default callback puts color codes around the text of each event. Every run sets -`ANSIBLE_NOCOLOR` (#5352): the event text, and so the plan, is the same in a color terminal and with -no terminal. +`ANSIBLE_NOCOLOR`, and `ANSIBLE_FORCE_COLOR=False` over a `force_color` of the repo's `ansible.cfg` +(#5352): the event text, and so the plan, is the same in a color terminal and with no terminal. The job events (`artifacts//job_events/*.json`) give the plan of each host, with no read of the repo's YAML: @@ -119,13 +119,15 @@ # that changes a file with a secret do not hold its text. _RUN_OPTIONS: Final[tuple[str, ...]] = ("-v",) # What the run adds to the environment of `ping_env`: the rendered arguments in each result, the -# results as JSON, a line for each skipped host, and no color. A skip result in color does not read -# as JSON, and the plan counts it as unchecked (#5352). +# results as JSON, a line for each skipped host, and no color, also when the repo's `ansible.cfg` +# sets `force_color`. A skip result in color does not read as JSON, and the plan counts it as +# unchecked (#5352). _PLAN_ENV: Final[dict[str, str]] = { "ANSIBLE_INJECT_INVOCATION": "True", "ANSIBLE_CALLBACK_RESULT_FORMAT": "json", "ANSIBLE_DISPLAY_SKIPPED_HOSTS": "True", "ANSIBLE_NOCOLOR": "True", + "ANSIBLE_FORCE_COLOR": "False", } _EVENT_OK: Final[str] = "runner_on_ok" diff --git a/tests/commands/test_infra_apply.py b/tests/commands/test_infra_apply.py index 024850d59b..1fe81ffe6d 100644 --- a/tests/commands/test_infra_apply.py +++ b/tests/commands/test_infra_apply.py @@ -255,7 +255,9 @@ def test_a_plan_with_no_terminal_passes_the_fresh_check_of_its_apply_in_a_color_ ] runner = str(lab.bin_dir / "ansible-runner") runs = [call for call in lab.process_fake.calls if call.argv[0] == runner] - assert [(call.env or {}).get("ANSIBLE_NOCOLOR") for call in runs] == ["True"] * 3 + no_color = {"ANSIBLE_NOCOLOR": "True", "ANSIBLE_FORCE_COLOR": "False"} + settings = [{name: (call.env or {}).get(name) for name in no_color} for call in runs] + assert settings == [no_color] * 3 def test_a_task_that_changed_and_is_not_in_the_plan_stops_the_apply( diff --git a/tests/commands/test_infra_plan.py b/tests/commands/test_infra_plan.py index 9c532cd0a1..642950c649 100644 --- a/tests/commands/test_infra_plan.py +++ b/tests/commands/test_infra_plan.py @@ -149,6 +149,7 @@ def test_the_run_is_check_mode_on_the_limit_without_offline_hosts_with_the_key( "ANSIBLE_CALLBACK_RESULT_FORMAT", "ANSIBLE_DISPLAY_SKIPPED_HOSTS", "ANSIBLE_NOCOLOR", + "ANSIBLE_FORCE_COLOR", ) } == { "ANSIBLE_HOST_KEY_CHECKING": "True", @@ -157,6 +158,7 @@ def test_the_run_is_check_mode_on_the_limit_without_offline_hosts_with_the_key( "ANSIBLE_CALLBACK_RESULT_FORMAT": "json", "ANSIBLE_DISPLAY_SKIPPED_HOSTS": "True", "ANSIBLE_NOCOLOR": "True", + "ANSIBLE_FORCE_COLOR": "False", } collections = Path(run.env["ANSIBLE_COLLECTIONS_PATH"]) assert collections.parent == Path(_option(galaxy.argv, "-p")).parent From cec58049336497a65cb10b33174312d27d7d9439 Mon Sep 17 00:00:00 2001 From: Daniel Petty Date: Fri, 13 Nov 2026 07:24:27 +0000 Subject: [PATCH 3/3] chore(openspec): archive 5352-infra-plan-no-color --- .../.openspec.yaml | 0 .../design.md | 0 .../proposal.md | 0 .../specs/infra-plan/spec.md | 0 .../2026-11-13-5352-infra-plan-no-color}/tasks.md | 0 openspec/specs/infra-plan/spec.md | 15 +++++++++++++++ 6 files changed, 15 insertions(+) rename openspec/changes/{5352-infra-plan-no-color => archive/2026-11-13-5352-infra-plan-no-color}/.openspec.yaml (100%) rename openspec/changes/{5352-infra-plan-no-color => archive/2026-11-13-5352-infra-plan-no-color}/design.md (100%) rename openspec/changes/{5352-infra-plan-no-color => archive/2026-11-13-5352-infra-plan-no-color}/proposal.md (100%) rename openspec/changes/{5352-infra-plan-no-color => archive/2026-11-13-5352-infra-plan-no-color}/specs/infra-plan/spec.md (100%) rename openspec/changes/{5352-infra-plan-no-color => archive/2026-11-13-5352-infra-plan-no-color}/tasks.md (100%) diff --git a/openspec/changes/5352-infra-plan-no-color/.openspec.yaml b/openspec/changes/archive/2026-11-13-5352-infra-plan-no-color/.openspec.yaml similarity index 100% rename from openspec/changes/5352-infra-plan-no-color/.openspec.yaml rename to openspec/changes/archive/2026-11-13-5352-infra-plan-no-color/.openspec.yaml diff --git a/openspec/changes/5352-infra-plan-no-color/design.md b/openspec/changes/archive/2026-11-13-5352-infra-plan-no-color/design.md similarity index 100% rename from openspec/changes/5352-infra-plan-no-color/design.md rename to openspec/changes/archive/2026-11-13-5352-infra-plan-no-color/design.md diff --git a/openspec/changes/5352-infra-plan-no-color/proposal.md b/openspec/changes/archive/2026-11-13-5352-infra-plan-no-color/proposal.md similarity index 100% rename from openspec/changes/5352-infra-plan-no-color/proposal.md rename to openspec/changes/archive/2026-11-13-5352-infra-plan-no-color/proposal.md diff --git a/openspec/changes/5352-infra-plan-no-color/specs/infra-plan/spec.md b/openspec/changes/archive/2026-11-13-5352-infra-plan-no-color/specs/infra-plan/spec.md similarity index 100% rename from openspec/changes/5352-infra-plan-no-color/specs/infra-plan/spec.md rename to openspec/changes/archive/2026-11-13-5352-infra-plan-no-color/specs/infra-plan/spec.md diff --git a/openspec/changes/5352-infra-plan-no-color/tasks.md b/openspec/changes/archive/2026-11-13-5352-infra-plan-no-color/tasks.md similarity index 100% rename from openspec/changes/5352-infra-plan-no-color/tasks.md rename to openspec/changes/archive/2026-11-13-5352-infra-plan-no-color/tasks.md diff --git a/openspec/specs/infra-plan/spec.md b/openspec/specs/infra-plan/spec.md index 04edecbe8f..08280008c1 100644 --- a/openspec/specs/infra-plan/spec.md +++ b/openspec/specs/infra-plan/spec.md @@ -98,3 +98,18 @@ The command SHALL print a title, the commit that it read, a table of hosts, a ta #### Scenario: A dry run of a branch - **WHEN** an agent runs the command with `--ref fix/k3s --dry-run` on a repo at `none` - **THEN** the command exits 0, starts no process, and lists the requests in order + +### Requirement: The run output has no color +Every `ansible-runner` run of a playbook, the plan, the fresh check and the run of an apply, SHALL get `ANSIBLE_NOCOLOR=True` and `ANSIBLE_FORCE_COLOR=False` in its environment, also when the repo's `ansible.cfg` sets `force_color`, so the event text and the plan of a host are the same in a color terminal and with no terminal. A skip result that does not read as JSON, such as a result with color codes, SHALL stay unchecked. + +#### Scenario: The environment of the plan run +- **WHEN** a person plans `ansible/playbooks/03_k3s.yaml` +- **THEN** `ansible-runner` gets `ANSIBLE_NOCOLOR=True` and `ANSIBLE_FORCE_COLOR=False` + +#### Scenario: A plan with no terminal and its apply in a color terminal +- **WHEN** a person plans node-3 with no `TERM`, and applies the plan with `TERM=xterm-256color` +- **THEN** each `ansible-runner` run gets `ANSIBLE_NOCOLOR=True` and `ANSIBLE_FORCE_COLOR=False`, the fresh check of node-3 equals the plan, and the apply exits 0 + +#### Scenario: A skip result in color +- **WHEN** the recorded run in a color terminal skips a task of node-1 and a task of node-3 by a false `when`, with the color codes around the text of each skip +- **THEN** each of the two tasks is unchecked, and the rest of the plan of each host equals the plan of the run with no terminal