mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-26 21:33:05 +00:00
23 lines
756 B
YAML
23 lines
756 B
YAML
---
|
|
- name: Ensure ipaserver_domain is set
|
|
block:
|
|
- name: Get Domain from server name
|
|
ansible.builtin.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.
|
|
ansible.builtin.set_fact:
|
|
ipaserver_domain: "ipa.test"
|
|
when: "'fqdn' not in ansible_facts"
|
|
when: ipaserver_domain is not defined
|
|
|
|
- name: Set ipaserver_realm.
|
|
ansible.builtin.set_fact:
|
|
ipaserver_realm: "{{ ipaserver_domain | upper }}"
|
|
when: ipaserver_realm is not defined
|
|
|
|
- name: Create FQDN for host01
|
|
ansible.builtin.set_fact:
|
|
host1_fqdn: "host01.{{ ipaserver_domain }}"
|
|
host2_fqdn: "host02.{{ ipaserver_domain }}"
|