apt-get install software-properties-common
apt-get update
apt-get install ansible
now change the hosts file in /etc/ansible
make sure you have publickey login on the hosts
e.g. run: ssh-copy-id root@host1
then check with ansible:
ansible -m ping all
some adhoc examples:
list hostnames
ansible -m shell -a 'hostname' all
check diskspace
ansible -m shell -a 'df -h' all
create a user on l1 (ask for the sudo password)
ansible -b -K -m user -a 'name=testuser' l1
check
ansible -m shell -a 'grep testuser /etc/passwd' l1
~