summaryrefslogtreecommitdiffstats
path: root/deployment/playbooks/roles/setup-custom-domain-names/tasks
diff options
context:
space:
mode:
authorValerii Ponomarov <vponomar@redhat.com>2019-02-07 02:08:23 +0530
committerValerii Ponomarov <vponomar@redhat.com>2019-02-07 02:36:02 +0530
commit25fcd9c5aa4c360eff19ef08fc4e2bdff6147ffd (patch)
tree544cf09479861ee7c434a7f9ece19167c14ddf35 /deployment/playbooks/roles/setup-custom-domain-names/tasks
parenta6c7dead0d6ddad4dae93a4292891617b50b44a0 (diff)
Add end-to-end OCP 'deployment' functionality
Add end-to-end deployment tool of OpenShift and OpenShift Container Storage on top of VMWare. Added code is modified version of the 'reference-architecture/vmware-ansible' dir from the following repo: https://github.com/vponomaryov/openshift-ansible-contrib Read 'deployment/README.rst' file for more details about the deployment tool. Change-Id: Ic96f252ff786cc1ecf24d27f0ec47e324131e41b
Diffstat (limited to 'deployment/playbooks/roles/setup-custom-domain-names/tasks')
-rw-r--r--deployment/playbooks/roles/setup-custom-domain-names/tasks/main.yaml29
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 }}"