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.

62 lines
1.6 KiB

Upgrade ansible (#10190) * project: update all dependencies including ansible Upgrade to ansible 7.x and ansible-core 2.14.x. There seems to be issue with ansible 8/ansible-core 2.15 so we remain on those versions for now. It's quite a big bump already anyway. Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * tests: install aws galaxy collection Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * ansible-lint: disable various rules after ansible upgrade Temporarily disable a bunch of linting action following ansible upgrade. Those should be taken care of separately. Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve deprecated-module ansible-lint error Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve no-free-form ansible-lint error Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve schema[meta] ansible-lint error Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve schema[playbook] ansible-lint error Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve schema[tasks] ansible-lint error Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve risky-file-permissions ansible-lint error Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve risky-shell-pipe ansible-lint error Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: remove deprecated warn args Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: use fqcn for non builtin tasks Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: resolve syntax-check[missing-file] for contrib playbook Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: use arithmetic inside jinja to fix ansible 6 upgrade Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> --------- Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>
1 year ago
  1. ---
  2. - name: Kube-router | Create annotations
  3. import_tasks: annotate.yml
  4. tags: annotate
  5. - name: Kube-router | Create config directory
  6. file:
  7. path: /var/lib/kube-router
  8. state: directory
  9. owner: "{{ kube_owner }}"
  10. recurse: true
  11. mode: "0755"
  12. - name: Kube-router | Create kubeconfig
  13. template:
  14. src: kubeconfig.yml.j2
  15. dest: /var/lib/kube-router/kubeconfig
  16. mode: "0644"
  17. owner: "{{ kube_owner }}"
  18. notify:
  19. - Reset_kube_router
  20. - name: Kube-router | Slurp cni config
  21. slurp:
  22. src: /etc/cni/net.d/10-kuberouter.conflist
  23. register: cni_config_slurp
  24. ignore_errors: true # noqa ignore-errors
  25. - name: Kube-router | Set cni_config variable
  26. set_fact:
  27. cni_config: "{{ cni_config_slurp.content | b64decode | from_json }}"
  28. when:
  29. - not cni_config_slurp.failed
  30. - name: Kube-router | Set host_subnet variable
  31. when:
  32. - cni_config is defined
  33. - cni_config | json_query('plugins[?bridge==`kube-bridge`].ipam.subnet') | length > 0
  34. set_fact:
  35. host_subnet: "{{ cni_config | json_query('plugins[?bridge==`kube-bridge`].ipam.subnet') | first }}"
  36. - name: Kube-router | Create cni config
  37. template:
  38. src: cni-conf.json.j2
  39. dest: /etc/cni/net.d/10-kuberouter.conflist
  40. mode: "0644"
  41. owner: "{{ kube_owner }}"
  42. notify:
  43. - Reset_kube_router
  44. - name: Kube-router | Delete old configuration
  45. file:
  46. path: /etc/cni/net.d/10-kuberouter.conf
  47. state: absent
  48. - name: Kube-router | Create manifest
  49. template:
  50. src: kube-router.yml.j2
  51. dest: "{{ kube_config_dir }}/kube-router.yml"
  52. mode: "0644"
  53. delegate_to: "{{ groups['kube_control_plane'] | first }}"
  54. run_once: true