This is an old revision of the document!
ansible
- create password less login to remote machines
ssh-keygen
will create an ssh key pairssh-copy-id -i ~/.ssh/id_rsa.pub userp@remote.local.machine.io
to copy the public key to the remote machine for same user.
cd /mnt/ansible
These commands only work in this directory or with full pathsansible-inventory -i inventory.ini --list
Lists the current inventoryansible-playbook -i inventory.ini debian_update.yml --become-password-file '/mnt/ansible/password.yml'
- ansible all -m gather_facts -i inventory.ini –tree /tmp/facts
- ansible all -i inventory.ini -m ping -u root
- ansible -i inventroy.ini kpts -a “ls -la ~” -u root
- ansible all -a “df -h” -u root
- crontab -l
- 5 4 * * 6 ansible-playbook /mnt/ansible/debian_update.yml -i /mnt/ansible/inventory.ini –become-password-file '/mnt/ansible/password.yml'
I should check about setting up ansible to save some time maintaining my servers.