Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1748863

Summary: always tag doesn't work right with nested "include_tasks"
Product: Red Hat OpenStack Reporter: Jose Luis Franco <jfrancoa>
Component: openstack-tripleo-heat-templatesAssignee: Sergii Golovatiuk <sgolovat>
Status: CLOSED ERRATA QA Contact: Sasha Smolyak <ssmolyak>
Severity: medium Docs Contact:
Priority: medium    
Version: 15.0 (Stein)CC: lbezdick, mburns
Target Milestone: z2Keywords: Triaged, ZStream
Target Release: 15.0 (Stein)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-heat-templates-10.6.2-0.20191202200455.41d9f8a.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-05 12:00:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jose Luis Franco 2019-09-04 10:27:03 UTC
Description of problem:

tag always in "common/deploy-steps.j2" fixes the problem only for one level of nested tasks. Here is a simple test

#cat include_tasks_test.yml
---
- hosts: all
  gather_facts: no
  tasks:

  - name: "Include_tasks tasks file"
    include_tasks: task1.yml
    tags: always

  - name: "Include_tasks tasks file"
    include_tasks: task2.yml

#cat task1.yml
- name: "Debug tag1"
  debug:
    msg: "tag1"
  tags:
  - tag1

- name: "Debug tag3"
  include_tasks: task3.yml

- name: "Debug tag4"
  include_tasks: task4.yml
  tags:
  - tag4

#cat task3.yml
- name: "Debug tag3"
  debug:
    msg: "tag3"
  tags:
  - tag3

#cat task4.yml
- name: "Debug tag4"
  debug:
    msg: "tag4"

if we run

ansible-playbook -i inv include_tasks_test.yml -t tag3

it will skip it. To fix it we can add "tags: always" in task1.yml as

- name: "Debug tag3"
  include_tasks: task3.yml
  tags: always

but that means that we need to track down all nested tasks. The most correct way is to replace include_tasks with import_tasks as much as possible. In this case we won't need to track down "tags: always" in all nested playbooks.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 7 Jose Luis Franco 2019-12-13 09:43:31 UTC
Working

2019-12-12 19:15:28 |
2019-12-12 19:15:28 | PLAY [External upgrade step 0] *************************************************
2019-12-12 19:15:28 |
2019-12-12 19:15:28 | PLAY [External upgrade step 1] *************************************************
2019-12-12 19:15:28 |
2019-12-12 19:15:28 | PLAY [External upgrade step 2] *************************************************
2019-12-12 19:15:28 |
2019-12-12 19:15:28 | PLAY [External deploy step 1] **************************************************
2019-12-12 19:15:28 | Thursday 12 December 2019  19:06:39 -0500 (0:00:00.571)       0:00:09.615 *****
2019-12-12 19:15:28 |
2019-12-12 19:15:28 | TASK [set_fact] ****************************************************************
2019-12-12 19:15:28 | ok: [undercloud] => {"ansible_facts": {"container_image_prepare_debug": true, "log_file": "/var/log/tripleo-container-image-prepare.log"}, "changed": false}
2019-12-12 19:15:28 | Thursday 12 December 2019  19:06:39 -0500 (0:00:00.088)       0:00:09.703 *****
2019-12-12 19:15:28 |
2019-12-12 19:15:28 | TASK [Create temp file for prepare parameter] **********************************
2019-12-12 19:15:28 | changed: [undercloud] => {"changed": true, "gid": 1005, "group": "tripleo-admin", "mode": "0600", "owner": "tripleo-admin", "path": "/tmp/ansible.fi_1yat4-prepare-param", "secontext": "unconfined_u:object_r:user_tmp_t:s0", "size": 0, "state": "file", "uid": 1003}
2019-12-12 19:15:28 | Thursday 12 December 2019  19:06:39 -0500 (0:00:00.467)       0:00:10.171 *****
2019-12-12 19:15:28 |


THT package:
(undercloud) [stack@undercloud-0 ~]$ rpm -qa | grep tripleo-heat-templates
openstack-tripleo-heat-templates-10.6.2-0.20191202200455.41d9f8a.el8ost.noarch

Comment 10 errata-xmlrpc 2020-03-05 12:00:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0643