azure - [WARNING]: provided hosts list is empty, only localhost is available when inventory exists -
i'm trying list of facts available azure vm running
ansible -m setup hostname
as described in faq
so have
ansible -m setup my-vm1
which run machine in azure cloud run ansible commnads (the machine use talk , modify host in question) results in:
[warning]: provided hosts list empty, localhost available
however have ansible inventory in /etc/ansible/hosts:
40.127.174.129 my-vm1.westeurope.cloudapp.azure.com ansible_sudo_pass=mypassword my-vm2.westeurope.cloudapp.azure.com my-vm3.westeurope.cloudapp.azure.com
when run same command using fqdn following:
[me@ansible-machine]$ ansible -m setup my-vm1.westeurope.cloudapp.azure.com my-vm1.westeurope.cloudapp.azure.com | unreachable! => { "changed": false, "msg": "failed connect host via ssh.", "unreachable": true
what doing wrong?
it seems haven't mentioned how authenticating hosts. able ssh in server trying setup ? ansible tries ssh server on port 22 default, if using custom ssh port may want define custom ports on inventory file.
second think checking credentials, using key based authentication ? if yes try ssh username@yourazureinstance , see if works. if using password based authentication, please set credentials on inventory file or can use --ask pass
parameter ssh password.
Comments
Post a Comment