Shell script `default/allow-mix-ip-from-cluster'

Accept connection from all servers' IP addresses in the current cluster.
Use private IPs if in the same datacenter, otherwise public IP.

{% for eachServer in cluster.servers %} echo '#{{ loop.index }} Allow connections from new server' {{ eachServer.name }} 'with public IP' {{ eachServer.publicIp }} sudo ufw allow from {{ eachServer.publicIp }} {% if eachServer.location == server.location %} echo '#{{ loop.index }} Allow connections from new server' {{ eachServer.name }} 'with private IP' {{ eachServer.privateIp }} sudo ufw allow from {{ eachServer.privateIp }} {% endif %} {% endfor %}