HOW TO USE ANSIBLE GALAXY

Krishnendhu A
3 min readDec 7, 2021

Ansible Galaxy is a repository for Ansible Roles that can be dropped directly into your Playbooks to help you automate your projects faster.

Ansible is a multiplier, a technology that scales and automates infrastructure of all sizes. It can be used for configuration management, orchestration, and deployment. With Ansible, getting up and running is a breeze. In just a few hours, even a rookie sysadmin might be automating with Ansible.

The SSH protocol is used by Ansible to automate tasks. To communicate with its target hosts, which are primarily Linux hosts, the control machine uses an SSH connection. You can still use Ansible to automate your Windows environments using WinRM rather than SSH if you’re a Windows sysadmin. However, the control machine must continue run Linux for the time being.

You might start with just a few playbooks if you’re a rookie sysadmin. However, as your automation abilities improve and you become more experienced with Ansible, you’ll learn best practises and find that using Ansible Galaxy becomes increasingly helpful as your playbooks grow.

What Ansible does

Patching, updating systems, user and group management, and provisioning are all common administrator duties that Ansible can handle. Ansible is the most popular and frequently used configuration management, orchestration, and deployment tool available today, and it has a massive footprint in IT Automation — if not the largest.

Its simplicity is one of the key reasons for its success. It’s straightforward, effective, and agentless. As a result, a new or entry-level sysadmin can get started automating in just a few hours. You can scale rapidly, efficiently, and cross-functionally with Ansible.

Create roles with Ansible Galaxy

Ansible Galaxy is a massive collection of Ansible roles open to the public. Roles come with READMEs that explain how to utilise the role and what variables are available. Galaxy has a wide number of positions that are always changing and expanding.

Other role sources, such as GitHub, can be added to Galaxy using git. You can use ansible-galaxy init to create a new galaxy role, or you can use ansible-galaxy install name of role> to install a role directly from the Ansible Galaxy role store.

The ansible-galaxy tool and accompanying templates are required to establish an Ansible role using Ansible Galaxy. Before they can be used in playbooks, roles must be downloaded and placed in the default location /etc/ansible/roles. Role examples can be found at https://galaxy.ansible.com/geerlingguy:

Make a collection

While Ansible Galaxy has long been the go-to tool for building and maintaining roles, future Ansible versions are bound to bring modifications and additions. The new feature of collections is included in Ansible version 2.8.

What are collections, and why should you care about them? As stated in the Ansible documentation:

Ansible content is distributed through collections. Playbooks, roles, modules, and plugins can all be packaged and distributed using them.

With an automation system that is easy, powerful, agentless, and scales your infrastructure quickly and efficiently, you can establish yourself as a star sysadmin. Using Ansible Galaxy to create roles is brilliant thinking, and it’s a great approach to stay organised and intelligent as your playbooks develop.

Working with a specific tool and demonstrating the value and positive impact of automation on your infrastructure is the only way to develop your automation abilities.

There are a number of best Ansible training center in Kochi that can help you gain sufficient information on this subject. The best teachings and talents come from the best solutions’ courses. As a result, prepare for the future with best Ansible training institute in Kochi

--

--