rabbitmq server fails to start on MAAS when multiple NICs are attached
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
rabbitmq-server (Juju Charms Collection) |
New
|
Undecided
|
Unassigned |
Bug Description
When deploying inside a LXD container on a MAAS node with multiple NICs attached, juju sometimes chooses one of the secondary NICs as primary interface, and as a result, unit-get private-address returns the IP address of the secondary interface.
Currently, the rabbitmq-server charm tries to determine the local node name by doing a reverse DNS lookup on the primary-address. In the above mentioned case, this would yield:
eth2.container-
The node name in this case is eth2, which does not exist in /etc/hosts. As a result, rabbitmq fails to start complaining it could not connect to node rabbitmq@eth2. To get past this, I had to change the charm to fetch the local hostname first, and fallback to the reverse DNS lookup (the reverse of what is happening now).