when: "'{{environment}}' != 'prod'"

also i would not use environment as a variable as it can conflict with
the keyword.

On Thu, Aug 6, 2015 at 4:54 AM, Paul Markham <[email protected]> wrote:
> We have this requirement as well. We just put a when condition on the task
> in the handler to only restart the service if it's not prod. You need to
> have the environment in a variable for this to work.  e.g. this may not be
> the 100% correct syntax as I'm not at work, but we do something like:
>
>
> handler:
>     - service: name=httpd start=restarted
>       when: {{environment}} != 'prod'
>
> --
> 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/8a05691b-9768-4c56-b7e7-16e43144f9ce%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
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/CAJ5XC8k8i__qECzxb8p1eiopdvfuvhrP-3D8LPWwk623iDFL4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to