Especially when testing recurring deployments on a test environment, it is easier to access overcloud nodes with user-friendly names like “controller0” or “compute3”.
Use this script to update your /etc/hosts after a successful deployment.
The script depends on having the stackrc file sourced prior to running it.
It will require sudo permissions in order to make modifications to /etc/hosts. I normally run it as user stack with sudo and using -E to preserve stack’s env:
$ sudo -E ./sethosts.py -a