Ansible adalah tool Infrastructure as Code (IaC) yang menggunakan YAML untuk mengotomatisasi konfigurasi server. Agentless — hanya butuh SSH.
apt install ansible -y# /etc/ansible/hosts\n[webservers]\nweb1 ansible_host=192.168.1.10\nweb2 ansible_host=192.168.1.11\n\n[dbservers]\ndb1 ansible_host=192.168.1.20# lemp.yml\n- hosts: webservers\n tasks:\n - name: Install Nginx\n apt: name=nginx state=present\n - name: Start Nginx\n service: name=nginx state=started enabled=yesGunakan Jinja2 templates untuk file konfigurasi yang dinamis.
Gunakan community roles untuk setup kompleks seperti WordPress atau Docker.
Dengan Ansible, setup 1 server atau 100 server sama mudahnya. Cukup satu command.