From ee503fd26fe3b6e15602bd0715fd81d0b2a43933 Mon Sep 17 00:00:00 2001 From: Alex Krzos Date: Fri, 27 Feb 2026 10:53:38 -0500 Subject: [PATCH] Add option to remove assisted-installer namespace from fresh deployed clusters Assisted-by: Cursor (Claude) --- .../roles/mno-post-cluster-install/defaults/main/main.yml | 3 +++ ansible/roles/mno-post-cluster-install/tasks/main.yml | 5 +++++ .../roles/sno-post-cluster-install/defaults/main/main.yml | 3 +++ ansible/roles/sno-post-cluster-install/tasks/main.yml | 5 +++++ 4 files changed, 16 insertions(+) diff --git a/ansible/roles/mno-post-cluster-install/defaults/main/main.yml b/ansible/roles/mno-post-cluster-install/defaults/main/main.yml index 8067cf4f..68ae1995 100644 --- a/ansible/roles/mno-post-cluster-install/defaults/main/main.yml +++ b/ansible/roles/mno-post-cluster-install/defaults/main/main.yml @@ -18,6 +18,9 @@ wait_until_cluster_stable: true minimum_stable_period: 2m wait_until_cluster_stable_timeout: 20m +# Remove assisted-installer namespace from cluster after installation +remove_assisted_installer_namespace: false + # Deploy performance-dashboards setup_performance_dashboards: false diff --git a/ansible/roles/mno-post-cluster-install/tasks/main.yml b/ansible/roles/mno-post-cluster-install/tasks/main.yml index 711a0438..62af5ec5 100644 --- a/ansible/roles/mno-post-cluster-install/tasks/main.yml +++ b/ansible/roles/mno-post-cluster-install/tasks/main.yml @@ -31,6 +31,11 @@ KUBECONFIG={{ bastion_cluster_config_dir }}/kubeconfig oc adm wait-for-stable-cluster --minimum-stable-period={{ minimum_stable_period }} --timeout={{ wait_until_cluster_stable_timeout }} when: wait_until_cluster_stable +- name: Remove assisted-installer namespace + shell: | + KUBECONFIG={{ bastion_cluster_config_dir }}/kubeconfig oc delete ns assisted-installer + when: remove_assisted_installer_namespace + - name: Apply a label to the worker node(s) shell: | KUBECONFIG={{ bastion_cluster_config_dir }}/kubeconfig oc label no --overwrite -l node-role.kubernetes.io/worker jetlag=true diff --git a/ansible/roles/sno-post-cluster-install/defaults/main/main.yml b/ansible/roles/sno-post-cluster-install/defaults/main/main.yml index a098a9ed..674141c1 100644 --- a/ansible/roles/sno-post-cluster-install/defaults/main/main.yml +++ b/ansible/roles/sno-post-cluster-install/defaults/main/main.yml @@ -10,6 +10,9 @@ wait_until_cluster_stable: true minimum_stable_period: 2m wait_until_cluster_stable_timeout: 20m +# Remove assisted-installer namespace from cluster after installation +remove_assisted_installer_namespace: false + # Deploy openshift-gitops-operator setup_openshift_gitops: false gitops_channel: stable diff --git a/ansible/roles/sno-post-cluster-install/tasks/main.yml b/ansible/roles/sno-post-cluster-install/tasks/main.yml index 52392b95..4a3ac50b 100644 --- a/ansible/roles/sno-post-cluster-install/tasks/main.yml +++ b/ansible/roles/sno-post-cluster-install/tasks/main.yml @@ -32,6 +32,11 @@ KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc adm wait-for-stable-cluster --minimum-stable-period={{ minimum_stable_period }} --timeout={{ wait_until_cluster_stable_timeout }} when: wait_until_cluster_stable +- name: Remove assisted-installer namespace + shell: | + KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc delete ns assisted-installer + when: remove_assisted_installer_namespace + - name: Apply a label to the SNO node shell: | KUBECONFIG={{ bastion_cluster_config_dir }}/{{ groups['sno'][0] }}/kubeconfig oc label no --all --overwrite jetlag=true