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