rock
rock copied to clipboard
Add default Ansible IP address
I recently installed rocknsm in a closed environment. The VMs that I am using do not have a default gateway. This caused the ansible_default_ipv4.address
variable to always return null which causes the playbooks to fail on several tasks. A fix/improvement that can be done is to default to the first IP address on the VM if no default gateway is set as shown by this article.
The fix just involves changing every ansible_default_ipv4.address
to ansible_default_ipv4.address|default(ansible_all_ipv4_addresses[0])