Think re-examine how i look into the roles is helped to me. Now after i 
reorganize my roles slightly different is helped for me:

Each role have purpose of install nginx, monitoring, etc. 

And after that high level playbook will combine them together to get 
application worked. For example distributed wordpress, or ha lamp stack 
rather than I have before each role to configure application. 

четверг, 1 августа 2019 г., 11:51:47 UTC+2 пользователь Andrew Feller 
написал:
>
> You might re-examine whether it is appropriate for a role and a playbook 
> as it feels like your playbooks are too heavy.
>
> Roles ideally should be reusable logic for a given context you can apply 
> to multiple situations.  For example, you might have multiple 
> kafka/mysql/etc clusters for different uses that a single role given the 
> necessary info via playbook and inventory can manage.  If you need to build 
> higher order reusable roles, you can have roles with dependent roles that 
> compose them to your ends; leaving your playbooks thinner.  Playbooks 
> ultimately should be highest order orchestration that isn’t bogged down 
> into all of the technical details.
>
> Say what you will about Puppet but I would consider the reasoning behind 
> their roles and profiles and how it applies to Ansible: 
> https://puppet.com/docs/pe/2018.1/the_roles_and_profiles_method.html
>
>
> Sent from my iPhone
>
> On Aug 1, 2019, at 1:49 AM, Михаил Политаев <nisy...@gmail.com 
> <javascript:>> wrote:
>
> Awesome! Looks like a plan! Thanks!
>
> чт, 1 авг. 2019 г. в 07:44, Sebastian Meyer <me...@b1-systems.de 
> <javascript:>>:
>
>> On 01.08.19 07:31, Михаил Политаев wrote:
>> > I have a several projects which describing installation 2 different 
>> > applications. Each directory for application:
>> > 
>> > app1/roles/common/main.yml
>> > app2/roles/common/main.yml
>> > 
>> > But application have similar between them tasks which described in 
>> > "main.yml" of role "common"
>> > 
>> > What is the best way have only one source to those similar tasks 
>> without 
>> > having 2 or more versions and duplicate them across projects.
>> You could make use of the roles_path configuration setting [0] and have
>> a directory structure like this:
>>
>> ansible/
>>   common/roles/
>>   app1/roles/
>>   app2/roles/
>>
>> and in the app folders each an ansible.cfg with:
>>
>> roles_path: ./roles:../common/roles
>>
>> [0]
>>
>> https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-roles-path
>>
>> -- 
>> Sebastian Meyer
>> Linux Consultant & Trainer
>> Mail: me...@b1-systems.de <javascript:>
>>
>> B1 Systems GmbH
>> Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
>> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
>>
>>
>> -- Deutsche OpenStack Tage 2019 -- 10% Rabatt auf den Ticketpreis ----
>> ------------------------ https://openstack-tage.de (Code DOST-B1) ----
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/ansible-project/AzH2GwEA9Ls/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> ansible...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/8f7c5bb5-aaa6-4de2-7031-c0cdd4a538db%40b1-systems.de
>> .
>>
> -- 
> 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...@googlegroups.com <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CAKP%3D2uxpjLjmXm9qympt%3DsbDXMg1%3DP1DHxmh%2B0GNv3XGKRYxDg%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/ansible-project/CAKP%3D2uxpjLjmXm9qympt%3DsbDXMg1%3DP1DHxmh%2B0GNv3XGKRYxDg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f8448e04-06a3-4206-9fff-c3a6d0debfe0%40googlegroups.com.

Reply via email to