zimmertr / Bootstrap-Proxmox

13 stars 7 forks source link

Could not resolve hostname earth.sol.milkway #7

Closed A-thaVan closed 3 years ago

A-thaVan commented 3 years ago

When I tried running this Ansible command after updating to Ansible 2.9, I got an error when it was trying to install the sudo package. Currently my node and cluster are not referred to as earth or sol. Is this a requirement to successfully run this command?

ansible-playbook -i inventory.yml TKS-Bootstrap_Proxmox/Ansible/create_user_account.yml

fatal: [earth.sol.milkyway]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname earth.sol.milkway: Name or service not known", "unreachable": true}

image

A-thaVan commented 3 years ago

Problem solved. In order to minimize changes to the inventory.yml, I mapped my server IP to the earth.sol.milkyway hostname by editing /etc/hosts (%WINDIR%\System32\drivers\etc\hosts for those like me using WSL in Windows).

Then I had to use "ssh-keygen -t rsa" to generate the ssh keypair. The export variable, TKS_BP_V_PROXMOX_SSH_KEY, would have to reflect whatever location and name used.

I recommend these additional steps are added to the README for completeness.

zimmertr commented 3 years ago

Ansible normally has its remote targets declared via an inventory file. The reason you were seeing that FQDN was because it is the name of my personal Proxmox server.

You can update this information here. I've added a note to the README here as well.