From 81f64e7e15765bb6dcd7f230bb505e940f29053f Mon Sep 17 00:00:00 2001 From: Andre Ricardo De Campos Marcelino Date: Wed, 3 Jan 2024 12:04:03 -0300 Subject: [PATCH] [patch] fix condition that runs task that sets cert_manager_cluster_resource_namespace --- ibm/mas_devops/common_tasks/detect_cert_manager.yml | 1 + ibm/mas_devops/roles/suite_dns/tasks/run.yml | 3 ++- ibm/mas_devops/roles/suite_install/tasks/main.yml | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ibm/mas_devops/common_tasks/detect_cert_manager.yml b/ibm/mas_devops/common_tasks/detect_cert_manager.yml index 5101ac4a8..00215f282 100644 --- a/ibm/mas_devops/common_tasks/detect_cert_manager.yml +++ b/ibm/mas_devops/common_tasks/detect_cert_manager.yml @@ -53,6 +53,7 @@ set_fact: cert_manager_namespace: "{{ cert_manager_webhook_lookup.stdout }}" +# If 'cert_manager_cluster_resource_namespace' is not yet defined then set it to same value as 'cert_manager_namespace' - name: Set Certificate Manager Cluster Resource namespace (if not set) set_fact: cert_manager_cluster_resource_namespace: "{{ cert_manager_namespace }}" diff --git a/ibm/mas_devops/roles/suite_dns/tasks/run.yml b/ibm/mas_devops/roles/suite_dns/tasks/run.yml index d18999139..bf15c80dc 100644 --- a/ibm/mas_devops/roles/suite_dns/tasks/run.yml +++ b/ibm/mas_devops/roles/suite_dns/tasks/run.yml @@ -3,7 +3,8 @@ # ----------------------------------------------------------------------------- # Ensure cert manager is installed prior continuing as this role will install # v1alpha1.acme.cis.ibm.com apiservice which requires cert manager to be running -- include_tasks: "{{ role_path }}/../../common_tasks/detect_cert_manager.yml" +- name: Detect Certificate Manager installation + include_tasks: "{{ role_path }}/../../common_tasks/detect_cert_manager.yml" when: cert_manager_namespace is not defined or cert_manager_namespace | length == 0 # 2. Run provider task diff --git a/ibm/mas_devops/roles/suite_install/tasks/main.yml b/ibm/mas_devops/roles/suite_install/tasks/main.yml index 3e847ca41..4ba73d8a6 100644 --- a/ibm/mas_devops/roles/suite_install/tasks/main.yml +++ b/ibm/mas_devops/roles/suite_install/tasks/main.yml @@ -140,8 +140,9 @@ # 4. Determine version of cert-manager in use on the cluster # ----------------------------------------------------------------------------- -- include_tasks: "{{ role_path }}/../../common_tasks/detect_cert_manager.yml" - when: cert_manager_namespace is not defined or cert_manager_namespace | length == 0 +- name: Detect Certificate Manager installation + include_tasks: "{{ role_path }}/../../common_tasks/detect_cert_manager.yml" + when: cert_manager_cluster_resource_namespace is not defined or cert_manager_cluster_resource_namespace != '' # 5. Provide debug information # ----------------------------------------------------------------------------- @@ -159,6 +160,7 @@ - "MAS domain .................... {{ mas_domain }}" - "MAS ICR cp content ............ {{ mas_icr_cp }}" - "MAS ICR cpopen content ........ {{ mas_icr_cpopen }}" + - "Cert Manager namespace ........ {{ cert_manager_cluster_resource_namespace }}" - "MAS Cluster Issuer ............ {{ mas_cluster_issuer }}" - "IPv6 Enabled .................. {{ enable_ipv6 }}"