Hi all,
I am trying to do
- name: Check if package-1 is installed
command: dpkg-query -l package-1
register: deb_check
ignore_errors: yes
- name: Check that package-1 designated ports are free
wait_for: port={{ item }} state=absent timeout=10
with_items:
- "{{ package-1.ports }}"
when: deb_check.stderr.find('no packages found') != -1
This works fine. But I want to do this for multiple packages. Doing this
for every package is going to insanely increase code repetition. Is there a
way to loop over tasks?
*Please note that I am using Ansible 1.9.4 which I cannot change.*
If any one can help on this.
Thanks
-AliJ
--
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/CAF%2BYgi67Tk4%3DmJUGG49797671%3DA%3D-xwJFJE6ke%2B1wgd2i0eGDg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.