Maintain your Ansible roles with Galaxy

| 2 Comments

0.00 avg. rating (0% score) - 0 votes

ansible_logo

If like me, you were using the Ansible Galaxy website to find and download your playbook for your favorite apps, you may missed a feature.

It happened to me when I had to manage several playbook roles. I first wanted to use Git submodules to do it. However I preferred to search another way to do like like Puppet can do with R10K because I am working on a project with some unfamiliar Git users. And I preferred to make it as simple as possible.

During a short search, I didn’t find anything really interesting, and looked at all the informations on the Galaxy website. I finally almost find what I was searching for. You can specify a file with role name and version you want to install. The file (galaxy_dep) should looks like this:

Then you can launch your ansible-galaxy binary with those options to grab your defined roles:

This will download them in the “roles” folder in the current directory. A missing feature in my opinion is the possibility to rename with a specified name the downloaded roles.

This is a simple solution but I hope this could help you too.

Author: Deimos

I'm a passionate DevOps. I love transmit my skills and I love working on high availability infrastructures/technologies.

2 Comments

  1. Looks like the code wasn’t pasted correctly in your article…

Laisser une réponse