sudo*: Use FQCN for ansible.builtin

Use Fully Qualified Collection Name (FQCN) for ansible builtins. This is
ansible.builtin.set_fact instead of set_fact for example and aplies for
all actions that are part of ansible.builtin.

All the replaced ansible.builtins:
  assert, command, copy, debug, fail, fetch, file, import_playbook,
  import_tasks, include_role, include_tasks, include_vars, package,
  set_fact, shell, slurp, stat, systemd
This commit is contained in:
Thomas Woerner
2022-12-20 13:54:26 +01:00
parent feadbfce95
commit 9d47ffc2b9
7 changed files with 15 additions and 15 deletions

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test sudocmd using client context, in client host. - name: Test sudocmd using client context, in client host.
import_playbook: test_sudocmd.yml ansible.builtin.import_playbook: test_sudocmd.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test sudocmd using client context, in server host. - name: Test sudocmd using client context, in server host.
import_playbook: test_sudocmd.yml ansible.builtin.import_playbook: test_sudocmd.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -83,7 +83,7 @@
failed_when: result.changed or result.failed failed_when: result.changed or result.failed
- name: Verify sudocmdgroup creation with sudocmds - name: Verify sudocmdgroup creation with sudocmds
shell: | ansible.builtin.shell: |
echo SomeADMINpassword | kinit -c verify_sudocmdgroup admin echo SomeADMINpassword | kinit -c verify_sudocmdgroup admin
KRB5CCNAME="verify_sudocmdgroup" ipa sudocmdgroup-show network --all KRB5CCNAME="verify_sudocmdgroup" ipa sudocmdgroup-show network --all
kdestroy -A -q -c verify_sudocmdgroup kdestroy -A -q -c verify_sudocmdgroup

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test sudocmdgroup using client context, in client host. - name: Test sudocmdgroup using client context, in client host.
import_playbook: test_sudocmdgroup.yml ansible.builtin.import_playbook: test_sudocmdgroup.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test sudocmdgroup using client context, in server host. - name: Test sudocmdgroup using client context, in server host.
import_playbook: test_sudocmdgroup.yml ansible.builtin.import_playbook: test_sudocmdgroup.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Get Domain from the server name - name: Get Domain from the server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
- name: Ensure sudorules are absent - name: Ensure sudorules are absent

View File

@@ -6,7 +6,7 @@
tasks: tasks:
- name: Include FreeIPA facts. - name: Include FreeIPA facts.
include_tasks: ../env_freeipa_facts.yml ansible.builtin.include_tasks: ../env_freeipa_facts.yml
# Test will only be executed if host is not a server. # Test will only be executed if host is not a server.
- name: Execute with server context in the client. - name: Execute with server context in the client.
@@ -27,13 +27,13 @@
# in upstream CI. # in upstream CI.
- name: Test sudorule using client context, in client host. - name: Test sudorule using client context, in client host.
import_playbook: test_sudorule.yml ansible.builtin.import_playbook: test_sudorule.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test sudorule using client context, in server host. - name: Test sudorule using client context, in server host.
import_playbook: test_sudorule.yml ansible.builtin.import_playbook: test_sudorule.yml
when: groups['ipaclients'] is not defined or not groups['ipaclients'] when: groups['ipaclients'] is not defined or not groups['ipaclients']
vars: vars:
ipa_context: client ipa_context: client

View File

@@ -16,7 +16,7 @@
- block: - block:
# SETUP # SETUP
- name: Ensure domain name - name: Ensure domain name
set_fact: ansible.builtin.set_fact:
ipa_domain: ipa.test ipa_domain: ipa.test
when: ipa_domain is not defined when: ipa_domain is not defined
@@ -56,7 +56,7 @@
# TESTS # TESTS
- name: Start tests. - name: Start tests.
debug: ansible.builtin.debug:
msg: "Tests are starting." msg: "Tests are starting."
- name: Ensure sudorule exist with runasusers members - name: Ensure sudorule exist with runasusers members
@@ -249,7 +249,7 @@
failed_when: result.failed or result.changed failed_when: result.failed or result.changed
- name: End tests. - name: End tests.
debug: ansible.builtin.debug:
msg: "All tests executed." msg: "All tests executed."
always: always:

View File

@@ -8,7 +8,7 @@
- block: - block:
# setup test environment # setup test environment
- name: Get Domain from the server name - name: Get Domain from the server name
set_fact: ansible.builtin.set_fact:
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}" ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
when: ipaserver_domain is not defined when: ipaserver_domain is not defined