---
- name: Management Install Checkpoint Start
  hosts: all
  gather_facts: false
  tasks:
  - name: Set Management install 'In Progress'
    run_once: true
    set_stats:
      data:
        installer_phase_management:
          title: "Management Install"
          playbook: "playbooks/openshift-management/config.yml"
          status: "In Progress"
          start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"

- import_playbook: config-sebool.yml

- name: Setup CFME
  hosts: oo_first_master
  pre_tasks:
  - name: Create a temporary place to evaluate the PV templates
    command: mktemp -d /tmp/openshift-ansible-XXXXXXX
    register: r_openshift_management_mktemp
    changed_when: false

  tasks:
  - name: Run the CFME Setup Role
    import_role:
      name: openshift_management
    vars:
      template_dir: "{{ hostvars[groups.masters.0].r_openshift_management_mktemp.stdout }}"

- name: Management Install Checkpoint End
  hosts: all
  gather_facts: false
  tasks:
  - name: Set Management install 'Complete'
    run_once: true
    set_stats:
      data:
        installer_phase_management:
          status: "Complete"
          end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
