ansible 2.5 takes internal role_name var seriously

Bug #1771171 reported by Emilien Macchi on 2018-05-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Critical
Emilien Macchi

Bug Description

"role_name" has been an internal Ansible variable since 2.2 but we use it in TripleO for our own TripleO roles (nothing to do with Ansible roles).

It was working by accident but with Ansible 2.5 it's now seriously considered.
Therefore, some tasks (deploy_step_tasks and probably more) are now ignored when role_name is used in "when" statement.

We need to rename our tripleo role_name variable into triple_role_name to avoid any collision.

description: updated
Changed in tripleo:
status: Triaged → In Progress

Reviewed: https://review.openstack.org/568342
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=fe6511cfeb50544ce6d6ea8a66a8eac701564ba0
Submitter: Zuul
Branch: master

commit fe6511cfeb50544ce6d6ea8a66a8eac701564ba0
Author: Emilien Macchi <email address hidden>
Date: Mon May 14 11:07:22 2018 -0700

    deploy/upgrade: include tripleo_role_name

    "role_name" is internal to Ansible, we should not use it.
    As a transition, include "tripleo_role_name" when calling Ansible and
    once we're ready we'll remove the role_name var in a future patch.

    Change-Id: Ib477b35ed1c062f2ea6c7d9d2d41ac58f3b275e2
    Related-Bug: #1771171

Reviewed: https://review.openstack.org/568443
Committed: https://git.openstack.org/cgit/openstack/tripleo-upgrade/commit/?id=a4898108bd47735fd5db5a534c43dcb75a9e1235
Submitter: Zuul
Branch: master

commit a4898108bd47735fd5db5a534c43dcb75a9e1235
Author: Emilien Macchi <email address hidden>
Date: Mon May 14 22:07:31 2018 -0700

    Use tripleo_role_name instead of role_name

    role_name is private in Ansible 2.2 and we were lucky that it worked
    until 2.4 but now in 2.5 it conflicts with tripleo vars.
    We need to stop using it as we rename it here:
    https://review.openstack.org/#/q/topic:bug/1771171

    Change-Id: Id52a9c6b40c2af0e1fb40476a50669b2e07d3541
    Related-Bug: #1771171

Reviewed: https://review.openstack.org/568340
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=9ce1c075253900a7944531bcb8357082b481e34e
Submitter: Zuul
Branch: master

commit 9ce1c075253900a7944531bcb8357082b481e34e
Author: Emilien Macchi <email address hidden>
Date: Mon May 14 11:02:05 2018 -0700

    Include 'tripleo_role_name' in the inventory

    "role_name" is internal to Ansible, we should not use it.
    As a transition, include "tripleo_role_name" in the inventory and once
    we're ready we'll remove our usage of "role_name", in a future patch.

    Related-Bug: #1771171
    Change-Id: I57c4eac87e2f96dfe5490b111cd2508505715d56
    Depends-On: Id52a9c6b40c2af0e1fb40476a50669b2e07d3541

Reviewed: https://review.openstack.org/568343
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=1bec01137eca33fa210daa044571629b6ff848b8
Submitter: Zuul
Branch: master

commit 1bec01137eca33fa210daa044571629b6ff848b8
Author: Emilien Macchi <email address hidden>
Date: Mon May 14 11:15:09 2018 -0700

    deploy-steps: switch to tripleo_role_name

    "role_name" is internal to Ansible, we should not use it.
    This patch uses the new variable set in the inventory to use a specific
    TripleO var: tripleo_role_name which is the TripleO role name and not
    the Ansible role names, both things are very different.

    Depends-On: I57c4eac87e2f96dfe5490b111cd2508505715d56
    Change-Id: Iecaf6f1b830e65be2f9e2e44431054fe46f9f565
    Related-Bug: #1771171

Changed in tripleo:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/568346
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=433c5c814b7da04f485b1bdcb04730f6f3cefded
Submitter: Zuul
Branch: master

commit 433c5c814b7da04f485b1bdcb04730f6f3cefded
Author: Emilien Macchi <email address hidden>
Date: Mon May 14 11:18:26 2018 -0700

    (cleanup) remove usage of vars when calling ansible

    Cleanup patch, we shouldn't need the variable anymore, they're all in
    the inventory.

    Depends-On: Iecaf6f1b830e65be2f9e2e44431054fe46f9f565
    Change-Id: I98727d3e4303e0d693e88562e88306053cc3c06a
    Related-Bug: #1771171

Reviewed: https://review.openstack.org/568347
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=26ea79f0a3fd79ee184c0d215d59d78959d6bf3e
Submitter: Zuul
Branch: master

commit 26ea79f0a3fd79ee184c0d215d59d78959d6bf3e
Author: Emilien Macchi <email address hidden>
Date: Mon May 14 11:20:35 2018 -0700

    (cleanup) remove usage of role_name

    Cleanup patch, we shouldn't need the variable anymore.

    Change-Id: I47e1f2aa6e6e032cac141801ad23b70429ff52c6
    Depends-On: I1fe40b655195b377f6587b20d9d78c887dfd91c5
    Related-Bug: #1771171

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

commit f3970c2db0bb56b668da1ab82b557d52c458a28e
Author: Emilien Macchi <email address hidden>
Date: Mon May 14 11:02:05 2018 -0700

    Include 'tripleo_role_name' in the inventory

    "role_name" is internal to Ansible, we should not use it.
    As a transition, include "tripleo_role_name" in the inventory and once
    we're ready we'll remove our usage of "role_name", in a future patch.

    Related-Bug: #1771171
    Change-Id: I57c4eac87e2f96dfe5490b111cd2508505715d56
    (cherry picked from commit 9ce1c075253900a7944531bcb8357082b481e34e)

tags: added: in-stable-queens

Reviewed: https://review.openstack.org/582428
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=7af622b1176b4ef03ef9acc6f8663b2614b2eb47
Submitter: Zuul
Branch: stable/queens

commit 7af622b1176b4ef03ef9acc6f8663b2614b2eb47
Author: Emilien Macchi <email address hidden>
Date: Mon May 14 11:15:09 2018 -0700

    deploy-steps: switch to tripleo_role_name

    "role_name" is internal to Ansible, we should not use it.
    This patch uses the new variable set in the inventory to use a specific
    TripleO var: tripleo_role_name which is the TripleO role name and not
    the Ansible role names, both things are very different.

    Depends-On: I57c4eac87e2f96dfe5490b111cd2508505715d56
    Change-Id: Iecaf6f1b830e65be2f9e2e44431054fe46f9f565
    Related-Bug: #1771171
    (cherry picked from commit 1bec01137eca33fa210daa044571629b6ff848b8)

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

Other bug subscribers