---
#####################
# Install Python
#####################

- hosts: all
  gather_facts: false # As Python is not yet installed, we cannot gather host facts

  tasks:
    - name: Install Python
      raw: "apt-get -y -q install python"
      become: true

#######################
# Setup K8s components
#######################

- hosts: etcd
  roles:
    - common
    - etcd

- hosts: controller
  roles:
    - common
    - controller

- hosts: worker
  roles:
    - common
    - worker

---
#####################
# Install Python
#####################

- hosts: all
  gather_facts: false # As Python is not yet installed, we cannot gather host facts

  tasks:
    - name: Install Python
      raw: "apt-get -y -q install python"
      become: true
      retries: 10
      delay: 20
      # If you run this playbook immediately after Terraform, ssh may not be ready to respond yet

#######################
# Setup K8s components
#######################

- hosts: etcd
  roles:
    - common
    - etcd

- hosts: controller
  roles:
    - common
    - controller

- hosts: worker
  roles:
    - common
    - worker

Add retry to install python, in case the playbook is run immediately after Terraform, when sshd is not yet ready to respond
Add retry to install python, in case the playbook is run immediately after Terraform, when sshd is not yet ready to respond
