You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.5 KiB

  1. ---
  2. - name: Cilium | Ensure BFPFS mounted
  3. mount:
  4. fstype: bpf
  5. path: /sys/fs/bpf
  6. src: bpffs
  7. state: mounted
  8. - name: Cilium | Create Cilium certs directory
  9. file:
  10. dest: "{{ cilium_cert_dir }}"
  11. state: directory
  12. mode: 0750
  13. owner: root
  14. group: root
  15. - name: Cilium | Link etcd certificates for cilium
  16. file:
  17. src: "{{ etcd_cert_dir }}/{{ item.s }}"
  18. dest: "{{ cilium_cert_dir }}/{{ item.d }}"
  19. state: hard
  20. force: yes
  21. with_items:
  22. - {s: "ca.pem", d: "ca_cert.crt"}
  23. - {s: "node-{{ inventory_hostname }}.pem", d: "cert.crt"}
  24. - {s: "node-{{ inventory_hostname }}-key.pem", d: "key.pem"}
  25. - name: Cilium | Create Cilium node manifests
  26. template:
  27. src: "{{item.file}}.j2"
  28. dest: "{{kube_config_dir}}/{{item.file}}"
  29. with_items:
  30. - {name: cilium, file: cilium-config.yml, type: cm}
  31. - {name: cilium, file: cilium-crb.yml, type: clusterrolebinding}
  32. - {name: cilium, file: cilium-cr.yml, type: clusterrole}
  33. - {name: cilium, file: cilium-ds.yml, type: ds}
  34. - {name: cilium, file: cilium-sa.yml, type: sa}
  35. register: cilium_node_manifests
  36. when:
  37. - inventory_hostname in groups['kube-master']
  38. - rbac_enabled or item.type not in rbac_resources
  39. - name: Cilium | Set CNI directory permissions
  40. file:
  41. path: /opt/cni/bin
  42. state: directory
  43. owner: kube
  44. recurse: true
  45. mode: 0755
  46. register: cni_bin_dir
  47. - name: Cilium | Create network policy directory
  48. file:
  49. path: "{{ cilium_policy_dir }}"
  50. state: directory