Check 127.0.1.1 in /etc/hosts on Ubuntu

Bug #1586589 reported by Vikram Hosakote
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
kolla
Fix Released
High
zhubingbing

Bug Description

Ubuntu/Debian adds the following line in /etc/hosts.

127.0.1.1 <hostname>

https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_hostname_resolution

Kolla does not like this line in /etc/hosts and "kolla-ansible deploy" throws the error

"Hostname has to resolve to IP address of api_interface"

$ kolla-ansible deploy
TASK [rabbitmq : fail] *********************************************************
failed: [localhost] => (item={u'stdout': u'127.0.1.1 STREAM kolla-ubuntu\n127.0.1.1 DGRAM \n127.0.1.1 RAW ', u'cmd': [u'getent', u'ahostsv4', u'kolla-ubuntu'], u'end': u'2016-05-27 21:55:20.827997', '_ansible_no_log': False, u'warnings': [], u'changed': False, u'start': u'2016-05-27 21:55:20.823359', u'delta': u'0:00:00.004638', 'item': u'localhost', u'rc': 0, 'invocation': {'module_name': u'command', u'module_args': {u'creates': None, u'executable': None, u'chdir': None, u'_raw_params': u'getent ahostsv4 kolla-ubuntu', u'removes': None, u'warn': True, u'_uses_shell': False}}, 'stdout_lines': [u'127.0.1.1 STREAM kolla-ubuntu', u'127.0.1.1 DGRAM ', u'127.0.1.1 RAW '], u'stderr': u''}) => {"failed": true, "item": {"_ansible_no_log": false, "changed": false, "cmd": ["getent", "ahostsv4", "kolla-ubuntu"], "delta": "0:00:00.004638", "end": "2016-05-27 21:55:20.827997", "invocation": {"module_args": {"_raw_params": "getent ahostsv4 kolla-ubuntu", "_uses_shell": false, "chdir": null, "creates": null, "executable": null, "removes": null, "warn": true}, "module_name": "command"}, "item": "localhost", "rc": 0, "start": "2016-05-27 21:55:20.823359", "stderr": "", "stdout": "127.0.1.1 STREAM kolla-ubuntu\n127.0.1.1 DGRAM \n127.0.1.1 RAW ", "stdout_lines": ["127.0.1.1 STREAM kolla-ubuntu", "127.0.1.1 DGRAM ", "127.0.1.1 RAW "], "warnings": []}, "msg": "Hostname has to resolve to IP address of api_interface"}

PLAY RECAP *********************************************************************
localhost : ok=75 changed=23 unreachable=0 failed=1

Command failed ansible-playbook -i /usr/local/share/kolla/ansible/inventory/all-in-one -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla -e action=deploy /usr/local/share/kolla/ansible/site.yml

Hence, add a precheck to check if the line "127.0.1.1 <hostname>" does not exist in /etc/hosts on Ubuntu. If it exists, the precheck must fail and the user must remove this line in /etc/hosts and deploy kolla.

"kolla-ansible deploy" passes on Ubuntu if "127.0.1.1 <hostname>" does not exist in /etc/hosts.

Changed in kolla:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Vikram Hosakote (vhosakot)
milestone: none → newton-1
Revision history for this message
Vikram Hosakote (vhosakot) wrote :
Changed in kolla:
milestone: newton-1 → newton-2
Changed in kolla:
milestone: newton-2 → newton-3
Changed in kolla:
milestone: newton-3 → newton-rc1
Changed in kolla:
milestone: newton-rc1 → newton-rc2
Changed in kolla:
assignee: Vikram Hosakote (vhosakot) → zhubingbing (zhubingbing)
Revision history for this message
zhubingbing (zhubingbing) wrote :

Fixed by https://review.openstack.org/#/c/322384/
so i will close this bugs

Changed in kolla:
status: In Progress → Fix Released
status: Fix Released → Invalid
importance: Medium → Low
Changed in kolla:
status: Invalid → In Progress
importance: Low → High
Revision history for this message
zhubingbing (zhubingbing) wrote :
Revision history for this message
Duong Ha-Quang (duonghq) wrote :
Changed in kolla:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on kolla (master)

Change abandoned by Jeffrey Zhang (jeffrey.zhang@99cloud.net) on branch: master
Review: https://review.openstack.org/322384
Reason: long time no update for this. And another PS fixed this.
Abandon this PS.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.