--- - name: CSI Cert Manager Setup block: - name: Define state to present set_fact: certmanager_csi_state: "present" when: - certmanager_csi|bool - name: Define state to absent 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 }}" apply: true definition: "{{ item }}" with_items: - "{{ lookup('url', certmanager_csi_driver_url, split_lines=False) | from_yaml_all | list }}" tags: - cert-manager - storage