Index: trunk/debs/wikimedia-task-dns-auth/debian/wikimedia-task-dns-auth-default |
— | — | @@ -5,3 +5,5 @@ |
6 | 6 | |
7 | 7 | # Server to rsync "langlist" from: |
8 | 8 | LANGLISTSOURCE=zwinger.wikimedia.org:/home/wikipedia/common/langlist |
| 9 | + |
| 10 | +DBLISTSOURCE=zwinger.wikimedia.org:/home/wikipedia/common/all.dblist |
Index: trunk/debs/wikimedia-task-dns-auth/debian/changelog |
— | — | @@ -1,3 +1,9 @@ |
| 2 | +wikimedia-task-dns-auth (0.06) feisty; urgency=low |
| 3 | + |
| 4 | + * Add $toolserverdbs subst, for toolserver database CNAMEs. |
| 5 | + |
| 6 | + -- River Tarnell <river@wikimedia.org> Fri, 13 Jul 2007 00:06:56 +0100 |
| 7 | + |
2 | 8 | wikimedia-task-dns-auth (0.05) feisty; urgency=medium |
3 | 9 | |
4 | 10 | * Depend on pdns >= 2.9.21 |
Index: trunk/debs/wikimedia-task-dns-auth/gen-zones |
— | — | @@ -8,6 +8,7 @@ |
9 | 9 | templatedir = '/etc/powerdns/templates' |
10 | 10 | zonedir = '/etc/powerdns/zones' |
11 | 11 | langlist = '/etc/powerdns/langlist-cnames' |
| 12 | +dblist = '/etc/powerdns/dblist-cnames' |
12 | 13 | |
13 | 14 | header = '''; WARNING! |
14 | 15 | ; Do NOT edit this file directly! It's generated by genzones |
— | — | @@ -27,6 +28,8 @@ |
28 | 29 | # all language subdomains |
29 | 30 | substs['$langlist'] = open(langlist).read() |
30 | 31 | |
| 32 | + substs['$toolserverdbs'] = open(dblist).read() |
| 33 | + |
31 | 34 | # $serial contains a SOA serial nr in the form YYYYMMDDHH |
32 | 35 | # This means that two zonechanges within the same hour could |
33 | 36 | # have the same SOA serial, but it doesn't matter because |
Index: trunk/debs/wikimedia-task-dns-auth/authdns-update |
— | — | @@ -15,6 +15,8 @@ |
16 | 16 | SCRIPTDIR=/usr/lib/wikimedia-task-dns-auth/bin |
17 | 17 | LANGLIST=$POWERDNSDIR/langlist |
18 | 18 | LANGLISTSOURCE="" |
| 19 | +DBLIST=$POWERDNSDIR/all.dblist |
| 20 | +DBLISTSOURCE="" |
19 | 21 | |
20 | 22 | PATH=/bin:/usr/bin:/usr/local/bin |
21 | 23 | |
— | — | @@ -54,6 +56,22 @@ |
55 | 57 | echo "Generating language subdomains CNAME file from $LANGLIST" |
56 | 58 | [ $LANGLIST -nt $POWERDNSDIR/langlist-cnames ] && < $LANGLIST awk '{ print $1"\t\t\t1H\tIN CNAME\trr.wikimedia.org."; print"www."$1"\t\t\t1H\tIN CNAME\trr.wikimedia.org." }' > $POWERDNSDIR/langlist-cnames |
57 | 59 | |
| 60 | +echo "Syncing all.dblist" |
| 61 | +rsync -t $DBLISTSOURCE $DBLIST || true |
| 62 | +echo "Generating wiki toolserver CNAMEs from $DBLIST" |
| 63 | +( |
| 64 | +while read line; do |
| 65 | + line=`echo $line | tr _ -` |
| 66 | + if echo $line | egrep -q '^(bgwiki|bgwiktionary|commonswiki|cswiki|dewiki|enwikiquote|enwiktionary|eowiki|fiwiki|idwiki|itwiki|nlwiki|nowiki|plwiki|ptwiki|svwiki|thwiki|trwiki|zhwiki)$'; then |
| 67 | + echo "$line-p 1H IN CNAME sql-s2.ts.wikimedia.org." |
| 68 | + elif [ $line = enwiki ]; then |
| 69 | + echo "$line-p 1H IN CNAME sql-s1.ts.wikimedia.org." |
| 70 | + else |
| 71 | + echo "$line-p 1H IN CNAME sql-s3.ts.wikimedia.org." |
| 72 | + fi; |
| 73 | +done |
| 74 | +) < $DBLIST > $POWERDNSDIR/dblist-cnames |
| 75 | + |
58 | 76 | # Generate the zonefiles from the templates |
59 | 77 | echo "Generating zonefiles from zone templates" |
60 | 78 | $SCRIPTDIR/gen-zones |
— | — | @@ -81,7 +99,7 @@ |
82 | 100 | done |
83 | 101 | |
84 | 102 | echo "Updating $slave..." |
85 | | - rsync -e ssh --delete -av $POWERDNSDIR/langlist-cnames $POWERDNSDIR/templates $POWERDNSDIR/scenarios $POWERDNSDIR/geomaps $slave:$POWERDNSDIR/ |
| 103 | + rsync -e ssh --delete -av $POWERDNSDIR/dblist-cnames $POWERDNSDIR/langlist-cnames $POWERDNSDIR/templates $POWERDNSDIR/scenarios $POWERDNSDIR/geomaps $slave:$POWERDNSDIR/ |
86 | 104 | ssh $slave "$SCRIPTDIR/gen-zones && $SCRIPTDIR/gen-bind.conf && pdns_control reload && pdns_control rediscover" |
87 | 105 | done |
88 | 106 | |