---

- name: Prepare Install Checkpoint Start
  hosts: "{{ g_prepare_hosts|default('k8s-cluster:etcd:calico-rr') }}"
  gather_facts: false
  tasks:
  - name: Set prepare install 'In Progress'
    run_once: true
    set_stats:
      data:
        installer_phase_prepare:
          title: "prepare the environment and pre-check"
          playbook: "playbooks/tep-prepare/deploy.yml"
          status: "In Progress"
          start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"

- name: Prepare environment and pre-check
  hosts: "{{ g_prepare_hosts|default('k8s-cluster:etcd:calico-rr') }}"
  any_errors_fatal: true
  roles:
  - prepare

- name: Prepare Install Checkpoint End
  hosts: "{{ g_prepare_hosts|default('k8s-cluster:etcd:calico-rr') }}"
  gather_facts: false
  tasks:
  - name: Set prepare install 'Complete'
    run_once: true
    set_stats:
      data:
        installer_phase_prepare:
          status: "Complete"
          end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
