# Need clairifictions/help for dynamic tagging

**URL:** <https://forum.ansible.com/t/need-clairifictions-help-for-dynamic-tagging/35397>\
**Category:** AWX Project\
**Created:** [June 23, 2021, 3:43pm UTC](https://forum.ansible.com/t/need-clairifictions-help-for-dynamic-tagging/35397 "2021-06-23T15:43:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![madeinindia.dot](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@madeinindia.dot](https://forum.ansible.com/u/madeinindia.dot)\
**Post date:** [June 23, 2021, 3:43pm UTC](https://forum.ansible.com/t/need-clairifictions-help-for-dynamic-tagging/35397/1 "2021-06-23T15:43:44Z")

</div>

**problem statement:** we have a playbook that we’re looking to use but do not own, playbook has a number of tags that we’ll need to use to skip several tags that will impact our application.

In order to enforce tower RBAC, we need to run workflow that includes another playbook prior to this one which will feed a list of tags within file.

**Option 1:**

Tagging as a variable

1. Can we parameterize tagging? Meaning feed tags as a dynamic variable.

**Option 2:**

As an alternative to option1, if we cannot dynamically feed a tag as a variable, in a workflow that is being executed, if we update one of its template, will that newly saved template be run in the running workflow? Or will the original one be still running

WORKFLOW :: start \> template1 \>\> template2 \>\> template3

> > >

[Update template2 via api] [run updated template2?]

Here’s what we’re looking to achieve from the “generate list of tag”, we’re looking for the same results as executing` ansible-playbook patch.yml --list-tags` but from the ansible tower

$ ansible-playbook patch.yml --list-tags  
sample

---

<div class="post-metadata">

**Author:** ![Christopher\_Meyers](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Christopher\_Meyers](https://forum.ansible.com/u/Christopher_Meyers)\
**Post date:** [June 23, 2021, 4:18pm UTC](https://forum.ansible.com/t/need-clairifictions-help-for-dynamic-tagging/35397/2 "2021-06-23T16:18:00Z")

</div>

Option 1 won’t work.  
Opton 2 will work. The newly saved template will be run in the running workflow.

Alternatively you can restructure your Ansible playbooks to conditionally execute tasks, blocks, roles, etc. based on variables being defined or having certain values i.e. True or False. For example

**Workflow Job 1**. You can trigger the above tasks conditionally using a workflow job + set\_stats

- hosts: localhost  
tasks:
- set\_stats:  
data:  
dell\_firmware: True  
yum\_conf: False

**Workflow Job 2.**

- hosts: localhost  
tasks:
- shell: ls  
when: dell\_firmware is defined and dell\_firmware is True
- block:
- shell: ls  
when: yum\_conf is defined and yum\_conf is True
