Ansible Cheatsheet
๐ฆ Inventory (hosts file) [webservers] web1.example.com web2.example.com [dbservers] db1.example.com ansible_user=ubuntu ansible_port=22 โถ๏ธ Basic Playbook Structure - name: Example playbook hosts: webservers become: true vars: apache_port: 8080 tasks: - name: Install Apache apt: name: apache2 state: present update_cache: yes - name: Ensure Apache is running service: name: apache2 state: started enabled: true ๐ง Common Task Modules - name: Install packages apt: name: - git - curl state: present - name: Copy a file copy: src: ....