diff options
author | Bogdan Dobrelya <bdobreli@redhat.com> | 2017-09-26 14:36:12 +0200 |
---|---|---|
committer | Tomas Sedovic <tomas@sedovic.cz> | 2017-09-26 14:36:12 +0200 |
commit | 4669bf33d611555613dec904b1b33a1908f0a35b (patch) | |
tree | 29321760cea704f73fcf4296e66f05acbbecb274 | |
parent | d361dc4b307781ec2bb5978f30516f266a34188c (diff) | |
download | openshift-4669bf33d611555613dec904b1b33a1908f0a35b.tar.gz openshift-4669bf33d611555613dec904b1b33a1908f0a35b.tar.bz2 openshift-4669bf33d611555613dec904b1b33a1908f0a35b.tar.xz openshift-4669bf33d611555613dec904b1b33a1908f0a35b.zip |
Fix public master cluster DNS record when using bastion (#752)
When using a bastion and a single master, add the bastion node's public IP the public master's IP for the DNS record.
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
-rw-r--r-- | playbooks/provisioning/openstack/post-provision-openstack.yml | 1 | ||||
-rw-r--r-- | roles/dns-records/defaults/main.yml | 2 | ||||
-rw-r--r-- | roles/dns-records/tasks/main.yml | 9 |
3 files changed, 12 insertions, 0 deletions
diff --git a/playbooks/provisioning/openstack/post-provision-openstack.yml b/playbooks/provisioning/openstack/post-provision-openstack.yml index 61f950c14..a80e8d829 100644 --- a/playbooks/provisioning/openstack/post-provision-openstack.yml +++ b/playbooks/provisioning/openstack/post-provision-openstack.yml @@ -58,6 +58,7 @@ become: False roles: - role: dns-records + use_bastion: "{{ openstack_use_bastion|default(False)|bool }}" - role: infra-ansible/roles/dns - name: Switch the stack subnet to the configured private DNS server diff --git a/roles/dns-records/defaults/main.yml b/roles/dns-records/defaults/main.yml new file mode 100644 index 000000000..3f7fa783f --- /dev/null +++ b/roles/dns-records/defaults/main.yml @@ -0,0 +1,2 @@ +--- +use_bastion: False diff --git a/roles/dns-records/tasks/main.yml b/roles/dns-records/tasks/main.yml index 305a55195..7148b016a 100644 --- a/roles/dns-records/tasks/main.yml +++ b/roles/dns-records/tasks/main.yml @@ -70,6 +70,15 @@ when: - hostvars[groups.masters[0]].openshift_master_cluster_public_hostname is defined - openstack_num_masters == 1 + - not use_bastion|bool + +- name: "Add public master cluster hostname records to the public A records (single master behind a bastion)" + set_fact: + public_records: "{{ public_records | default([]) + [ { 'type': 'A', 'hostname': (hostvars[groups.masters[0]].openshift_master_cluster_public_hostname | replace(full_dns_domain, ''))[:-1], 'ip': hostvars[groups.bastions[0]].public_v4 } ] }}" + when: + - hostvars[groups.masters[0]].openshift_master_cluster_public_hostname is defined + - openstack_num_masters == 1 + - use_bastion|bool - name: "Add public master cluster hostname records to the public A records (multi-master)" set_fact: |