I’m using a role in my playbook that uses the apt_key module:
`
- name: import repository key
`
apt_key: url=http://www.rabbitmq.com/rabbitmq-signing-key-public.asc state=present
The target host sits behind a proxy, and I have the usual proxy environment variables already set. This is enough to get various apt, apt_repository and other external-resource-calling tasks to work without a problem. However apt_key fails:
msg: Failed to download key at http://www.rabbitmq.com/rabbitmq-signing-key-public.asc: Request failed:
If I explicitly set the environment proxy variables on the task then the problem is resolved (as below). Why do I explicitly have to set the environment for apt_key and not other modules? Is this intended?
`
- name: import repository key
apt_key: url=http://www.rabbitmq.com/rabbitmq-signing-key-public.asc state=present
environment:
http_proxy: http://proxy.domain.com:8080
`