Agreed, "environment" is probably a bad choice of variable names. We
actually use a variable called "node_environment".
On Friday, August 7, 2015 at 1:09:48 AM UTC+10, Brian Coca wrote:
>
> 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]
> <javascript:>> 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] <javascript:>.
> > To post to this group, send email to [email protected]
> <javascript:>.
> > 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/19149622-6fd8-4478-8a67-e686c7945306%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.