--- - name: Get Domain from server name ansible.builtin.set_fact: test_domain: "{{ ansible_facts['fqdn'].split('.')[1:] | join('.') }}" - name: Set host1, host2 and svc hosts fqdn ansible.builtin.set_fact: host1_fqdn: "{{ 'host1.' + test_domain }}" host2_fqdn: "{{ 'host2.' + test_domain }}" svc_fqdn: "{{ 'svc.' + test_domain }}" nohost_fqdn: "{{ 'nohost.' + test_domain }}" - name: Get IPv4 address prefix from server node ansible.builtin.set_fact: ipv4_prefix: "{{ ansible_facts['default_ipv4'].address.split('.')[:-1] | join('.') }}"