The purpose of the 'physical_host_addrs' variable was to create a
mapping with all the physical hosts and their IP addresses. However,
the function was broken because it used the 'physical_host' task
variable to obtain the name of the physical host for the running task.
As such, the dictionary only contained a single entry. This breaks
delegation between hosts, since there was no entry in the dictionary for
the delegated host. So if a task targetting containerA on hostA was
delegated to containerB on hostB, the IP address of the hostB was not
in the dictionary. The connection plugin code then used the 'hostB'
hostname to connect to the host instead of its IP. However, if there
is no central DNS to translate hostB to an IP or if the deployer
did not add such mapping to /etc/hosts we observed the following
problem.
fatal: [compute00]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh:
Could not resolve hostname controller00: Name or service not known\r\n", "unreachable": true}
In order to fix that, we now examine the delegated host and create the
appropriate mappings if the task is delegated. This ensures that the
physical_host_addrs variable also contains information for the delegated
hosts instead of just the original one.
Change-Id: Ic84ad3ccdd8283a4ab3fb3130d4d5e520ab736de
These are the plugins the OpenStack-Ansible deployment project relies
on. The plugins can be added to any Ansible project by simply cloning
this repository and setting up the ansible.cfg file to
point at them as additional plugins for your project.