This has not changed, when: always executes after with_ : , this is so
you can use 'item' in your when clause to conditionally execute each
loop iteration. This means you CANNOT use it to prevent an undefined
error in with_, you need to use default([]) to provide an empty list,
which will skip the task:

- name: Install php and packages from php_packages
  yum: name={{ item }} enablerepo=epel state=present
  with_items:
      - '{{ php_packages|default([]) }}'


-- 
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kFSFGThiPDQCq3DVVNHr7%3DqFqqK7R30Kk90x-OwxXqnQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to