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.

87 lines
2.4 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: Kubernetes Apps | Wait for kube-apiserver
  3. uri:
  4. url: "{{ kube_apiserver_endpoint }}/healthz"
  5. validate_certs: false
  6. client_cert: "{{ kube_apiserver_client_cert }}"
  7. client_key: "{{ kube_apiserver_client_key }}"
  8. register: result
  9. until: result.status == 200
  10. retries: 10
  11. delay: 6
  12. when: inventory_hostname == groups['kube_control_plane'][0]
  13. - name: Kubernetes Apps | Add ClusterRoleBinding to admit nodes
  14. template:
  15. src: "node-crb.yml.j2"
  16. dest: "{{ kube_config_dir }}/node-crb.yml"
  17. mode: "0640"
  18. register: node_crb_manifest
  19. when:
  20. - rbac_enabled
  21. - inventory_hostname == groups['kube_control_plane'][0]
  22. - name: Apply workaround to allow all nodes with cert O=system:nodes to register
  23. kube:
  24. name: "kubespray:system:node"
  25. kubectl: "{{ bin_dir }}/kubectl"
  26. resource: "clusterrolebinding"
  27. filename: "{{ kube_config_dir }}/node-crb.yml"
  28. state: latest
  29. register: result
  30. until: result is succeeded
  31. retries: 10
  32. delay: 6
  33. when:
  34. - rbac_enabled
  35. - node_crb_manifest.changed
  36. - inventory_hostname == groups['kube_control_plane'][0]
  37. - name: Kubernetes Apps | Remove old webhook ClusterRole
  38. kube:
  39. name: "system:node-webhook"
  40. kubectl: "{{ bin_dir }}/kubectl"
  41. resource: "clusterrole"
  42. state: absent
  43. when:
  44. - rbac_enabled
  45. - inventory_hostname == groups['kube_control_plane'][0]
  46. tags: node-webhook
  47. - name: Kubernetes Apps | Remove old webhook ClusterRoleBinding
  48. kube:
  49. name: "system:node-webhook"
  50. kubectl: "{{ bin_dir }}/kubectl"
  51. resource: "clusterrolebinding"
  52. state: absent
  53. when:
  54. - rbac_enabled
  55. - inventory_hostname == groups['kube_control_plane'][0]
  56. tags: node-webhook
  57. - name: Configure Oracle Cloud provider
  58. include_tasks: oci.yml
  59. tags: oci
  60. when:
  61. - cloud_provider is defined
  62. - cloud_provider == 'oci'
  63. - name: PriorityClass | Copy k8s-cluster-critical-pc.yml file
  64. copy:
  65. src: k8s-cluster-critical-pc.yml
  66. dest: "{{ kube_config_dir }}/k8s-cluster-critical-pc.yml"
  67. mode: "0640"
  68. when: inventory_hostname == groups['kube_control_plane'] | last
  69. - name: PriorityClass | Create k8s-cluster-critical
  70. kube:
  71. name: k8s-cluster-critical
  72. kubectl: "{{ bin_dir }}/kubectl"
  73. resource: "PriorityClass"
  74. filename: "{{ kube_config_dir }}/k8s-cluster-critical-pc.yml"
  75. state: latest
  76. register: result
  77. until: result is succeeded
  78. retries: 10
  79. delay: 6
  80. when: inventory_hostname == groups['kube_control_plane'] | last