aws inventory: `hostname_variable = tag_Name` not working

I haven’t used Ansible with AWS for a while.

I am using it on a new project. I see a newer option that didn’t used to be there:

hostname_variable = tag_Name

My understanding of this variable is that it will use the Name tag to name the host, while still using the i.p. address as the value of the ansible_host key.

E.g.

`
TASK [Get uptime] ***************************************
ok: [host01]

`

instead of

`
TASK [Get uptime] ***************************************
ok: [1.2.3.4]

`

However, setting that value in ec2.ini doesn’t appear to work (as I’d expect). Am I misunderstanding this, or possibly just doing something wrong?

This appears to be the PR where this functionality was added:
https://github.com/ansible/ansible/pull/7395