From 9d340781766b8c5b625106313d2f2c7e57948965 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Tue, 26 Dec 2017 21:04:33 +0000 Subject: [PATCH] commit workaround for proxy11 in ansible --- files/scripts/restart-broken-ipv6 | 7 +++++++ files/scripts/restart-broken-ipv6.cron | 1 + playbooks/groups/proxies.yml | 8 ++++++++ 3 files changed, 16 insertions(+) create mode 100755 files/scripts/restart-broken-ipv6 create mode 100644 files/scripts/restart-broken-ipv6.cron diff --git a/files/scripts/restart-broken-ipv6 b/files/scripts/restart-broken-ipv6 new file mode 100755 index 0000000000..124d804a90 --- /dev/null +++ b/files/scripts/restart-broken-ipv6 @@ -0,0 +1,7 @@ +#!/bin/bash + +ping6 -q -c 1 -w 2 2600:: >& /dev/null +if [ $? -ne 0 ]; +then + nmcli c up eth0 +fi diff --git a/files/scripts/restart-broken-ipv6.cron b/files/scripts/restart-broken-ipv6.cron new file mode 100644 index 0000000000..d4c3e270eb --- /dev/null +++ b/files/scripts/restart-broken-ipv6.cron @@ -0,0 +1 @@ +* * * * * root /usr/local/bin/restart-broken-ipv6 diff --git a/playbooks/groups/proxies.yml b/playbooks/groups/proxies.yml index 64febbfc22..73e515823f 100644 --- a/playbooks/groups/proxies.yml +++ b/playbooks/groups/proxies.yml @@ -197,3 +197,11 @@ - name: make sure selinux contexts are right on srv command: restorecon -R /srv changed_when: false + + - name: install restart ipv6 script on proxies that have problems keeping ipv6 routes + copy: src="{{ files }}/scripts/restart-broken-ipv6" dest=/usr/local/bin/restart-broken-ipv6 mode=0755 + when: inventory_hostname.startswith('proxy11') + + - name: setup cron job to check/fix ipv6 + copy: src="{{ files }}/scripts/restart-broken-ipv6.cron" dest=/etc/cron.d/restart-broken-ipv6 mode=0644 + when: inventory_hostname.startswith('proxy11')