Puppet modules like the ones from puppetforge could be deployed using r10k.
Question
What is the equivalent of this tool in Ansible?
Attempt to answer the question
This Google Q&A was found that does not answer the question
Puppet modules like the ones from puppetforge could be deployed using r10k.
Question
What is the equivalent of this tool in Ansible?
Attempt to answer the question
This Google Q&A was found that does not answer the question
Based on the discussion with @ceejayoz the conclusion is that Ansible's equivalent of Puppet's R10K is
ansible-galaxy install -r requirements.yml
.R10K
In R10K a Puppetfile is used. A Puppetfile is a definition of modules (e.g. from Puppetforge) that need to be assembled in a certain environment, e.g. the Puppetfile of the development environment could look as follows:
While the Production Puppetfile contains stable versions:
The equivalent of r10k in ansible
In order to assemble roles (equivalent of Puppet's modules) from Puppet's Puppetforge equivalent in Ansible - Ansible Galaxy or custom sources the roles or sources could be defined in
yml
files (based on the link provided by @ceejayoz and this link). The development environment could look as follows:development.yml
and it could be run by issuing
sudo ansible-galaxy install -r development.yml
. While the production could look like:production.yml
and be run by executing
sudo ansible-galaxy install -r production.yml
. The outcome could look as follows:Think ansible-galaxy is only half of the answer because it doesn't do anything about Ansible playbooks, which are synonymous to Puppet role modules. One of the benefits of r10k is that you can manage all aspects of each environment separately.
You might consider separate branches per environment with all of the Ansible roles being pulled in via ansible-galaxy. This would let you isolate playbook, inventory, and role changes per environment without unintentionally letting them slip into production and not duplicating role logic per branch.