--- # Assign hostnames - hosts: cluster_hosts gather_facts: False become: true pre_tasks: - include: pre_tasks.yml roles: - role: hostnames # Subscribe DNS Host to allow for configuration below - hosts: dns gather_facts: False become: true roles: - role: subscription-manager when: hostvars.localhost.rhsm_register tags: 'subscription-manager' # Determine which DNS server(s) to use for our generated records - hosts: localhost gather_facts: False become: False roles: - dns-server-detect # Build the DNS Server Views and Configure DNS Server(s) - hosts: dns gather_facts: False become: true pre_tasks: - include: pre_tasks.yml - name: "Generate dns-server views" include: openstack_dns_views.yml roles: - role: dns-server # Build and process DNS Records - hosts: localhost gather_facts: False become: False pre_tasks: - include: pre_tasks.yml - name: "Generate dns records" include: openstack_dns_records.yml roles: - role: dns # OpenShift Pre-Requisites - hosts: OSEv3 gather_facts: False become: true tasks: - name: "Edit /etc/resolv.conf on masters/nodes" lineinfile: state: present dest: /etc/resolv.conf regexp: "nameserver {{ hostvars['localhost'].private_dns_server }}" line: "nameserver {{ hostvars['localhost'].private_dns_server }}" insertafter: search* - name: "Include DNS configuration to ensure proper name resolution" lineinfile: state: present dest: /etc/sysconfig/network regexp: "IP4_NAMESERVERS={{ hostvars['localhost'].private_dns_server }}" line: "IP4_NAMESERVERS={{ hostvars['localhost'].private_dns_server }}"