summaryrefslogtreecommitdiffstats
path: root/roles/common/pre_tasks/pre_tasks.yml
diff options
context:
space:
mode:
authorTomas Sedovic <tomas@sedovic.cz>2017-06-14 16:28:00 +0200
committerTomas Sedovic <tomas@sedovic.cz>2017-06-14 16:28:00 +0200
commit6241e33432ea88cf9c5bc67db6d09c90b2e891ba (patch)
tree4e82fafc32a598d9cf5c1c72b9c20e83268b0251 /roles/common/pre_tasks/pre_tasks.yml
parent672f8e155bdc7244d4bf0cbcca5e4be5f063d55f (diff)
parent22e88c9ce8f81cb13c3d050455d332161a1acd83 (diff)
downloadopenshift-6241e33432ea88cf9c5bc67db6d09c90b2e891ba.tar.gz
openshift-6241e33432ea88cf9c5bc67db6d09c90b2e891ba.tar.bz2
openshift-6241e33432ea88cf9c5bc67db6d09c90b2e891ba.tar.xz
openshift-6241e33432ea88cf9c5bc67db6d09c90b2e891ba.zip
Merge redhat-cop/casl-ansible into openstack-provider
This imports the openstack provisioning bits of: https://github.com/redhat-cop/casl-ansible taking care to preserve the original history of those files.
Diffstat (limited to 'roles/common/pre_tasks/pre_tasks.yml')
-rw-r--r--roles/common/pre_tasks/pre_tasks.yml38
1 files changed, 38 insertions, 0 deletions
diff --git a/roles/common/pre_tasks/pre_tasks.yml b/roles/common/pre_tasks/pre_tasks.yml
new file mode 100644
index 000000000..c5e79e89c
--- /dev/null
+++ b/roles/common/pre_tasks/pre_tasks.yml
@@ -0,0 +1,38 @@
+---
+- name: Generate Environment ID
+ set_fact:
+ env_random_id: "{{ ansible_date_time.epoch }}"
+ run_once: true
+ delegate_to: localhost
+
+- name: Set default Environment ID
+ set_fact:
+ default_env_id: "casl-{{ lookup('env','OS_USERNAME') }}-{{ env_random_id }}"
+ delegate_to: localhost
+
+- name: Setting Common Facts
+ set_fact:
+ env_id: "{{ env_id | default(default_env_id) }}"
+ delegate_to: localhost
+
+- name: Set Dynamic Inventory Filters
+ shell: >
+ export OS_INV_FILTER_KEY=clusterid && OS_INV_FILTER_VALUE={{ env_id }}
+ delegate_to: localhost
+
+- name: Updating DNS domain to include env_id (if not empty)
+ set_fact:
+ 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
+ set_fact:
+ openshift_app_domain: "{{ openshift_app_domain | default('apps') }}"
+ delegate_to: localhost
+
+- name: Set the default app domain for routing purposes
+ set_fact:
+ openshift_master_default_subdomain: "{{ openshift_app_domain }}.{{ full_dns_domain }}"
+ delegate_to: localhost
+ when:
+ - openshift_master_default_subdomain is undefined