summaryrefslogtreecommitdiffstats
path: root/playbooks/provisioning
diff options
context:
space:
mode:
authorTomas Sedovic <tomas@sedovic.cz>2017-06-02 14:39:21 +0200
committerTomas Sedovic <tomas@sedovic.cz>2017-06-14 16:40:12 +0200
commitc3cefa9996fb67b846f44eed78644a0f52d76df1 (patch)
tree2497cc5f278fe5c37009c314e9dbc97bc4e9b96c /playbooks/provisioning
parent269278b56ed03eca8d5e220275ccdb5b7fa1c07d (diff)
downloadopenshift-c3cefa9996fb67b846f44eed78644a0f52d76df1.tar.gz
openshift-c3cefa9996fb67b846f44eed78644a0f52d76df1.tar.bz2
openshift-c3cefa9996fb67b846f44eed78644a0f52d76df1.tar.xz
openshift-c3cefa9996fb67b846f44eed78644a0f52d76df1.zip
Move pre_tasks from to the openstack provisioner
We should probably not pollute the role namespace with a name as common as "common". Moving the pre_task.yml to provisioners/openstack instead.
Diffstat (limited to 'playbooks/provisioning')
-rw-r--r--playbooks/provisioning/openstack/pre_tasks.yml39
1 files changed, 39 insertions, 0 deletions
diff --git a/playbooks/provisioning/openstack/pre_tasks.yml b/playbooks/provisioning/openstack/pre_tasks.yml
new file mode 100644
index 000000000..8446bdfbc
--- /dev/null
+++ b/playbooks/provisioning/openstack/pre_tasks.yml
@@ -0,0 +1,39 @@
+---
+- 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
+ become: false
+ 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