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

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

{% for eachCluster in inClusters %} echo 'Cluster' {{ eachCluster.name }} {% for eachServer in eachCluster.servers %} echo '#{{ loop.index }} Allow connections from incoming 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 incoming server' {{ eachServer.name }} 'with private IP' {{ eachServer.privateIp }} sudo ufw allow from {{ eachServer.privateIp }} {% endif %} {% endfor %} {% endfor %}