Skip to content
Snippets Groups Projects
Commit d2bcaa3b authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman
Browse files

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.
parent 37ba14f1
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment