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

- name: Generate node instance names(s)
  set_fact:
    scratch_name: "{{ openshift_cluster_id | default('default') }}-{{ k8s_type }}-{{ sub_host_type }}-{{ '%05x' | format(1048576 | random) }}"
  register: node_names_output
  with_sequence: count={{ number_nodes }}

- set_fact:
    node_names: "{{ node_names_output.results | default([])
                    | oo_collect('ansible_facts')
                    | oo_collect('scratch_name') }}"