From 904213a7c567175477f81d196ed5b493f73d537f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernd=20M=C3=BCller?= Date: Thu, 13 Oct 2022 04:02:38 +0200 Subject: [PATCH] Fixes: #3481, Use FQCN at any point I found (#3680) --- docs/getting-started.rst | 4 ++-- playbooks/snap-pre-run.yaml | 12 ++++++------ src/molecule/data/validate-dockerfile.yml | 6 +++--- .../resources/playbooks/delegated/create.yml | 2 +- .../resources/playbooks/delegated/destroy.yml | 2 +- .../test/resources/roles/molecule/tasks/main.yml | 4 ++-- .../molecule/default/converge.yml | 2 +- .../roles/get_rich/tasks/main.yml | 2 +- .../cleanup/molecule/default/cleanup.yml | 2 +- .../cleanup/molecule/default/converge.yml | 2 +- .../molecule/ansible-galaxy/converge.yml | 6 +++--- .../molecule/default/converge.yml | 16 ++++++++-------- .../host_group_vars/molecule/links/converge.yml | 6 +++--- .../test/scenarios/idempotence/tasks/main.yml | 6 +++--- .../interpolation/molecule/default/converge.yml | 2 +- .../molecule/default/converge.yml | 2 +- .../side_effect/molecule/default/converge.yml | 4 ++-- .../side_effect/molecule/default/side_effect.yml | 2 +- .../molecule/default/converge.yml | 2 +- .../molecule/testinfra-pre-commit/converge.yml | 4 ++-- 20 files changed, 44 insertions(+), 44 deletions(-) diff --git a/docs/getting-started.rst b/docs/getting-started.rst index 42d23af813..292d9f78c2 100644 --- a/docs/getting-started.rst +++ b/docs/getting-started.rst @@ -99,7 +99,7 @@ directories: become: true tasks: - name: Initialize role without actually running it - include_role: + ansible.builtin.include_role: name: my_role tasks_from: init @@ -171,7 +171,7 @@ Now, let's add a task to our ``tasks/main.yml`` like so: .. code-block:: yaml - name: Molecule Hello World! - debug: + ansible.builtin.debug: msg: Hello, World! We can then tell Molecule to test our role against our instance with: diff --git a/playbooks/snap-pre-run.yaml b/playbooks/snap-pre-run.yaml index 28adb227c1..5df174aea9 100644 --- a/playbooks/snap-pre-run.yaml +++ b/playbooks/snap-pre-run.yaml @@ -2,33 +2,33 @@ become: true tasks: - name: Install snapd - package: + ansible.builtin.package: name: snapd state: present - name: Enable snapd service - service: + ansible.builtin.service: name: snapd.socket state: started - when: ansible_os_family == 'Debian' name: Install snapcraft (debian) - package: + ansible.builtin.package: name: snapcraft state: present - when: ansible_os_family == 'RedHat' block: - name: Activate snapd - shell: | + ansible.builtin.shell: | ln -s /var/lib/snapd/snap /snap - name: Install snapcraft (redhat) - shell: | + ansible.builtin.shell: | type snapcraft || snap install --classic snapcraft - name: Validate snapd install - shell: | + ansible.builtin.shell: | set -e snap version snapcraft version diff --git a/src/molecule/data/validate-dockerfile.yml b/src/molecule/data/validate-dockerfile.yml index c363e2f95f..46e0b355f7 100644 --- a/src/molecule/data/validate-dockerfile.yml +++ b/src/molecule/data/validate-dockerfile.yml @@ -14,7 +14,7 @@ - image: debian:latest tasks: - name: create temporary dockerfiles - tempfile: + ansible.builtin.tempfile: # sanitize image name to be filename safe prefix: "molecule-dockerfile-{{ item.image | regex_replace('\/', '-') }}" suffix: build @@ -24,7 +24,7 @@ label: "{{ item.image }}" - name: expand Dockerfile templates - template: + ansible.builtin.template: src: Dockerfile.j2 dest: "{{ temp_dockerfiles.results[index].path }}" register: result @@ -51,7 +51,7 @@ register: result - name: Clean up temporary Dockerfile's - file: + ansible.builtin.file: path: "{{ item }}" state: absent loop: "{{ temp_dockerfiles.results | map(attribute='path') | list }}" diff --git a/src/molecule/test/resources/playbooks/delegated/create.yml b/src/molecule/test/resources/playbooks/delegated/create.yml index 6741f17289..bcb29515cf 100644 --- a/src/molecule/test/resources/playbooks/delegated/create.yml +++ b/src/molecule/test/resources/playbooks/delegated/create.yml @@ -4,4 +4,4 @@ connection: local gather_facts: false tasks: - - include: create/docker.yml + - ansible.builtin.include: create/docker.yml diff --git a/src/molecule/test/resources/playbooks/delegated/destroy.yml b/src/molecule/test/resources/playbooks/delegated/destroy.yml index e088e951ee..a24b7850e4 100644 --- a/src/molecule/test/resources/playbooks/delegated/destroy.yml +++ b/src/molecule/test/resources/playbooks/delegated/destroy.yml @@ -4,4 +4,4 @@ connection: local gather_facts: false tasks: - - include: destroy/docker.yml + - ansible.builtin.include: destroy/docker.yml diff --git a/src/molecule/test/resources/roles/molecule/tasks/main.yml b/src/molecule/test/resources/roles/molecule/tasks/main.yml index 7d7a01e59d..2a0faa81ea 100644 --- a/src/molecule/test/resources/roles/molecule/tasks/main.yml +++ b/src/molecule/test/resources/roles/molecule/tasks/main.yml @@ -1,13 +1,13 @@ --- - name: Create /etc/molecule - file: dest=/etc/molecule + ansible.builtin.file: dest=/etc/molecule group=root owner=root mode=0755 state=directory - name: Create /etc/molecule/{{ ansible_host }} - copy: dest="/etc/molecule/{{ ansible_host }}" + ansible.builtin.copy: dest="/etc/molecule/{{ ansible_host }}" group=root owner=root mode=0644 diff --git a/src/molecule/test/resources/sample-collection/molecule/default/converge.yml b/src/molecule/test/resources/sample-collection/molecule/default/converge.yml index ea6b3e185a..73f7cfb3c3 100644 --- a/src/molecule/test/resources/sample-collection/molecule/default/converge.yml +++ b/src/molecule/test/resources/sample-collection/molecule/default/converge.yml @@ -3,5 +3,5 @@ hosts: localhost tasks: - name: "Include sample role from current collection" - include_role: + ansible.builtin.include_role: name: acme.goodies.get_rich diff --git a/src/molecule/test/resources/sample-collection/roles/get_rich/tasks/main.yml b/src/molecule/test/resources/sample-collection/roles/get_rich/tasks/main.yml index f5fc69344c..cf8063a148 100644 --- a/src/molecule/test/resources/sample-collection/roles/get_rich/tasks/main.yml +++ b/src/molecule/test/resources/sample-collection/roles/get_rich/tasks/main.yml @@ -1,3 +1,3 @@ - name: "some task inside foo.bar collection" - debug: + ansible.builtin.debug: msg: "hello world!" diff --git a/src/molecule/test/scenarios/cleanup/molecule/default/cleanup.yml b/src/molecule/test/scenarios/cleanup/molecule/default/cleanup.yml index 2c2c672c31..33c5d6fd6f 100644 --- a/src/molecule/test/scenarios/cleanup/molecule/default/cleanup.yml +++ b/src/molecule/test/scenarios/cleanup/molecule/default/cleanup.yml @@ -4,5 +4,5 @@ connection: local tasks: - name: Debug - debug: + ansible.builtin.debug: msg: "Cleaned up" diff --git a/src/molecule/test/scenarios/cleanup/molecule/default/converge.yml b/src/molecule/test/scenarios/cleanup/molecule/default/converge.yml index 32c824c072..d94d81c7e2 100644 --- a/src/molecule/test/scenarios/cleanup/molecule/default/converge.yml +++ b/src/molecule/test/scenarios/cleanup/molecule/default/converge.yml @@ -4,6 +4,6 @@ gather_facts: false tasks: - name: Touch a file - command: touch /tmp/cleanup + ansible.builtin.command: touch /tmp/cleanup args: creates: /tmp/cleanup diff --git a/src/molecule/test/scenarios/dependency/molecule/ansible-galaxy/converge.yml b/src/molecule/test/scenarios/dependency/molecule/ansible-galaxy/converge.yml index 8a978a8b9c..c99035fc04 100644 --- a/src/molecule/test/scenarios/dependency/molecule/ansible-galaxy/converge.yml +++ b/src/molecule/test/scenarios/dependency/molecule/ansible-galaxy/converge.yml @@ -4,14 +4,14 @@ gather_facts: false tasks: - name: Install requirements for collection community.molecule - pip: + ansible.builtin.pip: name: molecule delegate_to: localhost - name: Validate that collection was installed - debug: + ansible.builtin.debug: msg: "{{ 'foo' | community.molecule.header }}" - name: test installed role - include_role: + ansible.builtin.include_role: name: ssbarnea.ansible_role_helloworld diff --git a/src/molecule/test/scenarios/host_group_vars/molecule/default/converge.yml b/src/molecule/test/scenarios/host_group_vars/molecule/default/converge.yml index 8c023aa825..1773d9025f 100644 --- a/src/molecule/test/scenarios/host_group_vars/molecule/default/converge.yml +++ b/src/molecule/test/scenarios/host_group_vars/molecule/default/converge.yml @@ -3,41 +3,41 @@ gather_facts: false tasks: - name: Host vars host_var for host host-group-vars from molecule.yml - debug: + ansible.builtin.debug: var: host_group_vars_host_molecule_yml - name: Host vars from host_vars existing directory - debug: + ansible.builtin.debug: var: host_group_vars_host_vars_dir - name: Group vars group_var for group example from molecule.yml - debug: + ansible.builtin.debug: var: - host_group_vars_example_group_one_molecule_yml - host_group_vars_example_group_two_molecule_yml - name: Group vars from group_vars existing directory - debug: + ansible.builtin.debug: var: host_group_vars_group_vars_dir - name: Group vars group_var from child group example_1 from molecule.yml - debug: + ansible.builtin.debug: var: host_group_vars_example_1_child_group_molecule_yml - name: Variable from extra_host from molecule.yml - debug: + ansible.builtin.debug: var: hostvars['extra_host']['host_group_vars_extra_host_molecule_yml'] - hosts: example gather_facts: false tasks: - name: Dummy converge of example group - debug: + ansible.builtin.debug: var: ansible_host - hosts: example_1 gather_facts: false tasks: - name: Dummy converge of child example_1 group - debug: + ansible.builtin.debug: var: ansible_host diff --git a/src/molecule/test/scenarios/host_group_vars/molecule/links/converge.yml b/src/molecule/test/scenarios/host_group_vars/molecule/links/converge.yml index b82328c272..b149009b2f 100644 --- a/src/molecule/test/scenarios/host_group_vars/molecule/links/converge.yml +++ b/src/molecule/test/scenarios/host_group_vars/molecule/links/converge.yml @@ -3,13 +3,13 @@ gather_facts: false tasks: - name: Host vars from host_vars links - debug: + ansible.builtin.debug: var: host_group_vars_host_vars_linked - name: Group vars from group_vars links - debug: + ansible.builtin.debug: var: host_group_vars_group_vars_linked - name: Variable from extra inventory link - debug: + ansible.builtin.debug: var: hostvars['extra-host']['host_group_vars_extra_host_linked'] diff --git a/src/molecule/test/scenarios/idempotence/tasks/main.yml b/src/molecule/test/scenarios/idempotence/tasks/main.yml index f81c5a326c..a57c3fc4cb 100644 --- a/src/molecule/test/scenarios/idempotence/tasks/main.yml +++ b/src/molecule/test/scenarios/idempotence/tasks/main.yml @@ -3,10 +3,10 @@ # Taken from https://github.com/ansible-community/molecule/issues/835 - name: Create /tmp/test1 - file: name=/tmp/test1 state=directory + ansible.builtin.file: name=/tmp/test1 state=directory - name: Replace /tmp/test1 by /tmp/test2 - shell: ls -ld /tmp/test1 | grep root + ansible.builtin.shell: ls -ld /tmp/test1 | grep root - name: Fix /tmp/test1 perms - file: name=/tmp/test1 state=directory owner=lp group=lp + ansible.builtin.file: name=/tmp/test1 state=directory owner=lp group=lp diff --git a/src/molecule/test/scenarios/interpolation/molecule/default/converge.yml b/src/molecule/test/scenarios/interpolation/molecule/default/converge.yml index f80b3558d9..8c0afc6819 100644 --- a/src/molecule/test/scenarios/interpolation/molecule/default/converge.yml +++ b/src/molecule/test/scenarios/interpolation/molecule/default/converge.yml @@ -4,5 +4,5 @@ gather_facts: false tasks: - name: Dummy task - command: /bin/true + ansible.builtin.command: /bin/true changed_when: false diff --git a/src/molecule/test/scenarios/overrride_driver/molecule/default/converge.yml b/src/molecule/test/scenarios/overrride_driver/molecule/default/converge.yml index f80b3558d9..8c0afc6819 100644 --- a/src/molecule/test/scenarios/overrride_driver/molecule/default/converge.yml +++ b/src/molecule/test/scenarios/overrride_driver/molecule/default/converge.yml @@ -4,5 +4,5 @@ gather_facts: false tasks: - name: Dummy task - command: /bin/true + ansible.builtin.command: /bin/true changed_when: false diff --git a/src/molecule/test/scenarios/side_effect/molecule/default/converge.yml b/src/molecule/test/scenarios/side_effect/molecule/default/converge.yml index bf2ecd7717..e7f2fef9a2 100644 --- a/src/molecule/test/scenarios/side_effect/molecule/default/converge.yml +++ b/src/molecule/test/scenarios/side_effect/molecule/default/converge.yml @@ -4,12 +4,12 @@ gather_facts: false tasks: - name: Check for test file - stat: + ansible.builtin.stat: path: /tmp/testfile register: test_file - name: Create the test file - file: + ansible.builtin.file: path: /tmp/testfile state: touch when: not test_file.stat.exists diff --git a/src/molecule/test/scenarios/side_effect/molecule/default/side_effect.yml b/src/molecule/test/scenarios/side_effect/molecule/default/side_effect.yml index 458381f350..f3047a24ca 100644 --- a/src/molecule/test/scenarios/side_effect/molecule/default/side_effect.yml +++ b/src/molecule/test/scenarios/side_effect/molecule/default/side_effect.yml @@ -5,6 +5,6 @@ no_log: "{{ molecule_no_log }}" tasks: - name: Delete the test file as a planned side effect - file: + ansible.builtin.file: path: /tmp/testfile state: absent diff --git a/src/molecule/test/scenarios/test_destroy_strategy/molecule/default/converge.yml b/src/molecule/test/scenarios/test_destroy_strategy/molecule/default/converge.yml index fc10edab7b..b8e6726a98 100644 --- a/src/molecule/test/scenarios/test_destroy_strategy/molecule/default/converge.yml +++ b/src/molecule/test/scenarios/test_destroy_strategy/molecule/default/converge.yml @@ -5,4 +5,4 @@ become: true tasks: - name: Force a converge failure - command: /bin/false + ansible.builtin.command: /bin/false diff --git a/src/molecule/test/scenarios/verifier/molecule/testinfra-pre-commit/converge.yml b/src/molecule/test/scenarios/verifier/molecule/testinfra-pre-commit/converge.yml index 8ef1616b93..8ad426dc0c 100644 --- a/src/molecule/test/scenarios/verifier/molecule/testinfra-pre-commit/converge.yml +++ b/src/molecule/test/scenarios/verifier/molecule/testinfra-pre-commit/converge.yml @@ -3,7 +3,7 @@ hosts: all tasks: - name: Create /tmp/molecule - file: + ansible.builtin.file: dest: /etc/molecule group: root owner: root @@ -11,7 +11,7 @@ state: directory - name: Create /etc/molecule/{{ ansible_hostname }} - copy: + ansible.builtin.copy: dest: "/etc/molecule/{{ ansible_hostname }}" group: root owner: root