Need clairifictions/help for dynamic tagging

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

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