2018-02-01 12:25:21 +08:00
|
|
|
---
|
|
|
|
|
2018-07-01 13:14:07 +08:00
|
|
|
- name: CephFS Provisioner | Remove legacy addon dir and manifests
|
|
|
|
file:
|
|
|
|
path: "{{ kube_config_dir }}/addons/cephfs_provisioner"
|
|
|
|
state: absent
|
|
|
|
when:
|
2021-03-24 08:26:05 +08:00
|
|
|
- inventory_hostname == groups['kube_control_plane'][0]
|
2018-07-01 13:14:07 +08:00
|
|
|
tags:
|
|
|
|
- upgrade
|
|
|
|
|
|
|
|
- name: CephFS Provisioner | Remove legacy namespace
|
2022-01-05 18:26:32 +08:00
|
|
|
command: >
|
|
|
|
{{ kubectl }} delete namespace {{ cephfs_provisioner_namespace }}
|
2021-07-12 15:00:47 +08:00
|
|
|
ignore_errors: true # noqa ignore-errors
|
2018-07-01 13:14:07 +08:00
|
|
|
when:
|
2021-03-24 08:26:05 +08:00
|
|
|
- inventory_hostname == groups['kube_control_plane'][0]
|
2018-07-01 13:14:07 +08:00
|
|
|
tags:
|
|
|
|
- upgrade
|
|
|
|
|
|
|
|
- name: CephFS Provisioner | Remove legacy storageclass
|
2022-01-05 18:26:32 +08:00
|
|
|
command: >
|
|
|
|
{{ kubectl }} delete storageclass {{ cephfs_provisioner_storage_class }}
|
2021-07-12 15:00:47 +08:00
|
|
|
ignore_errors: true # noqa ignore-errors
|
2018-07-01 13:14:07 +08:00
|
|
|
when:
|
2021-03-24 08:26:05 +08:00
|
|
|
- inventory_hostname == groups['kube_control_plane'][0]
|
2018-07-01 13:14:07 +08:00
|
|
|
tags:
|
|
|
|
- upgrade
|
|
|
|
|
2018-02-01 12:25:21 +08:00
|
|
|
- name: CephFS Provisioner | Create addon dir
|
|
|
|
file:
|
|
|
|
path: "{{ kube_config_dir }}/addons/cephfs_provisioner"
|
2018-02-13 09:55:59 +08:00
|
|
|
state: directory
|
2018-02-01 12:25:21 +08:00
|
|
|
owner: root
|
|
|
|
group: root
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0755"
|
2018-07-01 13:14:07 +08:00
|
|
|
when:
|
2021-03-24 08:26:05 +08:00
|
|
|
- inventory_hostname == groups['kube_control_plane'][0]
|
2018-02-01 12:25:21 +08:00
|
|
|
|
2018-08-23 00:16:13 +08:00
|
|
|
- name: CephFS Provisioner | Templates list
|
|
|
|
set_fact:
|
|
|
|
cephfs_provisioner_templates:
|
|
|
|
- { name: 00-namespace, file: 00-namespace.yml, type: ns }
|
|
|
|
- { name: secret-cephfs-provisioner, file: secret-cephfs-provisioner.yml, type: secret }
|
|
|
|
- { name: sa-cephfs-provisioner, file: sa-cephfs-provisioner.yml, type: sa }
|
|
|
|
- { name: clusterrole-cephfs-provisioner, file: clusterrole-cephfs-provisioner.yml, type: clusterrole }
|
|
|
|
- { name: clusterrolebinding-cephfs-provisioner, file: clusterrolebinding-cephfs-provisioner.yml, type: clusterrolebinding }
|
|
|
|
- { name: role-cephfs-provisioner, file: role-cephfs-provisioner.yml, type: role }
|
|
|
|
- { name: rolebinding-cephfs-provisioner, file: rolebinding-cephfs-provisioner.yml, type: rolebinding }
|
|
|
|
- { name: deploy-cephfs-provisioner, file: deploy-cephfs-provisioner.yml, type: deploy }
|
|
|
|
- { name: sc-cephfs-provisioner, file: sc-cephfs-provisioner.yml, type: sc }
|
|
|
|
|
2018-02-01 12:25:21 +08:00
|
|
|
- name: CephFS Provisioner | Create manifests
|
|
|
|
template:
|
|
|
|
src: "{{ item.file }}.j2"
|
|
|
|
dest: "{{ kube_config_dir }}/addons/cephfs_provisioner/{{ item.file }}"
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0644"
|
2018-08-23 00:16:13 +08:00
|
|
|
with_items: "{{ cephfs_provisioner_templates }}"
|
2018-07-01 13:14:07 +08:00
|
|
|
register: cephfs_provisioner_manifests
|
2021-03-24 08:26:05 +08:00
|
|
|
when: inventory_hostname == groups['kube_control_plane'][0]
|
2018-02-01 12:25:21 +08:00
|
|
|
|
|
|
|
- name: CephFS Provisioner | Apply manifests
|
|
|
|
kube:
|
2019-04-24 01:37:23 +08:00
|
|
|
name: "{{ item.item.name }}"
|
2018-02-13 09:55:59 +08:00
|
|
|
namespace: "{{ cephfs_provisioner_namespace }}"
|
2018-02-01 12:25:21 +08:00
|
|
|
kubectl: "{{ bin_dir }}/kubectl"
|
2019-04-24 01:37:23 +08:00
|
|
|
resource: "{{ item.item.type }}"
|
|
|
|
filename: "{{ kube_config_dir }}/addons/cephfs_provisioner/{{ item.item.file }}"
|
2018-02-01 12:25:21 +08:00
|
|
|
state: "latest"
|
2019-04-24 01:37:23 +08:00
|
|
|
with_items: "{{ cephfs_provisioner_manifests.results }}"
|
2021-03-24 08:26:05 +08:00
|
|
|
when: inventory_hostname == groups['kube_control_plane'][0]
|