Hi there! We have some Ubuntu machines behind a proxy and the apt_key call does not work behind one. This is apparently a long known issue with ansible and there's a lot of discussion (almost arguing) about it. While there are some indications that it is fixed in a 'soon' release of ansible, it definitely does not appear to be in the very latest per my testing.
A suggested workaround was to use locate inside a data param instead of the url param, which does respect your proxy settings.
Here are some interesting references from my research if you are interested in taking a look:
Hi there! We have some Ubuntu machines behind a proxy and the apt_key call does not work behind one. This is apparently a long known issue with ansible and there's a lot of discussion (almost arguing) about it. While there are some indications that it is fixed in a 'soon' release of ansible, it definitely does not appear to be in the very latest per my testing.
A suggested workaround was to use locate inside a data param instead of the url param, which does respect your proxy settings.
Here are some interesting references from my research if you are interested in taking a look:
This seems to be a solid workaround and is functioning well in my testing.