summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorØystein Bedin <oybed@users.noreply.github.com>2017-06-13 15:35:22 -0400
committerEric Sauer <etsauer@gmail.com>2017-06-13 14:35:22 -0500
commit22e88c9ce8f81cb13c3d050455d332161a1acd83 (patch)
tree5947dff709c231bee754aea91731c4b1c1386eae /roles
parentf26abd53a9e2763091962421775fad102f0b05be (diff)
downloadopenshift-22e88c9ce8f81cb13c3d050455d332161a1acd83.tar.gz
openshift-22e88c9ce8f81cb13c3d050455d332161a1acd83.tar.bz2
openshift-22e88c9ce8f81cb13c3d050455d332161a1acd83.tar.xz
openshift-22e88c9ce8f81cb13c3d050455d332161a1acd83.zip
Update CASL to use nsupdate for DNS records (#48)
* Updated to use nsupdate for DNS records * Updated formatting of dict * Updating descriptive text * Support for external DNS config * Upgrading jinja2 to work correctly with latest templates * Latest update for nsupdate * Updated to use nsupdate for DNS records * Updated formatting of dict * Updating descriptive text * Support for external DNS config * Latest update for nsupdate * Updated to support external public/private DNS server(s) * Updated DNS server handling * Updated DNS server handling * Updated DNS server handling * Eliminated the from the sample inventories * Updated sample inventory to point to 2 separate DNS servers for private/public * Playbook clean-up * Adding 'python-dns' * splitting subscription manager calls to allow for a clean pre-install playbook
Diffstat (limited to 'roles')
-rw-r--r--roles/common/pre_tasks/pre_tasks.yml2
-rw-r--r--roles/dns-server-detect/defaults/main.yml3
-rw-r--r--roles/dns-server-detect/tasks/main.yml38
-rw-r--r--roles/openstack-stack/templates/heat_stack.yaml.j212
-rw-r--r--roles/openstack-stack/test/stack-create-test.yml4
5 files changed, 50 insertions, 9 deletions
diff --git a/roles/common/pre_tasks/pre_tasks.yml b/roles/common/pre_tasks/pre_tasks.yml
index cc4e64a0f..c5e79e89c 100644
--- a/roles/common/pre_tasks/pre_tasks.yml
+++ b/roles/common/pre_tasks/pre_tasks.yml
@@ -22,7 +22,7 @@
- name: Updating DNS domain to include env_id (if not empty)
set_fact:
- full_dns_domain: "{{ (env_id|trim == '') | ternary(dns_domain, env_id + '.' + dns_domain) }}"
+ full_dns_domain: "{{ (env_id|trim == '') | ternary(public_dns_domain, env_id + '.' + public_dns_domain) }}"
delegate_to: localhost
- name: Set the APP domain for OpenShift use
diff --git a/roles/dns-server-detect/defaults/main.yml b/roles/dns-server-detect/defaults/main.yml
new file mode 100644
index 000000000..58bd861cd
--- /dev/null
+++ b/roles/dns-server-detect/defaults/main.yml
@@ -0,0 +1,3 @@
+---
+
+external_nsupdate_keys: {}
diff --git a/roles/dns-server-detect/tasks/main.yml b/roles/dns-server-detect/tasks/main.yml
new file mode 100644
index 000000000..e8dd0acf0
--- /dev/null
+++ b/roles/dns-server-detect/tasks/main.yml
@@ -0,0 +1,38 @@
+---
+
+- fail:
+ msg: 'Missing required private DNS server(s)'
+ when:
+ - external_nsupdate_keys['private'] is undefined
+ - hostvars[groups['dns'][0]] is undefined
+
+- fail:
+ msg: 'Missing required public DNS server(s)'
+ when:
+ - external_nsupdate_keys['public'] is undefined
+ - hostvars[groups['dns'][0]] is undefined
+
+- name: "Set the private DNS server to use the external value (if provided)"
+ set_fact:
+ private_dns_server: "{{ external_nsupdate_keys['private']['server'] }}"
+ when:
+ - external_nsupdate_keys['private'] is defined
+
+- name: "Set the private DNS server to use the provisioned value"
+ set_fact:
+ private_dns_server: "{{ hostvars[groups['dns'][0]].openstack.private_v4 }}"
+ when:
+ - private_dns_server is undefined
+
+- name: "Set the public DNS server to use the external value (if provided)"
+ set_fact:
+ public_dns_server: "{{ external_nsupdate_keys['public']['server'] }}"
+ when:
+ - external_nsupdate_keys['public'] is defined
+
+- name: "Set the public DNS server to use the provisioned value"
+ set_fact:
+ public_dns_server: "{{ hostvars[groups['dns'][0]].openstack.public_v4 }}"
+ when:
+ - public_dns_server is undefined
+
diff --git a/roles/openstack-stack/templates/heat_stack.yaml.j2 b/roles/openstack-stack/templates/heat_stack.yaml.j2
index c367aabe7..09b62cba7 100644
--- a/roles/openstack-stack/templates/heat_stack.yaml.j2
+++ b/roles/openstack-stack/templates/heat_stack.yaml.j2
@@ -381,7 +381,7 @@ resources:
params:
cluster_id: {{ stack_name }}
k8s_type: etcd
- cluster_env: {{ dns_domain }}
+ cluster_env: {{ public_dns_domain }}
cluster_id: {{ stack_name }}
group:
str_replace:
@@ -421,7 +421,7 @@ resources:
params:
cluster_id: {{ stack_name }}
k8s_type: lb
- cluster_env: {{ dns_domain }}
+ cluster_env: {{ public_dns_domain }}
cluster_id: {{ stack_name }}
group:
str_replace:
@@ -461,7 +461,7 @@ resources:
params:
cluster_id: {{ stack_name }}
k8s_type: master
- cluster_env: {{ dns_domain }}
+ cluster_env: {{ public_dns_domain }}
cluster_id: {{ stack_name }}
group:
str_replace:
@@ -505,7 +505,7 @@ resources:
cluster_id: {{ stack_name }}
k8s_type: node
subtype: app
- cluster_env: {{ dns_domain }}
+ cluster_env: {{ public_dns_domain }}
cluster_id: {{ stack_name }}
group:
str_replace:
@@ -548,7 +548,7 @@ resources:
cluster_id: {{ stack_name }}
k8s_type: node
subtype: infra
- cluster_env: {{ dns_domain }}
+ cluster_env: {{ public_dns_domain }}
cluster_id: {{ stack_name }}
group:
str_replace:
@@ -591,7 +591,7 @@ resources:
params:
cluster_id: {{ stack_name }}
k8s_type: dns
- cluster_env: {{ dns_domain }}
+ cluster_env: {{ public_dns_domain }}
cluster_id: {{ stack_name }}
group:
str_replace:
diff --git a/roles/openstack-stack/test/stack-create-test.yml b/roles/openstack-stack/test/stack-create-test.yml
index 94e312ee3..6cbd7ff30 100644
--- a/roles/openstack-stack/test/stack-create-test.yml
+++ b/roles/openstack-stack/test/stack-create-test.yml
@@ -3,8 +3,8 @@
roles:
- role: openstack-stack
stack_name: test-stack
- dns_domain: "{{ openstack_dns_domain }}"
- dns_nameservers: "{{ openstack_nameservers }}"
+ dns_domain: "{{ public_dns_domain }}"
+ dns_nameservers: "{{ public_dns_nameservers }}"
subnet_prefix: "{{ openstack_subnet_prefix }}"
ssh_public_key: "{{ openstack_ssh_public_key }}"
openstack_image: "{{ openstack_default_image_name }}"