On 22. nov. 2016 15:11, William Hirsch wrote:
> Now, here is what I want to do to each device I find that doesn't match 
> sr0.  I'm struggling in figuring out how to set new_dev
> 
> - name: Label new disk
>   command: parted -s -a optimal "{{ new_dev }}" mklabel gpt
> 
> I've tried the following to test loops and conditionals:
> 
> 
> - name: print devices
>   debug: msg="Device name is "{{ item.key }}""
>   with_dict: "{{ ansible_devices }}"
> 
> Which works, but when I add any number of attempts to apply conditionals, I 
> have failure.  Here is some of what I've tried, with the differences 
> highlighted.
> 
> - name: print devices
>   debug: msg="Device name is "{{ item.key }}""
>   with_dict: "{{ ansible_devices }}"
> *  when: ansible_devices.key == "vdb"*

when: item.key != "sr0"

-- 
Kai Stian Olstad

-- 
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/a5aa5364-2b50-52bc-da04-77dc91404929%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to