---

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

- name: Setup etcd cluster
  hosts: etcd
  any_errors_fatal: true
  tasks:
  - import_role:
      name: etcd
      tasks_from: main.yml
    vars:
      etcd_cluster_setup: "{{ g_etcd_cluster_setup|default(true) }}"

- name: Update ca-certificates
  hosts: k8s-cluster:calico-rr
  any_errors_fatal: true
  tasks:
  - import_role:
      name: etcd
      tasks_from: main.yml
    vars:
      etcd_cluster_setup: false

- name: etcd Install Checkpoint End
  hosts: etcd
  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') }}"
