update
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
snapshot_classes:
|
||||
- name: cinder-csi-snapshot
|
||||
is_default: false
|
||||
force_create: true
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
- name: Kubernetes Snapshots | Copy Cinder CSI Snapshot Class template
|
||||
template:
|
||||
src: "cinder-csi-snapshot-class.yml.j2"
|
||||
dest: "{{ kube_config_dir }}/cinder-csi-snapshot-class.yml"
|
||||
mode: 0644
|
||||
register: manifests
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
|
||||
- name: Kubernetes Snapshots | Add Cinder CSI Snapshot Class
|
||||
kube:
|
||||
kubectl: "{{ bin_dir }}/kubectl"
|
||||
filename: "{{ kube_config_dir }}/cinder-csi-snapshot-class.yml"
|
||||
state: "latest"
|
||||
when:
|
||||
- inventory_hostname == groups['kube_control_plane'][0]
|
||||
- manifests.changed
|
||||
@@ -0,0 +1,13 @@
|
||||
{% for class in snapshot_classes %}
|
||||
---
|
||||
kind: VolumeSnapshotClass
|
||||
apiVersion: snapshot.storage.k8s.io/v1beta1
|
||||
metadata:
|
||||
name: "{{ class.name }}"
|
||||
annotations:
|
||||
storageclass.kubernetes.io/is-default-class: "{{ class.is_default | default(false) | ternary("true","false") }}"
|
||||
driver: cinder.csi.openstack.org
|
||||
deletionPolicy: Delete
|
||||
parameters:
|
||||
force-create: "{{ class.force_create }}"
|
||||
{% endfor %}
|
||||
Reference in New Issue
Block a user