TurnKey Ansible

Login as the 'ansible' user

ssh ansible@ansible

Note: re-enter ansible password when prompted for passphrase by ssh-agent

Verify that Ansible is working

ansible localhost -m ping

Gather TurnKey facts

ansible localhost -m turnkey_facts

Gather Ansible facts

ansible localhost -m setup

Add <hostname> to Ansible inventory

echo -e "<hostname>" | sudo tee -a /etc/ansible/hosts

Initialize <hostname> and add ansible user

ansible-playbook playbooks/init.yml -k -l <hostname>

Enter the root password of <hostname> when prompted

Now use 'ansible' when accessing <hostname>

sudo sed -i "/<hostname>/ s/^\(.*\)$/\1\t\tansible_ssh_user=ansible/" /etc/ansible/hosts