This code tests to see if hostname ends with .linode.com, if it does then the private IP address is added to the ansible inventory file, otherwise the public IP address is added. This allows the script to work either from an linode or a host external to linode.com. If run from an linode, it must be at same geographical site as the ceph cluster. I noticed that you changed code to use private IP addresses, and if everyone is running this deployment script from an linode, then you probably don't need it.
This code tests to see if hostname ends with .linode.com, if it does then the private IP address is added to the ansible inventory file, otherwise the public IP address is added. This allows the script to work either from an linode or a host external to linode.com. If run from an linode, it must be at same geographical site as the ceph cluster. I noticed that you changed code to use private IP addresses, and if everyone is running this deployment script from an linode, then you probably don't need it.