bootstrap-servers is not working with --limit flag

Bug #1713725 reported by Soeren Becker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
Medium
Unassigned
Ocata
Triaged
Medium
Unassigned
Pike
Fix Released
Medium
Unassigned

Bug Description

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)

Soeren Becker (srnbckr)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (master)

Reviewed: https://review.openstack.org/498799
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=c24afe6d6839786a7624c28fb3c180716d1b2cb1
Submitter: Jenkins
Branch: master

commit c24afe6d6839786a7624c28fb3c180716d1b2cb1
Author: Soeren Becker <email address hidden>
Date: Tue Aug 29 14:49:48 2017 +0200

    Enable use of --limit when using bootstrap-servers

    The ansible/kolla-host.yml playbook failed when called with a --limit
    flag.

    This was due to the fact that only the facts of the subset of hosts
    were gathered but the "Generate /etc/hosts for all of the nodes" task
    is using the ansible_<IFACE>.ipv4.address variable of all hosts.

    The code for this fix is copied from the site.yml playbook
    where it was used for the same reason.

    Change-Id: I7e70caf750506ad8ab36ec024bd9647dd733fbd0
    Closes-Bug: #1713725

Changed in kolla-ansible:
status: Triaged → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 5.0.0.0rc1

This issue was fixed in the openstack/kolla-ansible 5.0.0.0rc1 release candidate.

Revision history for this message
sean mooney (sean-k-mooney) wrote :

i have submitted a revert for this as the patch is broken in two ways.
first this patch moved the gatering of facts before we install the requirment for the setup module to work on the remote host and second ansible_play_batch is undefiend.

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.