mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-30 11:24:50 +00:00
Use ansible_facts variable
Without this change the "Import variables specific to distribution" tasks fail with "Could not find file on the Ansible Controller..." on environments with inject facts disabled. This changes the tests to run with ansible with inject_facts_as_vars = false and fixes other roles and playbooks.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
tasks:
|
||||
- name: Get Domain from server name
|
||||
set_fact:
|
||||
ipaserver_domain: "{{ ansible_fqdn.split('.')[1:] | join ('.') }}"
|
||||
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
|
||||
when: ipaserver_domain is not defined
|
||||
|
||||
- name: Set host1_fqdn and host2_fqdn
|
||||
@@ -77,11 +77,11 @@
|
||||
debug:
|
||||
var: ipahost.host["{{host2_fqdn }}"].randompassword
|
||||
|
||||
- name: Enrolled host "{{ ansible_fqdn }}" fails to set random password with update_password always
|
||||
- name: Enrolled host "{{ ansible_facts['fqdn'] }}" fails to set random password with update_password always
|
||||
ipahost:
|
||||
ipaadmin_password: SomeADMINpassword
|
||||
hosts:
|
||||
- name: "{{ ansible_fqdn }}"
|
||||
- name: "{{ ansible_facts['fqdn'] }}"
|
||||
random: yes
|
||||
update_password: always
|
||||
register: ipahost
|
||||
@@ -89,7 +89,7 @@
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- ipahost.host["{{ ansible_fqdn }}"].randompassword is
|
||||
- ipahost.host["{{ ansible_facts['fqdn'] }}"].randompassword is
|
||||
not defined
|
||||
- "'Password cannot be set on enrolled host' in ipahost.msg"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user