mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-11-22 15:10:22 +00:00
Fix ansible-lint no-changed-when and execution-environment schema warnings (#1196)
* 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. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add changelog fragment for ansible-lint warning fixes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix changelog fragment YAML formatting Quote strings to avoid YAML parsing ambiguity in the trivial section. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
d9e0218dba
commit
a7922e498c
@@ -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,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
version: 3
|
||||||
dependencies:
|
dependencies:
|
||||||
python: requirements.txt
|
python: requirements.txt
|
||||||
system: meta/ee-bindep.txt
|
system: meta/ee-bindep.txt
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ EXAMPLES = r"""
|
|||||||
# and requires python to be installed in the image
|
# and requires python to be installed in the image
|
||||||
- name: Run a command in a pod
|
- name: Run a command in a pod
|
||||||
ansible.builtin.command: echo "Hello, World!"
|
ansible.builtin.command: echo "Hello, World!"
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Run a command in a pod using local kubectl with inventory variables
|
- name: Run a command in a pod using local kubectl with inventory variables
|
||||||
# Example inventory:
|
# Example inventory:
|
||||||
@@ -220,6 +221,7 @@ EXAMPLES = r"""
|
|||||||
# and requires python to be installed in the image
|
# and requires python to be installed in the image
|
||||||
- name: Run a command in a pod
|
- name: Run a command in a pod
|
||||||
ansible.builtin.command: echo "Hello, World!"
|
ansible.builtin.command: echo "Hello, World!"
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Run a command in a pod using dynamic inventory
|
- name: Run a command in a pod using dynamic inventory
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
@@ -253,6 +255,7 @@ EXAMPLES = r"""
|
|||||||
# be aware that the command is executed as the user that started the container
|
# be aware that the command is executed as the user that started the container
|
||||||
# and requires python to be installed in the image
|
# and requires python to be installed in the image
|
||||||
ansible.builtin.command: echo "Hello, World!"
|
ansible.builtin.command: echo "Hello, World!"
|
||||||
|
changed_when: false
|
||||||
delegate_to: "{{ my_app_pod_name }}"
|
delegate_to: "{{ my_app_pod_name }}"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user