diff --git a/roles/nhc/templates/check_nat.nhc.j2 b/roles/nhc/templates/check_nat.nhc.j2 new file mode 100644 index 0000000000000000000000000000000000000000..8f64e3aaf66584129533ff35619dc62532a9f55c --- /dev/null +++ b/roles/nhc/templates/check_nat.nhc.j2 @@ -0,0 +1,21 @@ +#!/bin/bash + +#checks that NAT is working by pinging an external address from a compute node + +function check_nat() { +#echo ">>> Checking NAT on Compute Nodes Works >>>>>>>>>>>>>>>>>>>>>>>>>" + + +#test NAT by pinging an external IP ADDRESS +PING_EXTERNAL="ping -c 2 {{ EXTERNAL_IP_ADDRESS }}" + +$PING_EXTERNAL +RESULT=$? +if [ $RESULT -ne 0 ]; then + die 1 " $FUNCNAME ERROR on node. Can not ping external address. Command is ' ${PING_EXTERNAL} ' Please check NAT is working, or route on node is valid" + return 1 +fi +return 0 +} + +