I know you have to ability to call task tags from the command line, for 
example:

ansible-playbook -i staging_env mydeploy.yml --tags "web_stop"

But, is there a way to call task tags from with in a playbook?  I would 
rather create multiple playbooks such as web_start.yml, web_deploy.yml, 
stop_all.yml, start_all.yml and not have to worry about calling the 
appropriate tags at the command line.  My issue is that not everyone on the 
Ops team is as familiar with ansible (and all of the tags we use), so 
allowing them to just run "ansible-playbook -i staging_env start_all.yml" 
seems easier and safer.  And the goal is to keep my existing role/tasks 
structure without duplicating tasks between roles.  The main issue with the 
playbook is that when you apply a role to hosts it applies all of the tasks 
in that role, no way to pick and choose tasks in the playbook.

My dir structure for my web servers is as follows: 
    roles/web/tasks
        main.yml
        stop.yml
        update_code.yml
        start.yml
        check_service.yml

If it's not possible to call task tags from a playbook, is this something 
you're currently working?  Is there another way to achieve this?

Thanks so much for your time.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7e93c579-5ecc-426d-b168-728c06e946a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to