--- /dev/null
+MAILTO=root
+@daily puppet update-fastly-ips /srv/puppet.debian.org/puppet-facts/fastly_ranges.yaml
--- /dev/null
+#!/bin/sh
+
+set -e
+
+dest="$1"
+tmp=$(mktemp -d)
+
+cd $tmp
+if [ -d /etc/ssl/ca-global ]; then
+ wgetopts=--ca-directory=/etc/ssl/ca-global
+fi
+wget $wgetopts -q https://api.fastly.com/public-ip-list
+if cmp public-ip-list "$dest" >/dev/null; then
+ exit 0
+fi
+chmod --reference="$dest" public-ip-list
+mv public-ip-list "$dest"
concat { '/srv/puppet.debian.org/puppet-facts/onionbalance-services.yaml':
}
Concat::Fragment <<| tag == "onionbalance-services.yaml" |>>
+
+ file { '/etc/cron.d/update-fastly-ips':
+ source => 'puppet:///modules/puppetmaster/update-fastly-ips.cron'
+ }
+ file { '/usr/local/bin/update-fastly-ips':
+ source => 'puppet:///modules/puppetmaster/update-fastly-ips.sh',
+ mode => '0555',
+ }
}