top of page
Programmer in Server Room

Ansible

Ansible is an open-source automation tool used for configuration management, application deployment, and task automation. It simplifies IT operations by using YAML-based playbooks to define infrastructure as code, making it easy to manage servers, containers, networks, and cloud environments without requiring agents.

My Starter Ansilbe Collection

Bash: Create service account for running as when executing ansible playbooks, a workgroup style of authentication

Bash: Basic core install of Ansible on Red Hat Enterprise Linux & SSH key exchange setup

YAML: Enable Code Ready Builder and Setup the EPEL Repo

YAML: A set of tools I install on all my Linux servers. enable Cockpit, TShark, Nmap, Nano, HTOP, BTOP, Net-Tools, Splunk Syslog Setup and Timezone 

YAML:  Simple YAML file to install the NFS_Utils and setup the client side of my NFS mount

YAML:  Install a container on the remote system/s and ran as root. Mounts to local drive so can backup from host storage /mnt

YAML: Set firewall port opening for MySQL and restart Firewalld

 

YAML: Create a user and add user to specific groups

YAML: Create file and poplute with SSH banner text and set banner

 

Bash:  commands to set the host and and then re-register with Red Hat. So Inight has correct hostname

YAML:  I noticed the networking charts were not showing my throughput in the graphs

Ansible Execution 

sudo ansible-playbook -i inventory.ini firewall_open_mysql.yml

Special Note: Change .yml from "all" to localhost to execute on localhost:

sudo ansible-playbook firewall_open_mysql.yml

[servers]
192.168.254.200 ansible_ssh_user=ansible_svc
192.168.254.201 ansible_ssh_user=ansible_svc
192.168.254.202 ansible_ssh_user=ansible_svc

192.168.254.100 ansible_ssh_user=ansible_svc
192.168.254.101 ansible_ssh_user=ansible_svc
192.168.254.102 ansible_ssh_user=ansible_svc

192.168.254.20 ansible_ssh_user=ansible_svc
192.168.254.21 ansible_ssh_user=ansible_svc
192.168.254.22 ansible_ssh_user=ansible_svc

.ini Single List of Systems

[servers]
192.168.254.200 ansible_ssh_user=ansible_svc
192.168.254.201 ansible_ssh_user=ansible_svc
192.168.254.202 ansible_ssh_user=ansible_svc

[workstations]
192.168.254.100 ansible_ssh_user=ansible_svc
192.168.254.101 ansible_ssh_user=ansible_svc
192.168.254.102 ansible_ssh_user=ansible_svc

 

[webservers]
192.168.254.20 ansible_ssh_user=ansible_svc
192.168.254.21 ansible_ssh_user=ansible_svc
192.168.254.22 ansible_ssh_user=ansible_svc

.ini Groups of Systems

INI files are used to list and group servers efficiently. They organize server details into sections, making it easy to categorize servers by type or environment, such as production, staging, and development. This structure simplifies configuration management and enhances readability.

bottom of page