bootstrap-server failing due to hostname /etc/hosts

Bug #1951849 reported by admin0
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Invalid
Undecided
Unassigned

Bug Description

bootstrap fails to run .. and the error does not make sense.

(kolla-run) root@local:/etc/kolla# kolla-ansible -i multinode bootstrap-servers --limit v111
Bootstrapping servers : ansible-playbook -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla --limit v111 -e kolla_action=bootstrap-servers /opt/kolla-run/share/kolla-ansible/ansible/kolla-host.yml --inventory multinode
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details
[WARNING]: * Failed to parse /etc/kolla/multinode with yaml plugin: We were unable to read either as JSON nor
YAML, these are the errors we got from each: JSON: Expecting value: line 1 column 1 (char 0) Syntax Error while
loading YAML. did not find expected <document start> The error appears to be in '/etc/kolla/multinode': line
5, column 1, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears
to be: # These hostname must be resolvable from your deployment host v111 ^ here
[WARNING]: * Failed to parse /etc/kolla/multinode with ini plugin: /etc/kolla/multinode:42: Section
[prometheus-cadvisor:children] includes undefined group: storage
[WARNING]: Unable to parse /etc/kolla/multinode as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not
match 'all'

PLAY [Gather facts for all hosts] *******************************************************************************
skipping: no hosts matched
[WARNING]: Could not match supplied host pattern, ignoring: all_using_limit_True

PLAY [Gather facts for all hosts (if using --limit)] ************************************************************
skipping: no hosts matched

PLAY [Apply role baremetal] *************************************************************************************

TASK [baremetal : include_tasks] ********************************************************************************
included: /opt/kolla-run/share/kolla-ansible/ansible/roles/baremetal/tasks/bootstrap-servers.yml for v111

TASK [baremetal : Ensure localhost in /etc/hosts] ***************************************************************
changed: [v111]

TASK [baremetal : Ensure hostname does not point to 127.0.1.1 in /etc/hosts] ************************************
fatal: [v111]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'hostname'\n\nThe error appears to be in '/opt/kolla-run/share/kolla-ansible/ansible/roles/baremetal/tasks/pre-install.yml': line 17, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n# and https://bugs.launchpad.net/kolla-ansible/+bug/1862739\n- name: Ensure hostname does not point to 127.0.1.1 in /etc/hosts\n ^ here\n"}

PLAY RECAP ******************************************************************************************************
v111 : ok=2 changed=1 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

root@local:/etc/kolla# ssh v111 cat /etc/hosts
Warning: Permanently added 'v111,192.168.88.111' (ECDSA) to the list of known hosts.
127.0.0.1 localhost
(kolla-run) root@local:/etc/kolla#

Revision history for this message
Radosław Piliszek (yoctozepto) wrote :

Ansible is known for really bad error reporting.
This is the offending line:

    regexp: "^127.0.1.1\\b.*\\s{{ ansible_facts.hostname }}\\b"

Seemingly, in your case ansible_facts are missing hostname.
As this is the first usage of ansible_facts in this action, I would check if facts were collected and bingo - they were not (based on your log):

    PLAY [Gather facts for all hosts]
    skipping: no hosts matched

You have an inventory parsing error above:

    [WARNING]: * Failed to parse /etc/kolla/multinode with yaml plugin...

It shall work when you fix it.

Changed in kolla-ansible:
status: New → Invalid
Revision history for this message
admin0 (shashi-eu) wrote :

Thank you.. I restarted the whole process again and it worked this time.
This ticket can be closed.

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.