Comment 0 for bug 1713725

Revision history for this message
Soeren Becker (srnbckr) wrote :

When using bootstrap-servers (ansible/kolla-host.yml playbook) with a --limit flag
the run fails.

This is due to the fact that only the facts of the subset of hosts
are gathered but the "Generate /etc/hosts for all of the nodes" task
in "ansible/roles/baremetal/tasks/pre-install.yml" is using the
ansible_<IFACE>.ipv4.address variable of all hosts.

The proposed fix is to add the following to ansible/kolla-host.yml:

- name: Gather facts for all hosts
  hosts: all
  serial: '{{ serial|default("0") }}'
  gather_facts: false
  tasks:
    - setup:
  tags: always

- name: Gather facts for all hosts (if using --limit)
  hosts: all
  serial: '{{ serial|default("0") }}'
  gather_facts: false
  tasks:
    - setup:
      delegate_facts: True
      delegate_to: "{{ item }}"
      with_items: "{{ groups['all'] }}"
      when:
        - (ansible_play_batch | length) != (groups['all'] | length)