summaryrefslogtreecommitdiffstats
path: root/roles/openshift_master_post/tasks/main.yml
blob: 391c4a293067e639d82e39e077bc579c9a6ca1ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
- name: Get Nodes Config
  shell: osc get nodes -o json | sed -e '/"resourceVersion"/d'
  register: output

- name: Set node regions
    node_facts: "{{ output.stdout | from_json
                  | oo_set_node_label('region', {{omp_node_region}}) }}"

- name: Set infra node labels
  set_fact:
    node_final_facts: "{{ output.stdout | from_json
                  | oo_set_node_label('region', {{omp_infra_node_label}},
                  {{omp_infra_node_filter_key}}, {{omp_infra_node_filter_value}}) }}"

- name: Write node config to temp file
  copy:
    content: "{{ node_final_facts }}"
    dest: /tmp/nodes.json

- name: Import new node config
  shell: osc update node -f /tmp/nodes.json

- name: Remove node temp file
  file:
    path: /tmp/nodes.json
	state: absent