All I did was add some proxy variables to my host_vars for each host or
group, for example:

# proxy settings
proxy: true
proxy_host: 172.16.228.1
proxy_port: 3128

And I'd reference those in my proxy configs like this:

http://{{ proxy_host }}:{{ proxy_port }}

In my proxy role, I have added tasks with 'when: proxy' to only run only
when proxy is set to true.

- name: "Copy /etc/apt/apt.conf.d/00proxy for apt proxy configuration"
  template: src=00proxy.j2 dest=/etc/apt/apt.conf.d/00proxy owner=root
group=root mode=644
  when: ansible_distribution == 'Ubuntu' and proxy

If I don't want to use the proxy role I just add 'proxy: false' to my
host_vars for that server.

I'd like an easier way to just exclude the proxy role from hosts that
are set to false instead of adding when: proxy to each action.

> Jochen Hinrichsen <mailto:[email protected]>
> 10 November 2014 at 4:28 PM
> Could you resolve the issue? In case yes, i'd be happy to re-use
> whatever you came up with.
>
>
> On Tuesday, 21 January 2014 17:35:25 UTC+1, Marc wrote:
> -- 
> 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]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/ed342fee-2937-4568-9418-377b3db2961c%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/ed342fee-2937-4568-9418-377b3db2961c%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

-- 

Marc Peiser                         +27 71 678 5368
SensePost Information Security      +27 12 460 0880
pgp: www.sensepost.com/pgp/marc.txt

-- 
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/5474F519.5070902%40nerens.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to