---
- name: Restart docker
  service: name=docker state=restarted
  register: l_docker_restart_docker_in_upgrade_result
  until: not (l_docker_restart_docker_in_upgrade_result is failed)
  retries: 3
  delay: 30

- name: Restart openvswitch service
  service:
    name: openvswitch
    state: started
  when:
    - openshift_is_containerized | bool
    - openshift_use_openshift_sdn | bool

- name: Restart containerized services
  service: name={{ item }} state=started
  with_items:
    - etcd_container
    - "{{ openshift_service_type }}-master-api"
    - "{{ openshift_service_type }}-master-controllers"
    - "{{ openshift_service_type }}-node"
  failed_when: false
  when: openshift_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
