# per-host proxy setting

**URL:** <https://forum.ansible.com/t/per-host-proxy-setting/26548>\
**Category:** Ansible Project\
**Created:** [January 24, 2018, 2:31am UTC](https://forum.ansible.com/t/per-host-proxy-setting/26548 "2018-01-24T02:31:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sureshkumar\_Kalianna](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@Sureshkumar\_Kalianna](https://forum.ansible.com/u/Sureshkumar_Kalianna)\
**Post date:** [January 24, 2018, 2:31am UTC](https://forum.ansible.com/t/per-host-proxy-setting/26548/1 "2018-01-24T02:31:48Z")

</div>

Hi,

Can https\_proxy be set on a per-host basis for e.g,

[nodes]  
[NFL-00053.abc.com](http://NFL-00053.abc.com) ansible\_ssh\_port=16385 ansible\_ssh\_host=localhost https\_proxy=[http://192.168.101.1:3128](http://192.168.101.1:3128)

This doesn’t seem to work.

The https\_proxy looks like needs to be setup as an environment variable in a playbook.

environment:  
https\_proxy: “{{ https\_proxy }}”

But then this would apply to all hosts…

Can environment section be generated per-host from the inventory script?

I’m using ansible 2.3

thanks a lot for any guidance  
Suresh

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [January 25, 2018, 7:00am UTC](https://forum.ansible.com/t/per-host-proxy-setting/26548/2 "2018-01-25T07:00:13Z")

</div>

It wont since the https\_proxy variable is only set on that one host.

Normally it should fail on host that don't have the variable https\_proxy set, but if you test you'll see that it works.  
If this is a feature or a bug I do not know
