diff --git a/changelogs/fragments/fix-ansible-lint-warnings.yaml b/changelogs/fragments/fix-ansible-lint-warnings.yaml new file mode 100644 index 00000000..19a0f0e3 --- /dev/null +++ b/changelogs/fragments/fix-ansible-lint-warnings.yaml @@ -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." diff --git a/meta/execution-environment.yml b/meta/execution-environment.yml index d950e22a..71192bcf 100644 --- a/meta/execution-environment.yml +++ b/meta/execution-environment.yml @@ -1,4 +1,5 @@ --- +version: 3 dependencies: python: requirements.txt system: meta/ee-bindep.txt diff --git a/plugins/connection/kubectl.py b/plugins/connection/kubectl.py index e80482fd..e97c0ba9 100644 --- a/plugins/connection/kubectl.py +++ b/plugins/connection/kubectl.py @@ -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 }}" """