summaryrefslogtreecommitdiffstats
path: root/playbooks/openshift-node/private/restart.yml
diff options
context:
space:
mode:
authorRussell Teague <rteague@redhat.com>2017-11-16 16:32:38 -0500
committerRussell Teague <rteague@redhat.com>2017-11-21 15:05:23 -0500
commitd448704c0e67494387d80c2fa2348d25e848c8d3 (patch)
treef88c034a0da1c7bc7f9c42c1e07ea1a216bde22b /playbooks/openshift-node/private/restart.yml
parent8d12df4b390832664f0be2d9955440bdeb00bb29 (diff)
downloadopenshift-d448704c0e67494387d80c2fa2348d25e848c8d3.tar.gz
openshift-d448704c0e67494387d80c2fa2348d25e848c8d3.tar.bz2
openshift-d448704c0e67494387d80c2fa2348d25e848c8d3.tar.xz
openshift-d448704c0e67494387d80c2fa2348d25e848c8d3.zip
Playbook Consolidation - openshift-node
Diffstat (limited to 'playbooks/openshift-node/private/restart.yml')
-rw-r--r--playbooks/openshift-node/private/restart.yml61
1 files changed, 61 insertions, 0 deletions
diff --git a/playbooks/openshift-node/private/restart.yml b/playbooks/openshift-node/private/restart.yml
new file mode 100644
index 000000000..c3beb59b7
--- /dev/null
+++ b/playbooks/openshift-node/private/restart.yml
@@ -0,0 +1,61 @@
+---
+- name: Restart nodes
+ hosts: oo_nodes_to_config
+ serial: "{{ openshift_restart_nodes_serial | default(1) }}"
+
+ roles:
+ - lib_openshift
+
+ tasks:
+ - name: Restart docker
+ service:
+ name: docker
+ state: restarted
+ register: l_docker_restart_docker_in_node_result
+ until: not l_docker_restart_docker_in_node_result | failed
+ retries: 3
+ delay: 30
+
+ - name: Update docker facts
+ openshift_facts:
+ role: docker
+
+ - name: Restart containerized services
+ service:
+ name: "{{ item }}"
+ state: started
+ with_items:
+ - etcd_container
+ - openvswitch
+ - "{{ openshift.common.service_type }}-master-api"
+ - "{{ openshift.common.service_type }}-master-controllers"
+ - "{{ openshift.common.service_type }}-node"
+ failed_when: false
+ when: openshift.common.is_containerized | bool
+
+ - name: Wait for master API to come back online
+ wait_for:
+ host: "{{ openshift.common.hostname }}"
+ state: started
+ delay: 10
+ port: "{{ openshift.master.api_port }}"
+ timeout: 600
+ when: inventory_hostname in groups.oo_masters_to_config
+
+ - name: restart node
+ service:
+ name: "{{ openshift.common.service_type }}-node"
+ state: restarted
+
+ - name: Wait for node to be ready
+ oc_obj:
+ state: list
+ kind: node
+ name: "{{ openshift.common.hostname | lower }}"
+ register: node_output
+ delegate_to: "{{ groups.oo_first_master.0 }}"
+ when: inventory_hostname in groups.oo_nodes_to_config
+ until: node_output.results.returncode == 0 and node_output.results.results[0].status.conditions | selectattr('type', 'match', '^Ready$') | map(attribute='status') | join | bool == True
+ # Give the node two minutes to come back online.
+ retries: 24
+ delay: 5