test_gretunnel_source_bb_target_gw_rl.j2 1.2 KB

1234567891011121314151617
  1. #!/bin/sh
  2. failed=0
  3. echo
  4. {% for host in ffms_tun_to%}
  5. ip=192.168.{{hostvars[host.host_name].domaenen_id*10 + server_id}}.{{hostvars[host.host_name].server_id*4+2}}
  6. ping -c1 $ip >/dev/null 2>&1 && echo Tunnel ok: Von {{inventory_hostname}} zu {{host.host_name}}/$ip ||{ echo Tunnel failed: Von {{inventory_hostname}} zu {{host.host_name}}/$ip && failed=1;}
  7. ip=2a03:2260:115:ffa0:{{hostvars[host.host_name].domaenen_id}}:{{server_id}}:{{hostvars[host.host_name].server_id}}:2
  8. ping6 -c1 $ip >/dev/null 2>&1 && echo Tunnel ok: Von {{inventory_hostname}} zu {{host.host_name}}/$ip ||{ echo Tunnel failed: Von {{inventory_hostname}} zu {{host.host_name}}/$ip && failed=1;}
  9. {% endfor %}
  10. echo
  11. {% for host in ffrl_tun %}
  12. ip={{ host.v4_remote | regex_replace('/.*', '') }}
  13. ping -c1 $ip >/dev/null 2>&1 && echo Tunnel ok: Von {{inventory_hostname}} zu {{host.name}}/$ip ||{ echo Tunnel failed: Von {{inventory_hostname}} zu {{host.name}}/$ip && failed=1;}
  14. ip={{ host.v6_remote | ipaddr('address') }}
  15. ping6 -c1 $ip >/dev/null 2>&1 && echo Tunnel ok: Von {{inventory_hostname}} zu {{host.name}}/$ip ||{ echo Tunnel failed: Von {{inventory_hostname}} zu {{host.name}}/$ip && failed=1;}
  16. {% endfor %}
  17. exit $failed