From 1d5ecda6a1e85c681023529d53033a417e45f4f1 Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Rodriguez Date: Mon, 25 Nov 2024 10:02:37 +0100 Subject: [PATCH] [install_operator] Add option install_operator_skip_operatorgroup to skip create operatorgroup (#8864) * Update main.yml * Update install.yml --- ansible/roles/install_operator/defaults/main.yml | 3 +++ ansible/roles/install_operator/tasks/install.yml | 1 + 2 files changed, 4 insertions(+) diff --git a/ansible/roles/install_operator/defaults/main.yml b/ansible/roles/install_operator/defaults/main.yml index 69a9bb80e58..09a550eeabb 100644 --- a/ansible/roles/install_operator/defaults/main.yml +++ b/ansible/roles/install_operator/defaults/main.yml @@ -89,3 +89,6 @@ install_operator_catalogsource_pullsecrets: [] # Accepted values: true , false # Default value: false install_operator_install_csv_ignore_error: false + +# If your operator doesnt need to create a OperatorGroup, because it already exists, set to true +install_operator_skip_operatorgroup: false diff --git a/ansible/roles/install_operator/tasks/install.yml b/ansible/roles/install_operator/tasks/install.yml index 6d4845a0e89..1dcfc6732a7 100644 --- a/ansible/roles/install_operator/tasks/install.yml +++ b/ansible/roles/install_operator/tasks/install.yml @@ -16,6 +16,7 @@ name: "{{ install_operator_namespace }}" - name: "Ensure OperatorGroup exists ({{ install_operator_name }})" + when: install_operator_skip_operatorgroup | default(false) | bool == false kubernetes.core.k8s: state: present definition: "{{ lookup('template', 'operatorgroup.yaml.j2') | from_yaml }}"