From 1902bab8be5f98182d9dd90721b02f2a7c5c8bc4 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Thu, 6 Apr 2017 10:49:02 -0400 Subject: [PATCH] Fix a with_items insights scm reference for newer ansible behavior Newer ansible versions don't allow with_items to reference undefined variables so we'll provide a default. We'll also update some conditionals to deal with naming requirements changes on insights api endpoints --- awx/playbooks/project_update.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/awx/playbooks/project_update.yml b/awx/playbooks/project_update.yml index bfabd47a98..20f94cc5f0 100644 --- a/awx/playbooks/project_update.yml +++ b/awx/playbooks/project_update.yml @@ -128,8 +128,8 @@ url_password: "{{scm_password}}" force_basic_auth: yes force: yes - when: scm_type == 'insights' and item.name != None - with_items: "{{insights_output.json}}" + when: scm_type == 'insights' and item.name != None and item.name != "" + with_items: "{{ insights_output.json|default([]) }}" failed_when: false - name: Fetch Insights Playbook @@ -140,8 +140,8 @@ url_password: "{{scm_password}}" force_basic_auth: yes force: yes - when: scm_type == 'insights' and item.name == None - with_items: "{{insights_output.json}}" + when: scm_type == 'insights' and (item.name == None or items.name == "") + with_items: "{{ insights_output.json|default([]) }}" failed_when: false - name: detect requirements.yml