---
- 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
