overcloud deploy command calls ansible-playbook always with "--limit !"

Bug #1785597 reported by Jose Luis Franco
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Jose Luis Franco

Bug Description

When deploying the overcloud the mistral workflow tripleo.deploying is being called. At the same time, this workflow makes use of the tripleo.ansible-playbook action that calls ansible-playbook action with a set of parameters. When the self.blacklisted_hostnames parameter argument is passed, then the --limit option will be appended to the ansible-playbook command including all the list elements inside self.blacklisted_hostnames preceded by "!" character. The issue comes when the self.blacklisted_hostnames argument is equals to [""], which is the case by default. In that case, tripleo.deploying workflow ends up calling ansible-playbook with --limit ! :

http://logs.openstack.org/49/586249/9/check/tripleo-ci-centos-7-containers-multinode/62dbc1b/logs/undercloud/var/lib/mistral/overcloud/ansible-playbook-command.sh.txt.gz

Revision history for this message
Jose Luis Franco (jfrancoa) wrote :

When calling the action used to get the blacklisted_hostnames argument, this is what we get: (undercloud) [zuul@subnode-0 ~]$ openstack action execution run heat.stacks_output_show '{"stack_id" : "overcloud", "output_key" : "BlacklistedHostnames" }'
{"result": {"output": {"output_value": [""], "output_key": "BlacklistedHostnames", "description": "List of blacklisted hostnames"}}}

So, self.blacklisted_hostnames is by default [""] if not BlacklistedHostnames were defined for the role.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (master)

Fix proposed to branch: master
Review: https://review.openstack.org/589153

Changed in tripleo:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (master)

Reviewed: https://review.openstack.org/589153
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=1ad01c3335b3f788b8c84f49ab82cf508c0b65c0
Submitter: Zuul
Branch: master

commit 1ad01c3335b3f788b8c84f49ab82cf508c0b65c0
Author: Jose Luis Franco Arza <email address hidden>
Date: Mon Aug 6 15:28:22 2018 +0200

    Avoid getting one-empty-element-list in blacklisted_hostnames.

    When obtaining the output from the heat.stack_output_show
    action [0], if no parameter is specified in the stack, then
    the action returns a list of one empty string ['']. This
    is causing some error when calling tripleo.ansible-playbook
    workbook, as self.blacklisted_hostnames get set, as the
    argument passed is a non-empty list [1], and the result is
    that the argument '!' is always passed to the --limit
    option when calling ansible-playbook.

    [0] - https://github.com/openstack/tripleo-common/blob/master/workbooks/deployment.yaml#L365
    [1] - https://github.com/openstack/tripleo-common/blob/master/tripleo_common/actions/ansible.py#L461-L464

    Change-Id: I559d5ec5548ca24490a204809c7167660c307bac
    Closes-Bug: #1785597

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 9.3.0

This issue was fixed in the openstack/tripleo-common 9.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/604165

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (stable/queens)

Reviewed: https://review.openstack.org/604165
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=01a4d265e30a0a0f03db25e5955da4d1b7b27a82
Submitter: Zuul
Branch: stable/queens

commit 01a4d265e30a0a0f03db25e5955da4d1b7b27a82
Author: Jose Luis Franco Arza <email address hidden>
Date: Mon Aug 6 15:28:22 2018 +0200

    Avoid getting one-empty-element-list in blacklisted_hostnames.

    When obtaining the output from the heat.stack_output_show
    action [0], if no parameter is specified in the stack, then
    the action returns a list of one empty string ['']. This
    is causing some error when calling tripleo.ansible-playbook
    workbook, as self.blacklisted_hostnames get set, as the
    argument passed is a non-empty list [1], and the result is
    that the argument '!' is always passed to the --limit
    option when calling ansible-playbook.

    [0] - https://github.com/openstack/tripleo-common/blob/master/workbooks/deployment.yaml#L365
    [1] - https://github.com/openstack/tripleo-common/blob/master/tripleo_common/actions/ansible.py#L461-L464

    Change-Id: I559d5ec5548ca24490a204809c7167660c307bac
    Closes-Bug: #1785597
    (cherry picked from commit 1ad01c3335b3f788b8c84f49ab82cf508c0b65c0)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 8.6.7

This issue was fixed in the openstack/tripleo-common 8.6.7 release.

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.