What is Ansible Vault?
Ansible Vault is a tool for encrypting sensitive data (passwords, API keys) inside playbooks.ansible-vault encrypt secret.yml
What are Ansible modules?
Modules are pre-built scripts for specific automation tasks (e.g.,copy
, file
, service
, yum
, apt
).- name: Create a file
file:
path: /tmp/testfile.txt
state: touch
What is Playbook in Ansible?
A Playbook is a YAML file that defines tasks to be executed on remote hosts.- name: Install Nginx
hosts: webservers
tasks:
- name: Install Nginx
apt:
name: nginx
state: present
What is an Ansible inventory?
The inventory is a file (default:/etc/ansible/hosts
) listing managed nodes (hosts). Example:[webservers]
server1.example.com
server2.example.com
How do i install Ansible?
On Linux (Ubuntu/Debian):sudo apt update && sudo apt install ansible -y
On RHEL/CentOS:sudo yum install ansible -y
On MacOS:brew install ansible