Fix ansible-lint no-changed-when and execution-environment schema warnings (#1196) (#1237)

* Fix ansible-lint no-changed-when and execution-environment schema warnings

Add `changed_when: false` to example command tasks in the kubectl
connection plugin to resolve no-changed-when warnings from ansible-lint.

Add `version: 3` to meta/execution-environment.yml to satisfy the
schema[execution-environment] rule requiring the version property.



* Add changelog fragment for ansible-lint warning fixes



* Fix changelog fragment YAML formatting

Quote strings to avoid YAML parsing ambiguity in the trivial section.



---------


(cherry picked from commit a7922e498c)

Co-authored-by: Daniel Brennand <52419383+dbrennand@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
patchback[bot]
2026-09-10 15:26:41 +01:00
committed by GitHub
co-authored by Daniel Brennand Claude Opus 4.6
parent 7b17313ace
commit 20b9c3fb7f
3 changed files with 7 additions and 0 deletions
@@ -0,0 +1,3 @@
trivial:
- "kubectl connection plugin - added ``changed_when: false`` to example ``ansible.builtin.command`` tasks to resolve ansible-lint ``no-changed-when`` warnings."
- "ee - added ``version: 3`` to ``meta/execution-environment.yml`` to resolve ansible-lint ``schema[execution-environment]`` warning."
+1
View File
@@ -1,4 +1,5 @@
---
version: 3
dependencies:
python: requirements.txt
system: meta/ee-bindep.txt
+3
View File
@@ -196,6 +196,7 @@ EXAMPLES = r"""
# and requires python to be installed in the image
- name: Run a command in a pod
ansible.builtin.command: echo "Hello, World!"
changed_when: false
- name: Run a command in a pod using local kubectl with inventory variables
# Example inventory:
@@ -220,6 +221,7 @@ EXAMPLES = r"""
# and requires python to be installed in the image
- name: Run a command in a pod
ansible.builtin.command: echo "Hello, World!"
changed_when: false
- name: Run a command in a pod using dynamic inventory
hosts: localhost
@@ -253,6 +255,7 @@ EXAMPLES = r"""
# be aware that the command is executed as the user that started the container
# and requires python to be installed in the image
ansible.builtin.command: echo "Hello, World!"
changed_when: false
delegate_to: "{{ my_app_pod_name }}"
"""