Properly skip task when variable is undefined

This commit is contained in:
Sam Doran 2016-11-11 12:59:39 -05:00
parent 2a3b31915f
commit d47dfa8073
1 changed files with 1 additions and 2 deletions

View File

@ -27,8 +27,7 @@
- name: Configure repository subscriptions
command: subscription-manager repos --{{ item.state }} {{ item.name }}
with_items: "{{ rhsub_repos }}"
when: rhsub_repos is defined
with_items: "{{ rhsub_repos | default([]) }}"
tags:
- rhsub
- rhsub_repos