---
- name: Deploy entire Airflow cluster
  hosts: all
  gather_facts: true
  vars_files:
    - group_vars/all.yml
    - group_vars/all/vault.yml
  tasks:
    - name: Ensure shared Docker network exists
      community.docker.docker_network:
        name: airflow_proxynet
        driver: bridge

- name: Deploy master
  import_playbook: playbook-master.yml
  when: inventory_hostname in groups['airflow_master']

- name: Deploy workers
  import_playbook: playbook-worker.yml
  when: inventory_hostname in groups['airflow_workers']
