How to acces ansible_host from the inventory?

I have an inventory with IP addresses:

[myhosts]
host1 ansible_host=10.0.0.1
host2 ansible_host=10.0.0.2

This makes me independent from the /etc/hosts file, which I want to manage with Ansible.

I wrote a bootstrap playbook to grab all SSH keys. This has to be run before anything else.

Have you tried "{{ ansible_host }}" ?

No. Thanks that was easy! Probably too easy for me :wink: