Requires Ansible in this branch ansible/ansible#46151 (until that is merged .. then devel or master)
$ ansible-playbook /tmp/minecraft_linode.yml -e linode_token=$LINODE_TOKEN -e ssh_key="$(cat ~/.ssh/id_rsa.pub)" -e type=g6-nanode-1 -e region=us-east -e image=linode/debian9 -e ansible_ssh_private_key_file=~/.ssh/id_rsa --private-key=~/.ssh/id_rsa
[WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [launch Linode instance] ************************************************************************************************************************************************************************************************************************************************************************************************
TASK [pwd] *******************************************************************************************************************************************************************************************************************************************************************************************************************
changed: [localhost -> localhost]
TASK [spin up Linode instance] ***********************************************************************************************************************************************************************************************************************************************************************************************
ok: [localhost -> localhost]
TASK [print info about my_linode] ********************************************************************************************************************************************************************************************************************************************************************************************
ok: [localhost -> localhost] => {
"msg": "ID is 11273318 IP is ['45.79.149.139']"
}
TASK [Add new linode to host group] ******************************************************************************************************************************************************************************************************************************************************************************************
changed: [localhost -> localhost]
TASK [Wait for SSH to come up] ***********************************************************************************************************************************************************************************************************************************************************************************************
ok: [localhost -> localhost]
PLAY [Configure linode for minecraft] ****************************************************************************************************************************************************************************************************************************************************************************************
TASK [Gathering Facts] *******************************************************************************************************************************************************************************************************************************************************************************************************
fatal: [45.79.149.139]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: [email protected]: Permission denied (publickey,password).\r\n", "unreachable": true}
to retry, use: --limit @/tmp/minecraft_linode.retry
PLAY RECAP *******************************************************************************************************************************************************************************************************************************************************************************************************************
45.79.149.139 : ok=0 changed=0 unreachable=1 failed=0 skipped=0
localhost : ok=5 changed=2 unreachable=0 failed=0 skipped=0
Here is how I've built my host group before to connect to the new Linode:
Or so, you might try to make sure you pass all of these (if not already) to make the connection.