---
- hosts: localhost
  connection: local
  become: no
  gather_facts: no
  tasks:
  - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml
  - add_host:
      name: "{{ item }}"
      groups: l_oo_all_hosts
    with_items: "{{ g_all_hosts }}"

- hosts: l_oo_all_hosts
  gather_facts: no
  tasks:
  - include_vars: ../../byo/openshift-cluster/cluster_hosts.yml

- include: ../../common/openshift-cluster/evaluate_groups.yml
- include: ../../common/openshift-master/validate_restart.yml

- name: Restart masters
  hosts: oo_masters_to_config
  vars:
    openshift_master_ha: "{{ groups.oo_masters_to_config | length > 1 }}"
  serial: 1
  tasks:
  - include: restart_hosts.yml
    when: openshift.common.rolling_restart_mode == 'system'
  - include: restart_services.yml
    when: openshift.common.rolling_restart_mode == 'services'