Kai Stian Olstad
unread,Sep 3, 2016, 6:29:45 PM9/3/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
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