Deployment task getting run when using --tags with a differnt value than the task

Bug #1885721 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

This LP bug is a tracking one for https://bugzilla.redhat.com/show_bug.cgi?id=1851914

Basically, when running one of the FFU steps to upgrade from Queens to Train, we execute:

openstack overcloud upgrade run --stack overcloud --tags system_upgrade --limit controller-1

This command will run all the upgrade-playbook-steps.yaml followed by deployment-steps-playbook. As the --tags system_upgrade is passed, it is expected than only those upgrade tasks with the tag system_upgrade will be executed, however when getting to the deployment tasks playbook the command fails with:

PLAY RECAP *********************************************************************
controller-1 : ok=22 changed=4 unreachable=0 failed=0 skipped=24 rescued=0 ignored=0

Monday 29 June 2020 07:59:53 -0400 (0:00:00.058) 0:01:13.059 ***********
===============================================================================

Updated nodes - controller-1
Success
2020-06-29 07:59:54.477 1045725 WARNING tripleoclient.plugin [-] Waiting for messages on queue 'tripleo' with no timeout.
Using /var/lib/mistral/5546c481-3cf6-41ad-a8a6-30fe55c001b3/ansible.cfg as config file

PLAY [Gather facts from undercloud] ********************************************
skipping: no hosts matched

PLAY [Gather facts from overcloud] *********************************************

PLAY [Load global variables] ***************************************************

TASK [include_vars] ************************************************************
Monday 29 June 2020 08:00:01 -0400 (0:00:00.145) 0:00:00.145 ***********
[WARNING]: log file at /var/log/containers/mistral/package_update.log is not writeable and we cannot create it, aborting

[WARNING]: Failure using method (v2_runner_on_start) in callback plugin
(<ansible.plugins.callback.tripleo.CallbackModule object at 0x7f15dd2b2ef0>):
'show_per_host_start'
ok: [controller-1] => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false}

PLAY [Ensure /var/lib/config-data context] *************************************

TASK [Ensure /var/lib/config-data context] *************************************
Monday 29 June 2020 08:00:01 -0400 (0:00:00.079) 0:00:00.225 ***********
changed: [controller-1] => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": true, "cmd": "set -o pipefail\nif [[ -e /var/lib/config-data ]]; then\n chcon -R -t svirt_sandbox_file_t /var/lib/config-data\nexit 2\nfi", "delta": "0:00:02.055794", "end": "2020-06-29 12:00:04.454095", "failed_when_result": false, "msg": "non-zero return code", "rc": 2, "start": "2020-06-29 12:00:02.398301", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

PLAY [Render all_nodes data as group_vars for overcloud] ***********************

TASK [Render all_nodes data as group_vars for overcloud] ***********************
Monday 29 June 2020 08:00:04 -0400 (0:00:02.856) 0:00:03.081 ***********
ok: [controller-1 -> localhost] => {"all_nodes": null, "changed": false}

PLAY [Set all_nodes data as group_vars for overcloud] **************************

TASK [Set all_nodes data as group_vars for overcloud] **************************
Monday 29 June 2020 08:00:08 -0400 (0:00:03.602) 0:00:06.683 ***********
ok: [controller-1] => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false}

PLAY [Manage SELinux] **********************************************************

PLAY [Generate /etc/hosts] *****************************************************

PLAY [Common roles for TripleO servers] ****************************************

TASK [tripleo-bootstrap : Gather variables for each operating system] **********
Monday 29 June 2020 08:00:08 -0400 (0:00:00.110) 0:00:06.794 ***********
fatal: [controller-1]: FAILED! => {"msg": "No file was found when using first_found. Use errors='ignore' to allow this task to be skipped if no files are found"}

NO MORE HOSTS LEFT *************************************************************

PLAY RECAP *********************************************************************
controller-1 : ok=4 changed=1 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

Monday 29 June 2020 08:00:08 -0400 (0:00:00.059) 0:00:06.854 ***********
===============================================================================

Ansible failed, check log at /var/log/mistral/package_update.log.

Which corresponds to this block: https://github.com/openstack/tripleo-heat-templates/blob/stable/train/common/deploy-steps.j2#L471-L473 that has a different tag common_roles (which in theory should have been skipped).

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

Fix proposed to branch: master
Review: https://review.opendev.org/738606

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

Reviewed: https://review.opendev.org/738606
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=70eacd3dab79a02e24bc30c97cdf5dc744908605
Submitter: Zuul
Branch: master

commit 70eacd3dab79a02e24bc30c97cdf5dc744908605
Author: Jose Luis Franco Arza <email address hidden>
Date: Tue Jun 30 14:54:29 2020 +0200

    Convert roles section into tasks-include_role in deploy-steps.j2.

    When executing the deployment_steps_playbook.yaml passing
    a specific --tags, it looks like this play gets executed
    even though the tag passed in --tags isn't common_roles.

    This patch converts the roles: structure into a:
    tasks:
      - include_role:

    which is the prefered way since Ansible 2.4. This way, the
    tags work properly and the execution of both roles is skipped
    if the tag doesn't match common_roles.

    Change-Id: I772ad486ca11525b8756a0b8cac7a5345373a5d3
    Closes-Bug: #1885721

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/741422

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

Fix proposed to branch: stable/train
Review: https://review.opendev.org/741423

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

Reviewed: https://review.opendev.org/741422
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=3b6874daa9e794babfc53a2db38d34caef8aa437
Submitter: Zuul
Branch: stable/ussuri

commit 3b6874daa9e794babfc53a2db38d34caef8aa437
Author: Jose Luis Franco Arza <email address hidden>
Date: Tue Jun 30 14:54:29 2020 +0200

    Convert roles section into tasks-include_role in deploy-steps.j2.

    When executing the deployment_steps_playbook.yaml passing
    a specific --tags, it looks like this play gets executed
    even though the tag passed in --tags isn't common_roles.

    This patch converts the roles: structure into a:
    tasks:
      - include_role:

    which is the prefered way since Ansible 2.4. This way, the
    tags work properly and the execution of both roles is skipped
    if the tag doesn't match common_roles.

    Change-Id: I772ad486ca11525b8756a0b8cac7a5345373a5d3
    Closes-Bug: #1885721
    (cherry picked from commit 70eacd3dab79a02e24bc30c97cdf5dc744908605)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/train)

Reviewed: https://review.opendev.org/741423
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=7bd1d7379733961c0f74c0b0dee14ce32de2f359
Submitter: Zuul
Branch: stable/train

commit 7bd1d7379733961c0f74c0b0dee14ce32de2f359
Author: Jose Luis Franco Arza <email address hidden>
Date: Tue Jun 30 14:54:29 2020 +0200

    Convert roles section into tasks-include_role in deploy-steps.j2.

    When executing the deployment_steps_playbook.yaml passing
    a specific --tags, it looks like this play gets executed
    even though the tag passed in --tags isn't common_roles.

    This patch converts the roles: structure into a:
    tasks:
      - include_role:

    which is the prefered way since Ansible 2.4. This way, the
    tags work properly and the execution of both roles is skipped
    if the tag doesn't match common_roles.

    Change-Id: I772ad486ca11525b8756a0b8cac7a5345373a5d3
    Closes-Bug: #1885721
    (cherry picked from commit 70eacd3dab79a02e24bc30c97cdf5dc744908605)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 11.4.0

This issue was fixed in the openstack/tripleo-heat-templates 11.4.0 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.