diff --git a/roles/cert_manager/tasks/main.yml b/roles/cert_manager/tasks/main.yml index 4daa72af..09c6260f 100644 --- a/roles/cert_manager/tasks/main.yml +++ b/roles/cert_manager/tasks/main.yml @@ -12,6 +12,32 @@ # License for the specific language governing permissions and limitations # under the License. +- name: Uninstall the legacy HelmRelease + run_once: true + block: + - name: Suspend the existing HelmRelease + failed_when: false + kubernetes.core.k8s: + state: patched + api_version: helm.toolkit.fluxcd.io/v2beta1 + kind: HelmRelease + name: "{{ cert_manager_helm_release_name }}" + chart_ref: "{{ cert_manager_helm_chart_ref }}" + release_namespace: "{{ cert_manager_helm_release_namespace }}" + definition: + spec: + suspend: true + + - name: Remove the existing HelmRelease + failed_when: false + kubernetes.core.k8s: + state: absent + api_version: helm.toolkit.fluxcd.io/v2beta1 + kind: HelmRelease + name: "{{ cert_manager_helm_release_name }}" + chart_ref: "{{ cert_manager_helm_chart_ref }}" + release_namespace: "{{ cert_manager_helm_release_namespace }}" + - name: Deploy Helm chart run_once: true kubernetes.core.helm: