diff options
author | Bogdan Dobrelya <bdobreli@redhat.com> | 2017-12-07 12:42:18 +0100 |
---|---|---|
committer | Bogdan Dobrelya <bdobreli@redhat.com> | 2017-12-11 11:04:25 +0100 |
commit | cf4ec9c8205e84288bf35f93e7f2f4190d2bf9a4 (patch) | |
tree | 99c2ba9da3b276722bc4cf923950c576e6812ca5 | |
parent | 886f6ca5bf4724b9221fdf5160fde39159e0ea6e (diff) | |
download | openshift-cf4ec9c8205e84288bf35f93e7f2f4190d2bf9a4.tar.gz openshift-cf4ec9c8205e84288bf35f93e7f2f4190d2bf9a4.tar.bz2 openshift-cf4ec9c8205e84288bf35f93e7f2f4190d2bf9a4.tar.xz openshift-cf4ec9c8205e84288bf35f93e7f2f4190d2bf9a4.zip |
Allow 2 sets of hostnames for openstack provider
Support private/public hostnames suffixes for DNS records.
Real hostnames, Inventory variables, Nova servers and ansible
hostnames will ignore the custom suffixes. Those are only for
nsupdates sent to external DNS servers.
Related change: add openshift_openstack_public_dns_domain to
the role defaults to not rely on the group vars example only.
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
Co-authored-by: Tomas Sedovic <tsedovic@redhat.com>
-rw-r--r-- | playbooks/openstack/advanced-configuration.md | 21 | ||||
-rw-r--r-- | roles/openshift_openstack/defaults/main.yml | 3 | ||||
-rw-r--r-- | roles/openshift_openstack/tasks/populate-dns.yml | 4 |
3 files changed, 21 insertions, 7 deletions
diff --git a/playbooks/openstack/advanced-configuration.md b/playbooks/openstack/advanced-configuration.md index 403e0e1a7..2c9b70b5f 100644 --- a/playbooks/openstack/advanced-configuration.md +++ b/playbooks/openstack/advanced-configuration.md @@ -159,11 +159,22 @@ So the provisioned cluster nodes will start using those natively as default nameservers. Technically, this allows to deploy OpenShift clusters without dnsmasq proxies. -The `openshift_openstack_clusterid` and `openshift_openstack_public_dns_domain` will form the cluster's DNS domain all -your servers will be under. With the default values, this will be -`openshift.example.com`. For workloads, the default subdomain is 'apps'. -That sudomain can be set as well by the `openshift_openstack_app_subdomain` variable in -the inventory. +The `openshift_openstack_clusterid` and `openshift_openstack_public_dns_domain` +will form the cluster's public DNS domain all your servers will be under. With +the default values, this will be `openshift.example.com`. For workloads, the +default subdomain is 'apps'. That sudomain can be set as well by the +`openshift_openstack_app_subdomain` variable in the inventory. + +If you want to use a two sets of hostnames for public and private/prefixed DNS +records for your externally managed public DNS server, you can specify +`openshift_openstack_public_hostname_suffix` and/or +`openshift_openstack_private_hostname_suffix`. The suffixes will be added +to the nsupdate records sent to the external DNS server. Those are empty by default. + +**Note** the real hostnames, Nova servers' or ansible hostnames and inventory +variables will not be updated. The deployment may be done on arbitrary named +hosts with the hostnames managed by cloud-init. Inventory hostnames will ignore +the suffixes. The `openstack_<role name>_hostname` is a set of variables used for customising public names of Nova servers provisioned with a given role. When such a variable stays commented, diff --git a/roles/openshift_openstack/defaults/main.yml b/roles/openshift_openstack/defaults/main.yml index 929b76f54..65a647b8f 100644 --- a/roles/openshift_openstack/defaults/main.yml +++ b/roles/openshift_openstack/defaults/main.yml @@ -44,6 +44,9 @@ openshift_openstack_container_storage_setup: # populate-dns openshift_openstack_dns_records_add: [] +openshift_openstack_public_hostname_suffix: "" +openshift_openstack_private_hostname_suffix: "" +openshift_openstack_public_dns_domain: "example.com" openshift_openstack_full_dns_domain: "{{ (openshift_openstack_clusterid|trim == '') | ternary(openshift_openstack_public_dns_domain, openshift_openstack_clusterid + '.' + openshift_openstack_public_dns_domain) }}" openshift_openstack_app_subdomain: "apps" diff --git a/roles/openshift_openstack/tasks/populate-dns.yml b/roles/openshift_openstack/tasks/populate-dns.yml index eae4967f7..cf2ead5c3 100644 --- a/roles/openshift_openstack/tasks/populate-dns.yml +++ b/roles/openshift_openstack/tasks/populate-dns.yml @@ -1,7 +1,7 @@ --- - name: "Generate list of private A records" set_fact: - private_records: "{{ private_records | default([]) + [ { 'type': 'A', 'hostname': hostvars[item]['ansible_hostname'], 'ip': hostvars[item]['private_v4'] } ] }}" + private_records: "{{ private_records | default([]) + [ { 'type': 'A', 'hostname': hostvars[item]['ansible_hostname'] + openshift_openstack_private_hostname_suffix, 'ip': hostvars[item]['private_v4'] } ] }}" with_items: "{{ groups['cluster_hosts'] }}" - name: "Add wildcard records to the private A records for infrahosts" @@ -48,7 +48,7 @@ - name: "Generate list of public A records" set_fact: - public_records: "{{ public_records | default([]) + [ { 'type': 'A', 'hostname': hostvars[item]['ansible_hostname'], 'ip': hostvars[item]['public_v4'] } ] }}" + public_records: "{{ public_records | default([]) + [ { 'type': 'A', 'hostname': hostvars[item]['ansible_hostname'] + openshift_openstack_public_hostname_suffix, 'ip': hostvars[item]['public_v4'] } ] }}" with_items: "{{ groups['cluster_hosts'] }}" when: hostvars[item]['public_v4'] is defined |