---
- name: etcd Install Checkpoint Start
  hosts: all
  gather_facts: false
  tasks:
  - name: Set etcd install 'In Progress'
    run_once: true
    set_stats:
      data:
        installer_phase_etcd:
          status: "In Progress"
          start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"

- import_playbook: ca.yml

- import_playbook: certificates.yml

- name: Configure etcd
  hosts: oo_etcd_to_config
  any_errors_fatal: true
  roles:
  - role: openshift_clock
  - role: openshift_etcd
    etcd_peers: "{{ groups.oo_etcd_to_config | default([], true) }}"
    etcd_ca_host: "{{ groups.oo_etcd_to_config.0 }}"
    etcd_certificates_etcd_hosts: "{{ groups.oo_etcd_to_config | default([], true) }}"
  - role: nickhammond.logrotate

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