---
- name: Cilium | Ensure the cilium Helm chart archive is available
  copy:
    src: >-
      {{ .binary_dir }}/cni/cilium/cilium-{{ .cni.cilium_version }}.tgz
    dest: >-
      /etc/kubernetes/cni/cilium-{{ .cni.cilium_version }}.tgz

- name: Cilium | Create the cilium Helm custom values file
  copy:
    content: |
      {{ .cni.cilium.values }}
    dest: /etc/kubernetes/cni/cilium-values.yaml

# See: https://docs.cilium.io/en/stable/installation/k8s-install-helm/
- name: Cilium | Deploy cilium with Helm
  command: |
    helm upgrade --install --namespace kube-system cilium /etc/kubernetes/cni/cilium-{{ .cni.cilium_version }}.tgz -f /etc/kubernetes/cni/cilium-values.yaml
