summaryrefslogtreecommitdiffstats
path: root/playbooks/common/openshift-cluster/set_master_launch_facts_tasks.yml
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks/common/openshift-cluster/set_master_launch_facts_tasks.yml')
-rw-r--r--playbooks/common/openshift-cluster/set_master_launch_facts_tasks.yml11
1 files changed, 11 insertions, 0 deletions
diff --git a/playbooks/common/openshift-cluster/set_master_launch_facts_tasks.yml b/playbooks/common/openshift-cluster/set_master_launch_facts_tasks.yml
new file mode 100644
index 000000000..118727273
--- /dev/null
+++ b/playbooks/common/openshift-cluster/set_master_launch_facts_tasks.yml
@@ -0,0 +1,11 @@
+---
+- set_fact: k8s_type="master"
+
+- name: Generate master instance names(s)
+ set_fact:
+ scratch_name: "{{ cluster_id }}-{{ k8s_type }}-{{ '%05x' | format(1048576 | random) }}"
+ register: master_names_output
+ with_sequence: start=1 end={{ num_masters }}
+
+- set_fact:
+ master_names: "{{ master_names_output.results | oo_collect('ansible_facts') | oo_collect('scratch_name') }}"