From f1512e9405566473619f47fe00e4d4413dc3a4fc Mon Sep 17 00:00:00 2001 From: John Westcott IV Date: Mon, 27 Mar 2023 20:56:56 -0400 Subject: [PATCH] Modifying stage playbook to not need jmespath --- .github/workflows/promote.yaml | 1 - ansible/helm-release.yml | 17 +++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/promote.yaml b/.github/workflows/promote.yaml index 00a14df19..f18839711 100644 --- a/.github/workflows/promote.yaml +++ b/.github/workflows/promote.yaml @@ -35,7 +35,6 @@ jobs: - name: Release Helm chart run: | - pip install jmespath ansible-playbook ansible/helm-release.yml -v \ -e operator_image=quay.io/${{ github.repository }} \ -e chart_owner=${{ github.repository_owner }} \ diff --git a/ansible/helm-release.yml b/ansible/helm-release.yml index bb1c73d1d..fd6f0e5df 100644 --- a/ansible/helm-release.yml +++ b/ansible/helm-release.yml @@ -14,14 +14,19 @@ Release must exist before running this playbook when: release is not success - - name: See if file is already attached + - name: Set helm filename and commit message set_fact: - asset_already_attached: "{{ (file_name in release.json | community.general.json_query(jmes_query)) | ternary(True, False) }}" - helm_file_name: "{{ file_name }}" + asset_already_attached: False + helm_file_name: "awx-operator-{{ tag }}.tgz" commit_message: "Updated index.yaml for release {{ release.json.tag_name }}" - vars: - jmes_query: 'assets[*].name' - file_name: "awx-operator-{{ tag }}.tgz" + + - name: See if file is already attached + set_fact: + asset_already_attached: True + loop: "{{ release.json.get('assets', []) }}" + loop_control: + label: "{{ item.name }}" + when: item.name == helm_file_name - when: not asset_already_attached block: