On Youtube you has this amazing video about best practices:
https://www.youtube.com/watch?v=5BhAJ4mEfZ8
I think you should standardize your roles and export to it's own
repository. After that you can use Ansible Galaxy to install that.
You should think "I don't want to publish my roles!" but Ansible
Galaxy you can download roles from a Git repo (even a private one) and
not just the website galaxy.ansible.com.

Cheers!

On Fri, Mar 23, 2018 at 7:52 AM,  <cmoul...@redhat.com> wrote:
> Hi
>
> Is there a document describing the best practices to organise a complex
> Ansible project ?
>
> Here is the project that I'm thinking about :
>
> - Project has been designed as a collection of reusable modules (= role)
> which are living under by example this folder "complexproject/roles" fo the
> modules part of the main project
> - Project could include roles created and managed by external teams and git
> cloned locally under "complexproject/imported/projectA/roles,
> complexproject/imported/projectB/roles"
> - Users access the main playbooks using this command "ansible-playbook -i
> inventory complexproject/playbooks/main.yml
> - main.yml file contains roles tagged to be called
>
> E.g.
> ---
> - hosts: "{{ openshift_node }}"
>   gather_facts: "{{ gathering_host_info | bool == true }}"
>
>   roles:
>     - { role: 'enable_cluster_admin', tags: 'enable_cluster_admin', when:
> target_platform == 'cloud' }
>     - { role: 'create_projects',      tags: 'create_projects'}
>     - { role: 'persistence',          tags: 'persistence',          when:
> target_platform == 'cloud' }
>
> Questions
> - Is this approach coherent/consistent ?
> - Can we set up a var to tell to Ansible where all the roles are located:
> complexproject/roles:complexproject/imported/projectA/roles:complexproject/imported/projectB/roles
> - Should we adopt a different approach where different projects which
> contain roles are imported using "import_playbook" --> see
> `openshift-ansible` project - https://goo.gl/KXDWXN ?
>
> Regards
>
> Charles
>
> --
> 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/c9e936ce-5c2f-4956-a196-9babf84d6802%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Marcos H. Alano
Linux System Administrator
marcoshal...@gmail.com

-- 
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/CAO3Us%3DmMhXQoxgwsZW4wXHcoq8Dnor9FZUHQPTUrs5MrE3tJzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to