In fairness, I probably am Doing It Wrong in some respects -
I don't have prod/dev groups in this case, we're using a different
inventory for prod and dev.
The alternative would be to have [prod_mongos] , [prod_mongors], [dev_mongos]
etc. etc. in the inventory which seems a bit cut n pasty to me.
With the 2 inventory approach, I can have the same groups across environments
that differ only in FQDNs and number of members, and then an [all:vars] to hold
environment-wide 'globals' (NTP settings, proxy, ansible_ssh* settings etc).
For the record :
I got this working cleanly (to my mind at least ) thanks to @drybjed
on IRC pointing
out set_fact.
I have a roles/proxyenv/tasks/main.yml applied to all hosts
that mpopulates a proxy_env var using set_fact + when
and then all our yum/get_url/gem etc. always have an environment:
proxy_env tacked onto them.
Environments that don't need to use a proxy simply don't set one in
their inventory, and
so that proxy_env dict is empty for them.
>> email to
ansible-proje...@googlegroups.com.
>> To post to this group, send email to
ansible...@googlegroups.com.
> --
> 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
ansible-proje...@googlegroups.com.
> To post to this group, send email to
ansible...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyw_neYLS6GFzwzZpsq%3DHJej8gMiHTqgeid2_rXbKti0w%40mail.gmail.com.