You do have to set it on a per task basis, at least presently.

The best way to do this is to assign it to a task variable, on each task,
just

- some_module: some_args=1234
  environment: my_env

I'm open to including environment as a playbook value also, it's just
something that's not there presently.  If it were, it would need to have
the task ones merged in each time so the play variables get overriden if
any of the same ones are set.

Pull requests would be entertained and welcome (and awesome), otherwise
open a feature request on github?




On Fri, May 9, 2014 at 6:10 PM, Adam Duren <[email protected]> wrote:

> I have a Django project that loads most of it's environment specific
> configuration from environment variables.
>
> Ansible provides you a way to set the environment, variable by variable,
> but it appears to be on a per task basis. In my project I load over 10
> environment variables, for keys, hostnames, and other reasons.
>
> If I want to run multiple commands does this mean that I have to
> repeatedly set the environment?
> Is there a better facility to do this or a way to load the environment
> varaibles of a user in Ansible?
>
> Thanks,
> --Adam
>
> --
> 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/9785a2cf-ca73-475f-9d49-79707110a8ce%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/9785a2cf-ca73-475f-9d49-79707110a8ce%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CA%2BnsWgw-Z204K72CxkUFdcOkWa2vFbLnGfJ6oiz1Pzkd_K0GCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to