---
- name: Install, configure Kubernetes cluster, and join nodes
  hosts: all
  become: yes
  vars:
    kubernetes_version: 'v1.29'
    project_path: 'prerelease:/main'
  vars_files:
    - secrets.yaml
  tasks:
    - name: Include Bootstrap Cluster Tasks
      import_tasks: tasks/boostrap_cluster.yml
      tags: [bootstrap]

    - name: Include Setup Hosts Tasks
      import_tasks: tasks/setup_hosts.yml
      tags: [setup_hosts]

    - name: Include Cherry Configuration Tasks
      import_tasks: tasks/cherry.yml
      tags: [cherry]

  handlers:
    - name: Apply sysctl settings
      ansible.builtin.sysctl:
        sysctl_set: yes
        state: present
        reload: yes
        name: net.ipv4.ip_forward
        value: '1'
