On 03. sep. 2016 23:15, Tony Owens wrote:
In my yml I have this defined.


   1. - name: "pull image to force update if ImageTag=latest"
   2. shell: "docker pull {{ image }}"
   3. when: "{{ ImageTag == latest }}"

but I get this error when executing. I know that I could use ignore_errors
but that doesn't seem like the right thing to do here. I would expect this
to evaluate as not true and move on to the next task in the playbook. Any
tips?

Never use curly brackets in when, they are implied.
And since latest is a string use qoutes, if not latest will be treated as a variable, so this should work:

  when: ImageTag == "latest"

--
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/6f3a9499-acf5-9d70-f9c4-edcd73690366%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to