mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-29 02:44:43 +00:00
host*: 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:
@@ -5,12 +5,12 @@
|
||||
|
||||
tasks:
|
||||
- name: Get Domain from server name
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
|
||||
when: ipaserver_domain is not defined
|
||||
|
||||
- name: Set host1_fqdn and host2_fqdn
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
host1_fqdn: "{{ 'host1.' + ipaserver_domain }}"
|
||||
host2_fqdn: "{{ 'host2.' + ipaserver_domain }}"
|
||||
|
||||
@@ -34,12 +34,12 @@
|
||||
failed_when: not ipahost.changed or ipahost.failed
|
||||
|
||||
- name: Assert ipahost.host.randompassword is defined.
|
||||
assert:
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- ipahost.host.randompassword is defined
|
||||
|
||||
- name: Print generated random password
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: ipahost.host.randompassword
|
||||
|
||||
- name: Host "{{ host1_fqdn }}" absent
|
||||
@@ -64,7 +64,7 @@
|
||||
failed_when: not ipahost.changed or ipahost.failed
|
||||
|
||||
- name: Assert randompassword is defined for host1 and host2.
|
||||
assert:
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- ipahost.host["{{ host1_fqdn }}"].randompassword is
|
||||
defined
|
||||
@@ -72,11 +72,11 @@
|
||||
defined
|
||||
|
||||
- name: Print generated random password for "{{ host1_fqdn }}"
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: ipahost.host["{{ host1_fqdn }}"].randompassword
|
||||
|
||||
- name: Print generated random password for "{{ host2_fqdn }}"
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: ipahost.host["{{ host2_fqdn }}"].randompassword
|
||||
|
||||
- name: Enrolled host "{{ ansible_facts['fqdn'] }}" fails to set random password with update_password always
|
||||
@@ -90,7 +90,7 @@
|
||||
failed_when: ipahost.changed or not ipahost.failed
|
||||
|
||||
- name: Assert randompassword is not defined for 'ansible_fqdn'.
|
||||
assert:
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- ipahost.host["{{ ansible_facts['fqdn'] }}"].randompassword is
|
||||
not defined
|
||||
|
||||
Reference in New Issue
Block a user