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
This commit is contained in:
Matthew Jones 2017-04-06 10:49:02 -04:00
parent 915eccd982
commit 1902bab8be

View File

@ -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