Ansible Playbook To Update Linux Servers
Run this playbook using run.sh
script
cd scripts/
./run.sh
Run this playbook manually
ansible-playbook -i ./inventory.yml ./main.yml --ask-become-pass
Example inventory file
all:
hosts:
server1:
ansible_host: 192.168.2.1
ansible_user: username
ansible_ssh_private_key_file: ~/.ssh/ssh_key
server2:
ansible_host: 192.168.2.2
ansible_user: username
ansible_ssh_private_key_file: ~/.ssh/ssh_key
server3:
ansible_host: example.com
ansible_user: username
ansible_ssh_private_key_file: ~/.ssh/ssh_key
localhost:
ansible_host: localhost
ansible_user: username
ansible_ssh_private_key_file: ~/.ssh/ssh_key
- Arch
- Debian
- RedHat
- openSUSE