netgroup: 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:51:21 +01:00
parent adc262bcb0
commit defd1e4e92
5 changed files with 13 additions and 13 deletions

View File

@@ -19,7 +19,7 @@
# CREATE TEST ITEMS # CREATE TEST ITEMS
- name: Get Domain from server name - name: Get Domain from 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

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,25 +27,25 @@
# in upstream CI. # in upstream CI.
- name: Test netgroup using client context, in client host. - name: Test netgroup using client context, in client host.
import_playbook: test_netgroup.yml ansible.builtin.import_playbook: test_netgroup.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test netgroup using client context, in server host. - name: Test netgroup using client context, in server host.
import_playbook: test_netgroup.yml ansible.builtin.import_playbook: test_netgroup.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
- name: Test netgroup with member using client context, in client host. - name: Test netgroup with member using client context, in client host.
import_playbook: test_netgroup_member.yml ansible.builtin.import_playbook: test_netgroup_member.yml
when: groups['ipaclients'] when: groups['ipaclients']
vars: vars:
ipa_test_host: ipaclients ipa_test_host: ipaclients
- name: Test netgroup with member using client context, in server host. - name: Test netgroup with member using client context, in server host.
import_playbook: test_netgroup_member.yml ansible.builtin.import_playbook: test_netgroup_member.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

@@ -7,12 +7,12 @@
tasks: tasks:
- block: - block:
- name: Get Domain from server name - name: Get Domain from 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
- name: Set host1_fqdn .. host2_fqdn - name: Set host1_fqdn .. host2_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"

View File

@@ -7,12 +7,12 @@
tasks: tasks:
- block: - block:
- name: Get Domain from server name - name: Get Domain from 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
- name: Set host1_fqdn .. host2_fqdn - name: Set host1_fqdn .. host2_fqdn
set_fact: ansible.builtin.set_fact:
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}" host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}" host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"

View File

@@ -16,7 +16,7 @@
- block: - block:
# SETUP # SETUP
- name: Get Domain from server name - name: Get Domain from 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
@@ -62,7 +62,7 @@
# TESTS # TESTS
- name: Start tests. - name: Start tests.
debug: ansible.builtin.debug:
msg: "Tests are starting." msg: "Tests are starting."
- name: Ensure netgroups exist - name: Ensure netgroups exist
@@ -203,7 +203,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: