Showing posts with label role. Show all posts
Showing posts with label role. Show all posts

Friday, March 4, 2022

Ansible Roles / Galaxy

 


Reference:

galaxy.ansible.com

user name geerlingguy is very famous in galaxy.ansible.com:

Ansible Roles

  • It is a standard directory structure to abstract the functionality of Ansible playbooks.
  • You can search and download some of the existing roles from Ansible Galaxy website ( https://galaxy.ansible.com/)


Ansible Roles Directory Structure

When you create or install an ansible galaxy role, then the following directories automatically get created and these directories have a special purpose (except for the templates and tests directory). All the pre-defined directories contain main.yml, if any of these directories get called then the execution of that directory is started from main.yml code only.

defaults:

For default variables values.

files:

files which are referred to in the role.

handler:

Whenever there is any notification is triggered when the handler's main.yml file gets called which should have a definition of those notification services.

meta:

It stores role's metadata like Authorname, version etc

tasks:

Contains the definition of modules which are supposed to execute as a task.

templates:

It includes the Jinja templates definition.

tests:

Contains test cases for role

vars:

To define global variables for the roles.


Fluentd

Open-source log data collector > why logs? - for compliance (auditing, company, business) - for security (transparency, monitoring, admin...