mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-26 21:33:05 +00:00
test playbooks: Add fact to define ipaserver_domain if not set.
Add a task to FreeIPA facts task file to ensure that the variable 'ipaserver_domain' is set. The value is set form `ansible_facts['fqdn'], if available, or set to `ipa.test`, otherwise.
This commit is contained in:
@@ -29,3 +29,15 @@
|
||||
ipa_api_version: "{{ ipa_cmd_version.stdout_lines[1] }}"
|
||||
ipa_host_is_client: "{{ (output.stdout_lines[-1] == 'CLIENT') | bool }}"
|
||||
trust_test_is_supported: no
|
||||
|
||||
- block:
|
||||
- name: Get Domain from server name
|
||||
set_fact:
|
||||
ipaserver_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join ('.') }}"
|
||||
when: "'fqdn' in ansible_facts"
|
||||
|
||||
- name: Set Domain to 'ipa.test' if FQDN could not be retrieved.
|
||||
set_fact:
|
||||
ipaserver_domain: "ipa.test"
|
||||
when: "'fqdn' not in ansible_facts"
|
||||
when: ipaserver_domain is not defined
|
||||
|
||||
Reference in New Issue
Block a user