Role and play level both would be acceptable, but I'd want it in both.

We'd need to find a nice way to work it into the docs on tags w/o making it
too confusing.




On Thu, Jul 24, 2014 at 10:36 AM, Greg Swift <[email protected]> wrote:

> So In my proposal you would specify use_tags (or whatever) when calling
> the role specifically, not at the play level.  If i'm bringing in multiple
> roles it seems like it would make sense to support it at the role level, or
> i guess maybe at both? Maybe I'm just over thinking it, but i can
> definitely see reasons why you would want to allow the more specific
> implementation. Seems like a anti-pattern to constantly add new plays just
> because a set of roles might share a tag yet you want one role to run tagA
> the other tagB, but they both have tagA.
>
> Basically, what is the defining reason why this should be at the play
> level rather than in the call of the role?  I haven't looked at the code
> yet, so maybe its implementation?
>
> -greg
>
>
> On Sunday, July 20, 2014 7:36:25 AM UTC-5, Michael DeHaan wrote:
>
>> Basically this would be asking for a play level "use_tags" parameter.
>>  (It would not be called "tags", as that would mean the existing ability
>> *to tag*)
>>
>> This is not something we are working on, but patches would be considered
>> certaintly, the variable should only exist at play level (on level with
>> "hosts:").
>>
>>
>>
>>
>> On Sun, Jul 20, 2014 at 6:06 AM, Michael Liu <[email protected]> wrote:
>>
>>> 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 [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/7e93c579-5ecc-426d-b168-
>>> 728c06e946a7%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/7e93c579-5ecc-426d-b168-728c06e946a7%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> 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/2ccae7c2-be55-412a-9f56-f76acf2460ba%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/2ccae7c2-be55-412a-9f56-f76acf2460ba%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CA%2BnsWgxQ%2Bw6nVFJA3uQhiLYu08A-ZHX5wG92ieg9N70F3TNXuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to