diff --git a/tasks/csi.yml b/tasks/csi.yml index 3466de6..9e8170a 100644 --- a/tasks/csi.yml +++ b/tasks/csi.yml @@ -1,23 +1,28 @@ --- -- set_fact: - certmanager_csi_state: "present" - when: - - certmanager_csi|bool +- name: CSI Cert Manager Setup + block: + - set_fact: + certmanager_csi_state: "present" + when: + - certmanager_csi|bool -- set_fact: - certmanager_csi_state: "absent" - when: - - not certmanager_csi|bool + - set_fact: + certmanager_csi_state: "absent" + when: + - not certmanager_csi|bool -- name: CSI Cert Manager files need to be {{ certmanager_csi_state }} - k8s: - state: "{{ certmanager_csi_state }}" - context: "{{ my_context }}" - merge_type: merge - resource_definition: "{{ lookup('files', item) | from_yaml }}" - with_items: - - "csi/csi.cert-manager.io-CSIDriver.yaml" - - "csi/cert-manager-csi-ServiceAccount.yaml" - - "csi/cert-manager-csi-ClusterRole.yaml" - - "csi/cert-manager-csi-ClusterRoleBinding.yaml" - - "csi/cert-manager-csi-DaemonSet.yaml" + - name: CSI Cert Manager files need to be {{ certmanager_csi_state }} + k8s: + state: "{{ certmanager_csi_state }}" + context: "{{ my_context }}" + merge_type: merge + resource_definition: "{{ lookup('file', item) | from_yaml }}" + with_items: + - "csi/csi.cert-manager.io-CSIDriver.yaml" + - "csi/cert-manager-csi-ServiceAccount.yaml" + - "csi/cert-manager-csi-ClusterRole.yaml" + - "csi/cert-manager-csi-ClusterRoleBinding.yaml" + - "csi/cert-manager-csi-DaemonSet.yaml" + tags: + - certmanager + - storage