Repository navigation
fix(infra): turn off the Ansible color of every playbook run - #5381
Merged
Merged
Conversation
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
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.
Owner
Author
|
Test results and checks (branch head
|
dan-petty
marked this pull request as ready for review
November 13, 2026 07:35
dan-petty
pushed a commit
that referenced
this pull request
Nov 13, 2026
🤖 I have created a release *beep* *boop* --- ## [0.127.1](v0.127.0...v0.127.1) (2026-11-13) ### Bug Fixes * **ci:** alarm at 360 s, one P0 issue, shards by recorded time ([#5377](#5377)) ([2abd6ff](2abd6ff)) * **github:** read the plan diff and the release files from the merge base ([#5401](#5401)) ([c54e14c](c54e14c)) * **infra:** turn off the Ansible color of every playbook run ([#5381](#5381)) ([5bafb1a](5bafb1a)), closes [#5352](#5352) * install-tools --check passes an older openspec binary ([#5355](#5355)) ([625c89d](625c89d)) * **k8s:** allow only the Ingress origins in Open WebUI ([#5357](#5357)) ([fdab229](fdab229)) * **pr:** count only the latest run of each check ([#5393](#5393)) ([634dc91](634dc91)) * **review:** drop the fixed gateway URL of the review dry run ([#5399](#5399)) ([0666d3d](0666d3d)) * **review:** review a pull request at the merge base of its base branch ([#5387](#5387)) ([351ba2a](351ba2a)), closes [#5346](#5346) * **roadmap:** end fix-plan at a time budget with a result line ([#5380](#5380)) ([20468f4](20468f4)), closes [#5363](#5363) * **roadmap:** refine skips an item that changed during the write ([#5392](#5392)) ([a863dda](a863dda)) * **roadmap:** stage writes RENAMED and REMOVED spec deltas ([#5367](#5367)) ([4abbbd2](4abbbd2)) * **roadmap:** title the delivery by the summary of its plan ([#5376](#5376)) ([10e1069](10e1069)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every ansible-runner run of a playbook (the plan, the fresh check and the run of an apply) now gets ANSIBLE_NOCOLOR=True and ANSIBLE_FORCE_COLOR=False.
ansible-runner gives the run a pseudo-terminal, and the process runner passes the TERM of the person. In a color terminal, the default callback put color codes around the text of each event. The plan reads the skip result after
=>as JSON. A result in color does not read, so a skip by a falsewhenwas unchecked in a color terminal and not with no terminal. Thus a plan made with no TERM stopped its apply in a color terminal at the fresh check. ANSIBLE_FORCE_COLOR=False replaces a force_color of the repo's ansible.cfg, which Ansible applies after ANSIBLE_NOCOLOR. A skip result that does not read stays unchecked: the safe side.A plan made in a color terminal before this change can stop at the fresh check. Make the plan again.
Closes #5352
Change:
openspec/changes/archive/2026-11-13-5352-infra-plan-no-color/