blob: 9a883feedb10ae9c2caf26c94690957f34e71fa1 (
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
---
# Necessary because when you're on a node that's also a master the master will be
# restarted after the node restarts docker and it will take up to 60 seconds for
# systemd to start the master again
- name: Wait for master API to become available before proceeding
# Using curl here since the uri module requires python-httplib2 and
# wait_for port doesn't provide health information.
command: >
curl --silent --tlsv1.2
{% if openshift.common.version_gte_3_2_or_1_2 | bool %}
--cacert {{ openshift.common.config_base }}/master/ca-bundle.crt
{% else %}
--cacert {{ openshift.common.config_base }}/master/ca.crt
{% endif %}
{{ openshift_node_master_api_url }}/healthz/ready
args:
# Disables the following warning:
# Consider using get_url or uri module rather than running curl
warn: no
register: api_available_output
until: api_available_output.stdout == 'ok'
retries: 120
delay: 1
changed_when: false
when: openshift.common.is_containerized | bool
delegate_to: "{{ openshift_master_host }}"
run_once: true
- name: Wait for Node Registration
oc_obj:
name: "{{ openshift.node.nodename }}"
kind: node
state: list
register: get_node
until: "'metadata' in get_node.results.results[0]"
retries: 50
delay: 5
when: "'nodename' in openshift.node"
delegate_to: "{{ openshift_master_host }}"
- name: Set node schedulability
oadm_manage_node:
node: "{{ openshift.node.nodename | lower }}"
schedulable: "{{ 'true' if openshift.node.schedulable | bool else 'false' }}"
retries: 10
delay: 5
register: node_schedulable
until: node_schedulable|succeeded
when: "'nodename' in openshift.node"
delegate_to: "{{ openshift_master_host }}"
- name: Label nodes
oc_label:
name: "{{ openshift.node.nodename }}"
kind: node
state: add
labels: "{{ openshift.node.labels | oo_dict_to_list_of_dict }}"
namespace: default
when:
- "'nodename' in openshift.node"
- "'labels' in openshift.node"
- openshift.node.labels != {}
delegate_to: "{{ openshift_master_host }}"
|