Open scottlangendyk opened 3 years ago
Upon closer inspection seems this is caused by the way the connection hash is generated for the socket path.
It's using the value from ansible_port. Setting that resolves the issue. Perhaps the httpapi connection can set ansible_port based on the value of ansible_httpapi_port.
@scottlangendyk Apologies for the super late response here. Just for my understanding, are you saying that it works when you set ansible_port
but not ansible_httpapi_port
?
SUMMARY
When declaring multiple hosts that use the httpapi connection with the same IP address but different ports, outgoing requests will use the same port for all hosts.
ISSUE TYPE
COMPONENT NAME
httpapi
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal
STEPS TO REPRODUCE
I've created a github repo demonstrating the issue. Requires docker and docker-compose to spin up 3 web servers that echo the http request headers. docker-compose up is run automatically during playbook execution
https://github.com/scottlangendyk/ansible-httpapi-issue
EXPECTED RESULTS
The echod HTTP Host header should match the port specified for ansible_httpapi_port.
ACTUAL RESULTS