Using --limit option in external update/upgrade run playbooks has no effect on limiting nodes during ansible playbook execution

Bug #1988827 reported by Mikolaj Ciecierski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Triaged
Medium
Unassigned

Bug Description

Description
===========

As a part of update/upgrade procedure, some update steps are triggered using `openstack overcloud external-update/upgrade run` command. The implementation of external-upgrade/update run command accepts a --limit parameter, which identifies a list of nodes that the config-download Ansible playbook execution will be limited to[1]. However, external update/upgrade playbooks are run from the undercloud as a controller, and tasks are run with the use of ansible delegation mechanism (using delegate_to) on nodes that belongs to a certain group from tripleo-ansible-inventory.

For instance,`openstack overcloud external-update run --tags ovn`, which allows limiting the scope of update actions to updating ovn container image on overcloud nodes[2] loops through ovn_controller group from tripleo inventory. If one would like to limit container image update action to happen only on some set of nodes from the ovn_controller group by using --limit option, it won't work and skip execution completly due to 'skipping: no hosts matched' problem.

Steps to reproduce
==================
1. Run overcloud update prepare
2. Run `external-update run`

openstack overcloud external-update run \
    --stack overcloud \
    --ssh-user stack \
    --limit compute-0 \
    --tags ovn

Expected result
===============
Execution of the steps from external-update should happen only on compute-0

Actual result
=============
None external update step is triggered and 'no hosts matched' info is returned by ansible playbook execution.

2022-09-06 04:47:40.402 697741 INFO tripleoclient.utils.utils [-] Running ansible with the following limit: compute-0

PLAY [Check if required variables are defined] *********************************
skipping: no hosts matched

PLAY [Clear cached facts] ******************************************************

PLAY [Gather facts] ************************************************************

PLAY [Load global variables] ***************************************************
2022-09-06 04:47:41.260427 | fa163ea5-485e-6193-7e50-000000000019 | OK | ansible.builtin.include_vars | compute-0
2022-09-06 04:47:41.261041 | fa163ea5-485e-6193-7e50-000000000019 | TIMING | ansible.builtin.include_vars | compute-0 | 0:00:00.163284 | 0.03s

PLAY [Include extra variables from files] **************************************
2022-09-06 04:47:41.294549 | fa163ea5-485e-6193-7e50-00000000001c | TASK | Include Service VIP vars
2022-09-06 04:47:41.317498 | fa163ea5-485e-6193-7e50-00000000001c | OK | Include Service VIP vars | compute-0
2022-09-06 04:47:41.318270 | fa163ea5-485e-6193-7e50-00000000001c | TIMING | Include Service VIP vars | compute-0 | 0:00:00.220512 | 0.02s
2022-09-06 04:47:41.326823 | fa163ea5-485e-6193-7e50-00000000001d | TASK | Include OVN bridge MAC address variables
2022-09-06 04:47:41.349584 | fa163ea5-485e-6193-7e50-00000000001d | OK | Include OVN bridge MAC address variables | compute-0
2022-09-06 04:47:41.350133 | fa163ea5-485e-6193-7e50-00000000001d | TIMING | Include OVN bridge MAC address variables | compute-0 | 0:00:00.252377 | 0.02s

PLAY [Render all_nodes data as group_vars for overcloud] ***********************
2022-09-06 04:47:41.407274 | fa163ea5-485e-6193-7e50-000000000020 | TASK | Render all_nodes data as group_vars for overcloud
2022-09-06 04:47:42.259358 | fa163ea5-485e-6193-7e50-000000000020 | OK | Render all_nodes data as group_vars for overcloud | compute-0 -> localhost

PLAY [Set all_nodes data as group_vars for overcloud] **************************
2022-09-06 04:47:42.297324 | fa163ea5-485e-6193-7e50-000000000023 | TASK | Set all_nodes data as group_vars for overcloud
2022-09-06 04:47:42.321333 | fa163ea5-485e-6193-7e50-000000000023 | OK | Set all_nodes data as group_vars for overcloud | compute-0
2022-09-06 04:47:42.322031 | fa163ea5-485e-6193-7e50-000000000023 | TIMING | Set all_nodes data as group_vars for overcloud | compute-0 | 0:00:01.224272 | 0.02s

PLAY [External update step 0] **************************************************
skipping: no hosts matched

PLAY [External update step 1] **************************************************
skipping: no hosts matched

PLAY [External deploy step 1] **************************************************
skipping: no hosts matched

PLAY [External deploy step 2] **************************************************
skipping: no hosts matched

PLAY [External deploy step 3] **************************************************
skipping: no hosts matched

PLAY [External deploy step 4] **************************************************
skipping: no hosts matched

PLAY [External deploy step 5] **************************************************
skipping: no hosts matched

PLAY RECAP *********************************************************************
compute-0 : ok=5 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
2022-09-06 04:47:42.356363 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Summary Information ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-09-06 04:47:42.356641 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Total Tasks: 5 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-09-06 04:47:42.356882 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Elapsed Time: 0:00:01.259131 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-09-06 04:47:42.357136 | UUID | Info | Host | Task Name | Run Time
2022-09-06 04:47:42.357429 | fa163ea5-485e-6193-7e50-000000000019 | SUMMARY | compute-0 | ansible.builtin.include_vars | 0.03s
2022-09-06 04:47:42.357666 | fa163ea5-485e-6193-7e50-000000000023 | SUMMARY | compute-0 | Set all_nodes data as group_vars for overcloud | 0.02s
2022-09-06 04:47:42.357933 | fa163ea5-485e-6193-7e50-00000000001c | SUMMARY | compute-0 | Include Service VIP vars | 0.02s
2022-09-06 04:47:42.358215 | fa163ea5-485e-6193-7e50-00000000001d | SUMMARY | compute-0 | Include OVN bridge MAC address variables | 0.02s
2022-09-06 04:47:42.358484 | fa163ea5-485e-6193-7e50-000000000020 | SUMMARY | compute-0 | Render all_nodes data as group_vars for overcloud | 0.00s
2022-09-06 04:47:42.358728 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End Summary Information ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-09-06 04:47:42.541 697741 INFO tripleoclient.utils.utils [-] Temporary directory [ /tmp/tripleopb6k3bfg ] cleaned up
2022-09-06 04:47:42.541 697741 INFO tripleoclient.utils.utils [-] Ansible execution success. playbook: /home/stack/overcloud-deploy/overcloud/config-download/tripleo-multi-playbook.yaml
2022-09-06 04:47:42.568 697741 INFO tripleoclient.v1.overcloud_external_update.ExternalUpdateRun [-] Completed Overcloud External Update Run.
2022-09-06 04:47:42.569 697741 INFO osc_lib.shell [-] END return value: None
[Tue Sep 6 04:47:42 AM EDT 2022] Finished OVN controller update

Environment
===========

Overcloud with OVN
Mater branch used, but the same behavior observed in previous versions(wallaby,train)

[1]https://github.com/openstack/python-tripleoclient/blob/master/tripleoclient/v1/overcloud_external_update.py#L95
https://github.com/openstack/python-tripleoclient/blob/master/tripleoclient/v1/overcloud_external_upgrade.py#L95
[2]https://opendev.org/openstack/tripleo-heat-templates/src/branch/master/deployment/ovn/ovn-controller-container-puppet.yaml#L464

Tags: upgrade
description: updated
description: updated
tags: added: upgrade
removed: updates
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.