diff options
author | tzumainn <tzumainn@redhat.com> | 2017-09-06 09:36:09 -0400 |
---|---|---|
committer | Tomas Sedovic <tomas@sedovic.cz> | 2017-09-06 15:36:09 +0200 |
commit | 97c99ad8582370803e2841b07985260886614eb2 (patch) | |
tree | f23cb4c061741d85bd2b1a0bf0c77e04d7378c52 | |
parent | 82a11c3352001e6c6066175ad200e0f9a1379973 (diff) | |
download | openshift-97c99ad8582370803e2841b07985260886614eb2.tar.gz openshift-97c99ad8582370803e2841b07985260886614eb2.tar.bz2 openshift-97c99ad8582370803e2841b07985260886614eb2.tar.xz openshift-97c99ad8582370803e2841b07985260886614eb2.zip |
Point openshift_master_cluster_public_hostname at master or lb if defined (#706)
* Point openshift_master_cluster_public_hostname at master or load balancer if specified
* cleanup
* remove extraneous brackets
* corrections
* added doc section
* add private records
-rw-r--r-- | playbooks/provisioning/openstack/README.md | 9 | ||||
-rw-r--r-- | roles/dns-records/tasks/main.yml | 28 |
2 files changed, 37 insertions, 0 deletions
diff --git a/playbooks/provisioning/openstack/README.md b/playbooks/provisioning/openstack/README.md index 4e74627dc..8b9a37537 100644 --- a/playbooks/provisioning/openstack/README.md +++ b/playbooks/provisioning/openstack/README.md @@ -295,6 +295,15 @@ variables for the `inventory/group_vars/OSEv3.yml`, `all.yml`: deployment_type: origin openshift_deployment_type: "{{ deployment_type }}" +#### Setting a custom entrypoint + +In order to set a custom entrypoint, update `openshift_master_cluster_public_hostname` + + openshift_master_cluster_public_hostname: api.openshift.example.com + +Note than an empty hostname does not work, so if your domain is `openshift.example.com`, +you cannot set this value to simply `openshift.example.com`. + ### Configure static inventory and access via a bastion node Example inventory variables: diff --git a/roles/dns-records/tasks/main.yml b/roles/dns-records/tasks/main.yml index e9bce9718..305a55195 100644 --- a/roles/dns-records/tasks/main.yml +++ b/roles/dns-records/tasks/main.yml @@ -9,6 +9,20 @@ private_records: "{{ private_records | default([]) + [ { 'type': 'A', 'hostname': '*.' + openshift_app_domain, 'ip': hostvars[item]['private_v4'] } ] }}" with_items: "{{ groups['infra_hosts'] }}" +- name: "Add public master cluster hostname records to the private A records (single master)" + set_fact: + private_records: "{{ private_records | default([]) + [ { 'type': 'A', 'hostname': (hostvars[groups.masters[0]].openshift_master_cluster_public_hostname | replace(full_dns_domain, ''))[:-1], 'ip': hostvars[groups.masters[0]].private_v4 } ] }}" + when: + - hostvars[groups.masters[0]].openshift_master_cluster_public_hostname is defined + - openstack_num_masters == 1 + +- name: "Add public master cluster hostname records to the private A records (multi-master)" + set_fact: + private_records: "{{ private_records | default([]) + [ { 'type': 'A', 'hostname': (hostvars[groups.masters[0]].openshift_master_cluster_public_hostname | replace(full_dns_domain, ''))[:-1], 'ip': hostvars[groups.lb[0]].private_v4 } ] }}" + when: + - hostvars[groups.masters[0]].openshift_master_cluster_public_hostname is defined + - openstack_num_masters > 1 + - name: "Set the private DNS server to use the external value (if provided)" set_fact: nsupdate_server_private: "{{ external_nsupdate_keys['private']['server'] }}" @@ -50,6 +64,20 @@ with_items: "{{ groups['infra_hosts'] }}" when: hostvars[item]['public_v4'] is defined +- name: "Add public master cluster hostname records to the public A records (single master)" + 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.masters[0]].public_v4 } ] }}" + when: + - hostvars[groups.masters[0]].openshift_master_cluster_public_hostname is defined + - openstack_num_masters == 1 + +- name: "Add public master cluster hostname records to the public A records (multi-master)" + 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.lb[0]].public_v4 } ] }}" + when: + - hostvars[groups.masters[0]].openshift_master_cluster_public_hostname is defined + - openstack_num_masters > 1 + - name: "Set the public DNS server details to use the external value (if provided)" set_fact: nsupdate_server_public: "{{ external_nsupdate_keys['public']['server'] }}" |