Skip to content

Commit

Permalink
Fix with_items evaluation when dict is undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jun 13, 2017
1 parent 5ab5820 commit 7b78ac4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions roles/release-candidate/tasks/debian.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
- name: Get all packages from candidate repo
shell: grep ^Package /var/lib/apt/lists/repository.egi.eu_sw_production_cmd-os_candidate_*_Packages | awk '{print $2}'
register: pkglist
register: pkglist_raw

#- debug: msg="{{ pkglist.keys() }}"
#- debug: msg="{{ pkglist.stdout }}"
- set_fact:
pkglist: pkglist.stdout.split('\n')
when: pkglist_raw is defined

- name: Install packages from /tmp/candidate.pkglist file
- name: Install candidate repo packages
apt:
name: "{{ item }}"
state: installed
with_items:
- "{{ pkglist.stdout.split('\n') }}"
when: ansible_os_family == 'RedHat'
- "{{ pkglist | default([]) }}"

0 comments on commit 7b78ac4

Please sign in to comment.