Ansible Playbook: Core Elements and Examples

Ansible Playbook: Core Elements and Examples

1. Core Elements of a Playbook: hosts List of remote hosts to execute on tasks Set of tasks variables Built-in or custom variables called in the playbook templates Files that can replace variables in template files and implement some simple logic handlers Used in conjunction with notify, triggered by specific conditions, executed if conditions are … Read more

Basic Knowledge of Ansible for Automated Operations and Maintenance

Basic Knowledge of Ansible for Automated Operations and Maintenance

Ansible Host Directory Default configuration file: /etc/ansible/hosts # This is the default ansible 'hosts' file. # # It should live in /etc/ansible/hosts # # – Comments begin with the '#' character # – Blank lines are ignored # – Groups of hosts are delimited by [header] elements # – You can enter hostnames or ip … Read more

1.1 Automation Operations with Ansible Installation and Deployment

1.1 Automation Operations with Ansible Installation and Deployment

Introduction Ansible is a tool for deploying a group of remote hosts. It achieves communication between the management node and remote nodes through the SSH protocol. Theoretically, any operation that can be performed by logging into a remote host via SSH can be automated in bulk using Ansible. This includes tasks such as copying files, … Read more

Ansible Role: A Comprehensive Guide to Structuring Playbooks

Ansible Role: A Comprehensive Guide to Structuring Playbooks

nginx-role.yml roles/ └── nginx ├── tasks │ ├── group.yml # Create group │ ├── main.yml │ ├── restart.yml # Restart service │ ├── start.yml # Start service │ ├── templ.yml # Copy configuration file │ ├── user.yml # Create user │ └── yum.yml # Install service └── templates └── nginx.conf.j2 # Configuration file group.yml (0 … Read more

Comprehensive Automation Operations Tool with Ansible and Docker

Comprehensive Automation Operations Tool with Ansible and Docker

1. Introduction SSM is a lightweight server management platform that integrates Ansible and Docker, featuring graphical interface, modularity, and strong scalability. It allows for a series of tedious operations such as server deployment, container orchestration, resource monitoring, and alert notifications to be completed through a browser—no command line skills required, making it easy for beginners … Read more

Ansible Configuration from Beginner to Abandonment (Part 18)

Ansible Configuration from Beginner to Abandonment (Part 18)

Ansible-navigator Configuration You can obtain the default configuration by running <span>ansible-navigator –eei quay.io/ansible/awx-ee:24.6.1 settings –gs</span>. The <span>ansible-navigator</span> looks for the configuration files <span>ansible-navigator.yaml</span> or <span>ansible-navigator.yml</span>. Here is a default configuration: — ansible-navigator: # ansible: # config: # # Help options for ansible-config command in stdout mode # help: False # # Specify the path to … Read more

Ansible: From Introduction to Abandonment (Seventeen)

Ansible: From Introduction to Abandonment (Seventeen)

Ansible-navigator config <span>ansible-navigator config</span> is used to view Ansible’s configuration files within a container (equivalent to executing the <span>ansible-config</span> command inside the container). The available options are as follows: Parameter Type Default Value Description <span>-c</span>, <span>–config</span> <span>str</span> Auto-detect (according to Ansible’s default lookup order) Specify the path to the <span>ansible.cfg</span> configuration file <span>–hc</span>, <span>–help-config</span> <span>bool</span> … Read more

Goodbye Manual Operations! Automating Server Configuration and Deployment with Ansible and Python

Goodbye Manual Operations! Automating Server Configuration and Deployment with Ansible and Python

It was a Wednesday night at 11 PM, and I was about to pack up and leave when suddenly the product manager rushed over and said: “Bro, we need to deploy a new feature on 20 servers tomorrow, and configure nginx, redis, mysql…” At that moment, I felt overwhelmed. If I had to manually SSH … Read more

Introduction to Ansible

Introduction to Ansible

Ansible is an open-source automation configuration management tool based on OpenSSH. It can be used to configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployment or zero-downtime updates. The main goals of Ansible are simplicity and ease of use, and it also places a strong emphasis on security and reliability. … Read more