---
- name: Set oo_option facts
  hosts: oo_all_hosts
  tags:
  - always
  tasks:
  - set_fact:
      openshift_docker_additional_registries: "{{ lookup('oo_option', 'docker_additional_registries') }}"
    when: openshift_docker_additional_registries is not defined
  - set_fact:
      openshift_docker_insecure_registries: "{{ lookup('oo_option',  'docker_insecure_registries') }}"
    when: openshift_docker_insecure_registries is not defined
  - set_fact:
      openshift_docker_blocked_registries: "{{ lookup('oo_option', 'docker_blocked_registries') }}"
    when: openshift_docker_blocked_registries is not defined
  - set_fact:
      openshift_docker_options: "{{ lookup('oo_option', 'docker_options') }}"
    when: openshift_docker_options is not defined
  - set_fact:
      openshift_docker_log_driver: "{{ lookup('oo_option', 'docker_log_driver') }}"
    when: openshift_docker_log_driver is not defined
  - set_fact:
      openshift_docker_log_options: "{{ lookup('oo_option', 'docker_log_options') }}"
    when: openshift_docker_log_options is not defined

- name: Disable excluders
  hosts: oo_masters_to_config:oo_nodes_to_config
  tags:
  - always
  gather_facts: no
  roles:
  - role: openshift_excluder
    r_openshift_excluder_action: disable
    r_openshift_excluder_service_type: "{{ openshift.common.service_type }}"

- include: ../openshift-etcd/config.yml
  tags:
  - etcd

- include: ../openshift-nfs/config.yml
  tags:
  - nfs

- include: ../openshift-loadbalancer/config.yml
  tags:
  - loadbalancer

- include: ../openshift-master/config.yml
  tags:
  - master

- include: additional_config.yml
  tags:
  - master

- include: ../openshift-node/config.yml
  tags:
  - node

- include: openshift_hosted.yml
  tags:
  - hosted

- name: Re-enable excluder if it was previously enabled
  hosts: oo_masters_to_config:oo_nodes_to_config
  tags:
  - always
  gather_facts: no
  roles:
  - role: openshift_excluder
    r_openshift_excluder_action: enable
    r_openshift_excluder_service_type: "{{ openshift.common.service_type }}"
