bowoow
bowoow

Reputation: 1

Ansible "Failed to resolve hostname inventory_hostname (Name or service not known)"

I have a hosts file that looks like this:

[test]
10.1.1.1     ansible_user=my_username

When I try to run an ansible playbook, which calls this test group as hosts:


- hosts: test
  gather_facts: no
  connection: local

I get the error:

fatal: [10.1.1.1]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "msg": "ssh connection failed: ssh connect failed: Failed to resolve hostname inventory_hostname (Name or service not known)"}

Does anybody know why it tries to resolve the IP address and how this could be fixed?

Tried creating my own alias as well: testhost=10.1.1.1

Upvotes: 0

Views: 175

Answers (0)

Related Questions