Open dat1041988 opened 3 years ago
Check https://docs.ansible.com/ansible/latest/user_guide/playbooks_tags.html#adding-tags-to-roles, I'd expect you're adding the tags
to the role import, which applies it to all tasks in the role.
@wenottingham Thanks for reply! I don't add tags to role import. Our playbook:
And in vappvm role tasks, I add "create-master" tag to individual tasks. Already try include_role in playbook but result is the same.
I'm having a similar issue with AWX 15.1 not respecting tags in the roles: section of my playbook. My understanding is that tags applied to roles in the roles: section are inherited to all role's tasks, and in fact results in expected behavior when running ansible-playbook from cli (--skip-tags=ipxe_sync,image_sync skips the entire roles in the following code snippit)
---
- hosts: all
gather_facts: yes
roles:
- role: facts
tags: custom_facts
- role: ipxe
tags: ipxe_sync
- role: automaticupdates
- role: win10image
tags: image_sync
When I run a job template from AWX using the same tags in the Skip Tags field, these tags show up and are displayed on the details of the job, but then the output still shows each role running instead of being skipped.
ISSUE TYPE
SUMMARY
I create a template to run an ansible playbook with job tags. When I run it, ansible-playbook run all tasks in roles, not specific tasks with tags. Job tags is working with tasks in main playbook file, but not working with tasks in roles.
ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
Job run ansible-playbook with specific tasks in roles.
ACTUAL RESULTS
Job run ansible-playbook with all tasks in roles.
ADDITIONAL INFORMATION