I want to set an environment proxy only for a particular ansible task like get_url
module to download some application from internet. Other all tasks should run without any proxy. How do I achieve this task.
You can set a proxy per task, like so:
get_url:
url=http://remote.host.com/file
dest=/tmp/file
environment:
http_proxy: http://proxy.example.com:8080