How can we host our own Ansible Galaxy server?

7,993 views
Skip to first unread message

Daniel Andrei Minca

unread,
May 12, 2017, 2:16:12 PM5/12/17
to Ansible Project
Hi there,

In our company X we have many Ansible roles & playbooks spread among different repositories, all the playbooks follow the Ansible playbook best-practices guide.

I'm looking for a way to modularize all those playbook repos.

In order to achieve that, I found that hosting our own Ansible Galaxy server would be the best choice since:
- we can easily re-use roles without having duplicate code in each repo, 
- we can also impose a good standard over Ansible Roles (referring here to properly documenting the role's ./meta/main.yml & README.md et. al. ), 
- not to mention, we would force everyone to create a NEW repo for each role instead of pushing everything in a single repo (calling this practice: crapload-repo = usually the size of Gigabytes and takes some time to download).

So my questions here are:
1) how did you configured your own Ansible Galaxy server?
2) can a simple Nginx server with default nginx.conf do?
3) could you give me a list of prerequisites of setting this up, or guide me to some resources?

Thank you!

Brian Coca

unread,
May 12, 2017, 2:26:11 PM5/12/17
to Ansible Project
You should go to https://github.com/ansible/galaxy.


----------
Brian Coca

Kai Stian Olstad

unread,
May 13, 2017, 4:48:39 AM5/13/17
to ansible...@googlegroups.com
On 12. mai 2017 10:40, Daniel Andrei Minca wrote:
> Hi there,
>
> In our company X we have many Ansible roles & playbooks spread among
> different repositories, all the playbooks follow the Ansible playbook
> best-practices guide
> <http://docs.ansible.com/ansible/playbooks_best_practices.html>.
>
> I'm looking for a way to modularize all those playbook repos.
>
> In order to achieve that, I found that hosting our own Ansible Galaxy
> server would be the best choice since:
> - we can easily *re-use roles* without having *duplicate code* in each
> repo,
> - we can also impose a good standard over Ansible Roles (referring here to
> properly documenting the role's *./meta/main.yml* & *README.md *et. al. ),
> - not to mention, we would *force* everyone to create a NEW repo for each
> role instead of pushing everything in a single repo (calling this practice:
> *crapload-repo* = usually the size of Gigabytes and takes some time to
> download).
>
> So my questions here are:
> 1) how did you configured your own Ansible Galaxy server?
> 2) can a simple Nginx server with default nginx.conf do?
> 3) could you give me a list of *prerequisites* of setting this up, or guide
> me to some resources?

An alternative route that we use, replace galaxy with Git repository
manager.

In Gitlab we have a group called "Ansible roles".
Each role have it own git repository in this group with README.md and a
meta/main.yml.

In the ansible repositories that need the roles
requirements.yml:
---
- src: git@gitlab:ansible-role/apache.git
scm: git
version: "1.1"

--
Kai Stian Olstad

Daniel Andrei Minca

unread,
May 14, 2017, 9:29:49 AM5/14/17
to Ansible Project, ansible-pr...@olstad.com
Thank you very much Brian & Kai for suggestions.

I find Kai's approach more tempting to use first. Then if this isn't going to work out, I'll try compiling galaxy & running on server.

Regards,

Greg DeKoenigsberg

unread,
May 14, 2017, 1:57:11 PM5/14/17
to Ansible Project, ansible-pr...@olstad.com
If you have a *lot* of roles and need things like searchability and
discoverability via API, Galaxy is a good choice -- but if you don't
need all of that, Kai's solution is definitely sufficient.

--g
> --
> 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-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/fed9ee7b-e49a-4062-aa02-013c72cdecda%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Greg DeKoenigsberg
Ansible Community Guy

Daniel Andrei Minca

unread,
May 15, 2017, 8:14:57 AM5/15/17
to Ansible Project, ansible-pr...@olstad.com
I wanted to go with Ansible Galaxy at first, but I tried it locally and ansible-container was failing to start the django app because the image doesn't exist. Also the process of Powering up Ansible Galaxy is not fully documented :) all I did was look how you guys start it in TravisCI.

Aidan Wong

unread,
Jun 8, 2021, 12:28:31 PM6/8/21
to Ansible Project
Hi,

Sorry to revive this old thread, but can someone please point me to documentation on how to use requirements.yml using Git as source instead of Galaxy server?
Does that approach also use the "ansible-galaxy" cli ?

Thanks

Brian Coca

unread,
Jun 8, 2021, 1:02:07 PM6/8/21
to Ansible Project
See example in requirements example file
https://galaxy.ansible.com/docs/using/installing.html#installing-multiple-roles-from-a-file


----------
Brian Coca

Wei-Yen Tan

unread,
Jun 8, 2021, 1:04:55 PM6/8/21
to ansible...@googlegroups.com
Thank you for this.

Is there any docker /container installation packages? 


From: ansible...@googlegroups.com <ansible...@googlegroups.com> on behalf of Brian Coca <bc...@redhat.com>
Sent: Wednesday, June 9, 2021 5:01:21 AM
To: Ansible Project <ansible...@googlegroups.com>
Subject: Re: [ansible-project] How can we host our own Ansible Galaxy server?
 
--
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-proje...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages