OpenSSH allows to act as an encrypted tunnel with a socks proxy. This can be used for openstack modules in ansible. However the ansible documentation doesn't mention how to use any other proxy than HTTP/HTTPS.
How to use ansible openstack modules with a ssh socks proxy
ansiblePROXYsocks
Best Answer
socks proxy
First configure OpenSSH socks tunnel:
Add in
~/.ssh/config
something like:Now test that you can access the Horizon dashboard with:
openstack client config - clouds.yml
Create
~/clouds.yaml
file with the following content:Test with:
ansible
Create an openstack_test.yaml file with the following content:
The environment variable
ALL_PROXY
needs to be set tosocks5h://localhost:65432
. This variable is used by libcurl which is used by most ansible modules that are connecting to remote http services. For more details see: https://curl.haxx.se/libcurl/c/libcurl-env.html and https://curl.haxx.se/libcurl/c/CURLOPT_SOCKS_PROXY.html