summaryrefslogtreecommitdiffstats
path: root/playbooks/common/openshift-cluster/set_infra_launch_facts_tasks.yml
blob: 01d70a1a6144646184c965deb303f643d8d92126 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
- set_fact: k8s_type=infra
- set_fact: sub_host_type="{{ type }}"
- set_fact: number_infra="{{ count }}"

- name: Generate infra  instance names(s)
  set_fact:
    scratch_name: "{{ cluster_id }}-{{ k8s_type }}-{{ sub_host_type }}-{{ '%05x' | format(1048576 | random) }}"
  register: infra_names_output
  with_sequence: count={{ number_infra }}

- set_fact:
    infra_names: "{{ infra_names_output.results | default([], true)
                    | oo_collect('ansible_facts')
                    | oo_collect('scratch_name') }}"