Skip to content
Snippets Groups Projects
cluster.yml 4.45 KiB
Newer Older
  • Learn to ignore specific revisions
  • Smaine Kahlouch's avatar
    Smaine Kahlouch committed
    ---
    
    - name: Check ansible version
      import_playbook: ansible_version.yml
    
    - name: Ensure compatibility with old groups
      import_playbook: legacy_groups.yml
    
      gather_facts: False
    
      environment: "{{ proxy_disable_env }}"
    
        - { role: kubespray-defaults }
        - { role: bastion-ssh-config, tags: ["localhost", "bastion"] }
    
    - hosts: k8s_cluster:etcd
    
      any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
    
      gather_facts: false
    
      environment: "{{ proxy_disable_env }}"
    
    Antoine Legrand's avatar
    Antoine Legrand committed
        - { role: bootstrap-os, tags: bootstrap-os}
    
    - name: Gather facts
    
      tags: always
    
      import_playbook: facts.yml
    
    
    - hosts: k8s_cluster:etcd
    
      gather_facts: False
    
      any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
    
      environment: "{{ proxy_disable_env }}"
    
      roles:
    
        - { role: kubernetes/preinstall, tags: preinstall }
    
        - { role: "container-engine", tags: "container-engine", when: deploy_container_engine }
    
        - { role: download, tags: download, when: "not skip_downloads" }
    
    - hosts: etcd:kube_control_plane
    
      gather_facts: False
    
      any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
    
      environment: "{{ proxy_disable_env }}"
    
        - role: etcd
          tags: etcd
          vars:
            etcd_cluster_setup: true
            etcd_events_cluster_setup: "{{ etcd_events_cluster_enabled }}"
    
      gather_facts: False
    
      any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
    
      environment: "{{ proxy_disable_env }}"
    
        - role: etcd
          tags: etcd
          vars:
            etcd_cluster_setup: false
            etcd_events_cluster_setup: false
    
          when:
            - etcd_deployment_type != "kubeadm"
            - kube_network_plugin in ["calico", "flannel", "canal", "cilium"] or cilium_deploy_additionally | default(false) | bool
            - kube_network_plugin != "calico" or calico_datastore == "etcd"
    
      gather_facts: False
    
      any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
    
      environment: "{{ proxy_disable_env }}"
    
    Antoine Legrand's avatar
    Antoine Legrand committed
        - { role: kubernetes/node, tags: node }
    
    Smaine Kahlouch's avatar
    Smaine Kahlouch committed
    
    
    - hosts: kube_control_plane
    
      gather_facts: False
    
      any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
    
      environment: "{{ proxy_disable_env }}"
    
    Smaine Kahlouch's avatar
    Smaine Kahlouch committed
      roles:
    
        - { role: kubernetes/control-plane, tags: master }
    
        - { role: kubernetes/client, tags: client }
        - { role: kubernetes-apps/cluster_roles, tags: cluster-roles }
    
      gather_facts: False
    
      any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
    
      environment: "{{ proxy_disable_env }}"
    
      roles:
    
        - { role: kubernetes/kubeadm, tags: kubeadm}
    
        - { role: kubernetes/node-label, tags: node-label }
    
        - { role: network_plugin, tags: network }
    
      gather_facts: False
    
      any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
    
      environment: "{{ proxy_disable_env }}"
    
        - { role: kubespray-defaults }
        - { role: network_plugin/calico/rr, tags: ['network', 'calico_rr'] }
    
    - hosts: kube_control_plane[0]
    
      gather_facts: False
    
      any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
    
      environment: "{{ proxy_disable_env }}"
    
      roles:
    
        - { role: kubespray-defaults }
        - { role: win_nodes/kubernetes_patch, tags: ["master", "win_nodes"] }
    
    - hosts: kube_control_plane
    
      gather_facts: False
    
      any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
    
      environment: "{{ proxy_disable_env }}"
    
        - { role: kubernetes-apps/external_cloud_controller, tags: external-cloud-controller }
    
        - { role: kubernetes-apps/network_plugin, tags: network }
    
        - { role: kubernetes-apps/policy_controller, tags: policy-controller }
    
        - { role: kubernetes-apps/ingress_controller, tags: ingress-controller }
    
        - { role: kubernetes-apps/external_provisioner, tags: external-provisioner }
    
        - { role: kubernetes-apps, tags: apps }
    
    - name: Apply resolv.conf changes now that cluster DNS is up
      hosts: k8s_cluster
    
      gather_facts: False
    
      any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
    
      environment: "{{ proxy_disable_env }}"
    
        - { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf, dns_late: true }