I’m trying to deploy OpenStack on a virtual machine running CentOS 8.3.2011 by following this link, but I got an error on the pre checks phase when running the command:
kolla-ansible -i ./all-in-one prechecks
The error message was:
TASK [rabbitmq : Check if each rabbit hostname resolves uniquely to the proper IP address] *****************************failed: [localhost] (item=[{'cmd': ['getent', 'ahostsv4', 'localhost'], 'stdout': '127.0.0.1 STREAM localhostn127.0.0.1 DGRAM n127.0.0.1 RAW n127.0.0.1 STREAM n127.0.0.1 DGRAM n127.0.0.1 RAW n192.168.56.103 STREAM n192.168.56.103 DGRAM n192.168.56.103 RAW ', 'stderr': '', 'rc': 0, 'start': '2021-05-28 07:48:12.453408', 'end': '2021-05-28 07:48:12.455955', 'delta': '0:00:00.002547', 'changed': False, 'invocation': {'module_args': {'_raw_params': 'getent ahostsv4 localhost', 'warn': True, '_uses_shell': False, 'stdin_add_newline': True, 'strip_empty_ends': True, 'argv': None, 'chdir': None, 'executable': None, 'creates': None, 'removes': None, 'stdin': None}}, 'stderr_lines': [], 'failed': False, 'item': 'localhost', 'ansible_loop_var': 'item'}, '127.0.0.1 STREAM localhost']) => {"ansible_loop_var": "item", "changed": false, "item": [{"ansible_loop_var": "item", "changed": false, "cmd": ["getent", "ahostsv4", "localhost"], "delta": "0:00:00.002547", "end": "2021-05-28 07:48:12.455955", "failed": false, "invocation": {"module_args": {"_raw_params": "getent ahostsv4 localhost", "_uses_shell": false, "argv": null, "chdir": null, "creates": null, "executable": null, "removes": null, "stdin": null, "stdin_add_newline": true, "strip_empty_ends": true, "warn": true}}, "item": "localhost", "rc": 0, "start": "2021-05-28 07:48:12.453408", "stderr": "", "stderr_lines": [], "stdout": "127.0.0.1 STREAM localhostn127.0.0.1 DGRAM n127.0.0.1 RAW n127.0.0.1 STREAM n127.0.0.1 DGRAM n127.0.0.1 RAW n192.168.56.103 STREAM n192.168.56.103 DGRAM n192.168.56.103 RAW "}, "127.0.0.1 STREAM localhost"], "msg": "Hostname has to resolve uniquely to the IP address of api_interface"}
How can I fix this?
2
Answers
Edit the
/etc/hosts
file. Comment out the above two lines and make an entry against your ip to localhostI have recently faced this issue in my control node where prechecks ended up showing failure status against my compute node. I went to look at its /etc/hosts file which has two entries for a single hostname (ubuntu in my case).
I edited the file manually to contain only one entry (primary interface IP against username ubuntu).
It worked and prechecks phase was successful.