I have a problem that I want to execute only tasks with certain tags from a
playbook, but this does not work.
My playbook looks as follows:
#playbook.yml
- hosts: appservers
remote_user: myuser
roles:
- { role: tmp, tags: update }
The tmp role task file looks as follows:
# roles/tmp/tasks/main.yml
- name: Test 1
debug: msg="Test 1"
tags: anothertag
- name: Test 2
debug: msg="Test 2"
tags: update
If I execute the playbook with
ansible-playbook -i inventory/test playbook.yml
or
ansible-playbook -i inventory/test playbook.yml --tags=update
all two tasks are executed both times.
I do not want task "Test 1" to be executed.
I can achieve this by running ansible-playbook with the option
--skip-tags=anothertag, but this not what I want.
Do you know how I can get that to work or where my scripts are erroneous?
Thanks,
Michael
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/9d452d85-393b-4c5a-8cd2-5a66c88f4da3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.