<!DOCTYPE html><html><head><title></title><style type="text/css">
p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>## Step 1 of ? :  What does the managed hosts need?<br></div><div><br></div><div>ssh and Python. That's it. :-)<br></div><div><br></div><div>Well, okay, maybe a tad more when you look more closely.  You'll need a user account on that machine to which you can connect (duh!). Best way is to drop your ssh key on the remote host so you can connect without interaction. <br></div><div><br></div><div>If some actions will require root permissions, that user will also need sudo rights (also duh!).  By default Ansible uses the `sudo` mechanism, but there are other alternatives too (<a href="https://docs.ansible.com/ansible/latest/user_guide/become.html">https://docs.ansible.com/ansible/latest/user_guide/become.html</a>)  Since my main use case is my own machines, `sudo` always did the trick for me. <br></div><div><br></div><div>## Step 2 of ?: Herding the remote hosts<br></div><div><br></div><div>For your usecase, I'll assume that you want the full list of hosts you manage, plus you want a sub-group of them that are the ones where you want to do that first install.<br></div><div><br></div><div>To do that you define an inventory file, which can be INI-flavored:<br></div><div><br></div><div><br></div><div>```<br></div><div>yanick.ottawa.ca   ansible_ssh_host=192.168.0.1 ansible_ssh_user=yanick <br></div><div>jason.charlotte.us ansible_ssh_host=192.168.0.2 ansible_ssh_private_key_file=/home/yanick/.vagrant.d/insecure_private_key<br></div><div>william.charlotte.us ansible_ssh_host=... ansible_become_pass=hushhush<br></div><div><br></div><div>[onboarding]<br></div><div>yanick.ottawa.ca<br></div><div>jason.charlotte.us<br></div><div></div><div>```<br></div><div><br></div><div>Or YAML:<br></div><div><br></div><div>```<br></div><div>all:<br></div><div>  hosts:<br></div><div>    'william.charlotte.us':<br></div><div>      ansible_ssh_host: 192.168.0.103<br></div><div>   children:<br></div><div>    onboarding:<br></div><div>      hosts:<br></div><div>        'yanick.ottawa.ca':<br></div><div>          ansible_ssh_host: 192.168.0.101<br></div><div>          ansible_ssh_user: yanick<br></div><div>```<br></div><div><br></div><div>and to tie in to the scary features of YAML, I *think* it'd be also be possible to define that YAML file as <br></div><div><br></div><div><br></div><div><br></div><div>```<br></div><div>all:<br></div><div>  hosts:<br></div><div>    'william.charlotte.us':<br></div><div>      ansible_ssh_host: 192.168.0.103<br></div><div>    'yanick.ottawa.ca': &yanick<br></div><div><div>        ansible_ssh_host: 192.168.0.101<br></div><div>        ansible_ssh_user: y<br></div><div>   children:<br></div></div><div>    onboarding:<br></div><div>      hosts:<br></div><div>        'yanick.ottawa.ca': *yanick<br></div><div>```<br></div><div><br></div><div><br></div><div>but I'm not sure.<br></div><div><br></div><div><br></div><div>## Step 3 of ?: reality check<br></div><div><br></div><div>Of course, I'm winging this as I go along. Take all bits and statement with a grain of salt. :-)<br></div><div><br></div><div><br></div><div>More to come,<br></div><div>`/anick<br></div><div><br></div><div><br></div></body></html>