2018-03-28 22:30:00 +08:00
|
|
|
---
|
|
|
|
|
2018-06-26 14:42:05 +08:00
|
|
|
- name: Cert Manager | Remove legacy addon dir and manifests
|
|
|
|
file:
|
|
|
|
path: "{{ kube_config_dir }}/addons/cert_manager"
|
|
|
|
state: absent
|
|
|
|
when:
|
2021-03-24 08:26:05 +08:00
|
|
|
- inventory_hostname == groups['kube_control_plane'][0]
|
2018-06-26 14:42:05 +08:00
|
|
|
tags:
|
|
|
|
- upgrade
|
|
|
|
|
|
|
|
- name: Cert Manager | Remove legacy namespace
|
2022-01-05 18:26:32 +08:00
|
|
|
command: >
|
|
|
|
{{ kubectl }} delete namespace {{ cert_manager_namespace }}
|
2021-07-12 15:00:47 +08:00
|
|
|
ignore_errors: true # noqa ignore-errors
|
2018-06-26 14:42:05 +08:00
|
|
|
when:
|
2021-03-24 08:26:05 +08:00
|
|
|
- inventory_hostname == groups['kube_control_plane'][0]
|
2018-06-26 14:42:05 +08:00
|
|
|
tags:
|
|
|
|
- upgrade
|
|
|
|
|
2018-03-28 22:30:00 +08:00
|
|
|
- name: Cert Manager | Create addon dir
|
|
|
|
file:
|
|
|
|
path: "{{ kube_config_dir }}/addons/cert_manager"
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0755"
|
2018-06-26 14:42:05 +08:00
|
|
|
when:
|
2021-03-24 08:26:05 +08:00
|
|
|
- inventory_hostname == groups['kube_control_plane'][0]
|
2018-03-28 22:30:00 +08:00
|
|
|
|
2020-08-06 14:26:55 +08:00
|
|
|
- name: Cert Manager | Templates list
|
|
|
|
set_fact:
|
|
|
|
cert_manager_templates:
|
2021-10-13 00:17:47 +08:00
|
|
|
- { name: cert-manager, file: cert-manager.yml, type: all }
|
|
|
|
- { name: cert-manager.crds, file: cert-manager.crds.yml, type: crd }
|
2020-08-06 14:26:55 +08:00
|
|
|
|
2018-03-28 22:30:00 +08:00
|
|
|
- name: Cert Manager | Create manifests
|
|
|
|
template:
|
|
|
|
src: "{{ item.file }}.j2"
|
|
|
|
dest: "{{ kube_config_dir }}/addons/cert_manager/{{ item.file }}"
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0644"
|
2020-08-06 14:26:55 +08:00
|
|
|
with_items: "{{ cert_manager_templates }}"
|
2018-03-28 22:30:00 +08:00
|
|
|
register: cert_manager_manifests
|
|
|
|
when:
|
2021-03-24 08:26:05 +08:00
|
|
|
- inventory_hostname == groups['kube_control_plane'][0]
|
2018-03-28 22:30:00 +08:00
|
|
|
|
|
|
|
- name: Cert Manager | Apply manifests
|
|
|
|
kube:
|
2019-04-24 01:37:23 +08:00
|
|
|
name: "{{ item.item.name }}"
|
2018-03-28 22:30:00 +08:00
|
|
|
kubectl: "{{ bin_dir }}/kubectl"
|
2019-04-24 01:37:23 +08:00
|
|
|
resource: "{{ item.item.type }}"
|
|
|
|
filename: "{{ kube_config_dir }}/addons/cert_manager/{{ item.item.file }}"
|
2018-03-28 22:30:00 +08:00
|
|
|
state: "latest"
|
2019-04-24 01:37:23 +08:00
|
|
|
with_items: "{{ cert_manager_manifests.results }}"
|
|
|
|
when:
|
2021-03-24 08:26:05 +08:00
|
|
|
- inventory_hostname == groups['kube_control_plane'][0]
|