Thanks Timothy, that's exactly what I was thinking of. Will just decompose 
the role into smaller sets of tasks and that's all.
Just saw in ansible documentation that:

You may also apply tags to roles:

roles:
  - { role: webserver, port: 5000, tags: [ 'web', 'foo' ] }

and thought it will execute tasks by tags :)


четверг, 5 февраля 2015 г., 16:49:04 UTC+2 пользователь Timothy Gerla 
написал:
>
>
>
>> As I composed one role which partially can be reused in some others I 
>> tried the following syntax in playbook:
>>
>> hosts: test
>> sudo: True
>> roles:
>>   - common
>>   - { role: big, tags: [ 'aaa', 'bbb' ]}
>>
>> But looks like tags functionality is not working. If I run playbook with 
>> --tags arg it runs only matching tags, but when I want to list all tags to 
>> execute in roles it runs the whole role.
>>
>>
> This doesn't mean "run tasks tagged aaa and bbb in role big", it means 
> "tag all of role big with tags aaa and bbb". This is so you can have a 
> playbook that calls certain roles conditionally, based on the tags you're 
> executing.
>
> If you find yourself trying to call parts of a role, I would suggest 
> breaking that role up into smaller roles and calling those as needed. The 
> point of a role is to be a single useful set of tasks that is executed as a 
> group, so if your roles are not decomposed enough, you will probably have 
> trouble.
>
> Hope this helps!
>
> -Tim
>  
>

-- 
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/99f7ecd3-a5ab-436e-8f46-6f4b4706181d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to