diff options
author | Andrew Butcher <abutcher@redhat.com> | 2016-10-26 14:59:05 -0400 |
---|---|---|
committer | Andrew Butcher <abutcher@redhat.com> | 2017-02-02 15:29:11 -0500 |
commit | 917e871843192b107776ce8459b87f3960e455ed (patch) | |
tree | 08acb27fa87578137bb21917487c2521cd08aa82 /playbooks/common/openshift-node | |
parent | c9480811d2222693abe4460ca42c292b289a0ef4 (diff) | |
download | openshift-917e871843192b107776ce8459b87f3960e455ed.tar.gz openshift-917e871843192b107776ce8459b87f3960e455ed.tar.bz2 openshift-917e871843192b107776ce8459b87f3960e455ed.tar.xz openshift-917e871843192b107776ce8459b87f3960e455ed.zip |
Restructure certificate redeploy playbooks
Diffstat (limited to 'playbooks/common/openshift-node')
-rw-r--r-- | playbooks/common/openshift-node/restart.yml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/playbooks/common/openshift-node/restart.yml b/playbooks/common/openshift-node/restart.yml new file mode 100644 index 000000000..6e9b1cca3 --- /dev/null +++ b/playbooks/common/openshift-node/restart.yml @@ -0,0 +1,47 @@ +--- +- name: Restart nodes + hosts: oo_nodes_to_config + serial: "{{ openshift_restart_nodes_serial | default(1) }}" + tasks: + - name: Restart docker + service: name=docker state=restarted + + - 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" + - "{{ 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 }}" + 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 + command: > + {{ hostvars[groups.oo_first_master.0].openshift.common.client_binary }} get node {{ openshift.common.hostname | lower }} --no-headers + register: node_output + delegate_to: "{{ groups.oo_first_master.0 }}" + when: inventory_hostname in groups.oo_nodes_to_config + until: "{{ node_output.stdout.split()[1].startswith('Ready')}}" + # Give the node two minutes to come back online. + retries: 24 + delay: 5 |