diff options
Diffstat (limited to 'deployment/playbooks/roles/setup-custom-domain-names/tasks/main.yaml')
-rw-r--r-- | deployment/playbooks/roles/setup-custom-domain-names/tasks/main.yaml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/deployment/playbooks/roles/setup-custom-domain-names/tasks/main.yaml b/deployment/playbooks/roles/setup-custom-domain-names/tasks/main.yaml new file mode 100644 index 00000000..d53fa43f --- /dev/null +++ b/deployment/playbooks/roles/setup-custom-domain-names/tasks/main.yaml @@ -0,0 +1,29 @@ +--- +- name: Import role with update of /etc/hosts file + import_role: + name: setup-custom-domain-names-for-ansible-runner + +- name: Create directory for dnsmasq config file if absent + file: + dest: /etc/dnsmasq.d + state: directory + mode: 0644 + +- name: Create custom dnsmasq config file for current cluster + file: + dest: '/etc/dnsmasq.d/openshift-cluster-{{ cluster_id }}.conf' + state: touch + +- name: Remove stale data from custom dnsmasq config file is exist + lineinfile: + dest: '/etc/dnsmasq.d/openshift-cluster-{{ cluster_id }}.conf' + regexp: "{{ item.value.0 }}" + state: absent + with_dict: "{{ current_cluster_ips }}" + +- name: Write data to custom dnsmasq config file + lineinfile: + dest: '/etc/dnsmasq.d/openshift-cluster-{{ cluster_id }}.conf' + line: "address=/{{ item.value.0 }}/{{ item.key }}\naddress=/{{ item.value.1 }}/{{ item.key }}" + state: present + with_dict: "{{ current_cluster_ips }}" |