From cdab3dd538a77ec3755ca08e07992e6f3507677a Mon Sep 17 00:00:00 2001 From: Chi Cuong HA Date: Wed, 3 Jul 2024 21:12:47 +0200 Subject: [PATCH] fix: Make basic install without operator works (#1875) - Update role name for README.md - Avoid the this_awx['resources'][0] is undefined in database_configuration.yml - Add update_status variable to include or not the update_status.yml - metrics_utility_enabled exists in CRD but not as variable Co-authored-by: Christian Adams --- docs/troubleshooting/debugging.md | 4 ++++ roles/installer/README.md | 2 +- roles/installer/defaults/main.yml | 3 +++ roles/installer/tasks/database_configuration.yml | 1 + roles/installer/tasks/install.yml | 6 ++++-- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/troubleshooting/debugging.md b/docs/troubleshooting/debugging.md index 8654b2a3..3fdc98b8 100644 --- a/docs/troubleshooting/debugging.md +++ b/docs/troubleshooting/debugging.md @@ -96,6 +96,8 @@ Create a vars file: ansible_operator_meta: name: awx namespace: awx +set_self_labels: false +update_status: false service_type: nodeport ``` The vars file will replace the awx resource so any value that you wish to over ride using the awx resource, put in the vars file. For example, if you wish to use your own image, version and pull policy, you can specify it like below: @@ -106,6 +108,8 @@ The vars file will replace the awx resource so any value that you wish to over r ansible_operator_meta: name: awx namespace: awx +set_self_labels: false +update_status: false service_type: nodeport image: $DEV_DOCKER_TAG_BASE/awx_kube_devel image_pull_policy: Always diff --git a/roles/installer/README.md b/roles/installer/README.md index b6242579..c0a86427 100644 --- a/roles/installer/README.md +++ b/roles/installer/README.md @@ -26,7 +26,7 @@ Example Playbook - hosts: localhost connection: local roles: - - awx + - installer License ------- diff --git a/roles/installer/defaults/main.yml b/roles/installer/defaults/main.yml index 4efe94c3..277da25c 100644 --- a/roles/installer/defaults/main.yml +++ b/roles/installer/defaults/main.yml @@ -443,6 +443,9 @@ ldap_password_secret: '' # Secret to lookup that provides the custom CA trusted bundle bundle_cacert_secret: '' +# Set false for basic install without operator +update_status: true + # Whether secrets should be garbage collected # on teardown # diff --git a/roles/installer/tasks/database_configuration.yml b/roles/installer/tasks/database_configuration.yml index efab2173..31742d18 100644 --- a/roles/installer/tasks/database_configuration.yml +++ b/roles/installer/tasks/database_configuration.yml @@ -153,6 +153,7 @@ set_fact: _previous_upgraded_pg_version: "{{ this_awx['resources'][0]['status']['upgradedPostgresVersion'] | default(false) }}" when: + - this_awx['resources'][0] is defined - "'upgradedPostgresVersion' in this_awx['resources'][0]['status']" - name: Check if postgres pod is running an older version diff --git a/roles/installer/tasks/install.yml b/roles/installer/tasks/install.yml index ff71063d..22f2c770 100644 --- a/roles/installer/tasks/install.yml +++ b/roles/installer/tasks/install.yml @@ -104,14 +104,16 @@ - name: Enable optional metrics-utility include_tasks: enable_metrics_utility.yml - when: _metrics_utility_enabled | bool + + when: _metrics_utility_enabled | default(false) | bool - name: Enable optional metrics-utility for Redhat Console include_tasks: enable_metrics_utility_console.yml - when: _metrics_utility_console_enabled | bool + when: _metrics_utility_console_enabled | default(false) | bool - name: Update status variables include_tasks: update_status.yml + when: update_status | bool - name: Cleanup & Set garbage collection refs include_tasks: cleanup.yml