Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/filtermaster/manifests/init.pp

Issue 6029451183783936: Add Filtermaster (Closed)
Patch Set: Remove file Created Nov. 14, 2013, 2:51 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: modules/filtermaster/manifests/init.pp
===================================================================
new file mode 100755
--- /dev/null
+++ b/modules/filtermaster/manifests/init.pp
@@ -0,0 +1,131 @@
+class filtermaster {
+ Cron {
+ #TODO change email
+ environment => ['MAILTO=root', 'PYTHONPATH=/opt/sitescripts'],
+ }
+
+ class {'ssh':
+ custom_configuration => 'Match User rsync
+ AllowTcpForwarding no
+ X11Forwarding no
+ AllowAgentForwarding no
+ GatewayPorts no
+ ForceCommand rsync --server --sender -vltprz --delete-excluded . /home/rsync/generated/data/'
+ }
+
+ user {'rsync':
+ ensure => present,
+ comment => 'Filter list mirror user',
+ home => '/home/rsync',
+ managehome => true
+ }
+
+ file {'/home/rsync/update_repos.sh':
+ ensure => file,
+ owner => rsync,
+ mode => 0700,
+ source => 'puppet:///modules/filtermaster/update_repos.sh'
+ }
+
+ file {'/home/rsync/.ssh':
Felix Dahlke 2013/11/14 15:07:31 Can you move this down so it's right before author
christian 2013/11/14 15:26:43 Done.
+ ensure => directory,
+ owner => rsync,
+ mode => 0600
+ }
+
+ file {'/home/rsync/subscription':
+ ensure => directory,
+ owner => rsync
+ }
+
+ file {'/home/rsync/generated':
+ ensure => directory,
+ owner => rsync
+ }
+
+ file {'/home/rsync/.ssh/authorized_keys':
+ ensure => file,
+ owner => rsync,
+ mode => 0600,
+ source => 'puppet:///modules/private/rsync@easylist-downloads.adblockplus.org.pub'
+ }
+
+ file {'/etc/ssh/ssh_host_rsa_key':
Felix Dahlke 2013/11/14 15:07:31 This should require the ssh package to be installe
christian 2013/11/14 15:26:43 Done.
+ notify => Service["ssh"],
Felix Dahlke 2013/11/14 15:07:31 Only once space before =>.
christian 2013/11/14 15:26:43 Done.
+ ensure => file,
+ owner => root,
+ group => root,
+ source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.key'
+ }
+
+ file {'/etc/ssh/ssh_host_rsa_key.pub':
+ notify => Service["ssh"],
+ ensure => file,
+ owner => root,
+ group => root,
+ source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.pub'
+ }
+
+ package {['p7zip-full']:}
+
+ define repo_download( ) {
Felix Dahlke 2013/11/14 15:07:31 No space between ( and ).
christian 2013/11/14 15:26:43 Done.
+ exec { "fetch_${title}":
Felix Dahlke 2013/11/14 15:07:31 No space before ", and ' instead of ".
christian 2013/11/14 15:26:43 remove space, will broke if i replace the " becaus
Felix Dahlke 2013/11/14 15:33:30 Oops, right.
+ command => "hg clone https://hg.adblockplus.org/${title} /home/rsync/subscription/${title}",
+ path => ["/usr/bin/", "/bin/"],
+ require => Package['mercurial'],
+ user => rsync,
+ timeout => 0,
+ onlyif => "test ! -d /home/rsync/subscription/${title}"
+ }
+ }
+
+ repo_download {['easylist',
+ 'easylistgermany',
+ 'easylistitaly',
+ 'easylistcombinations',
+ 'malwaredomains',
+ 'ruadlist',
+ 'listefr',
+ 'exceptionrules',
+ 'easylistdutch',
+ 'facebookfilters',
+ 'antiadblockfilters'
+ ]:
+ }
+
+ cron {'update_subscription':
+ ensure => present,
+ command => "python -m sitescripts.subscriptions.bin.updateSubscriptionDownloads 3>&1 1>/dev/null 2>&3 | perl -pe 's/^/\"[\" . scalar localtime() . \"] \"/e' >> /tmp/subscription_errors && chmod 666 /tmp/subscription_errors 2>/dev/null",
+ user => rsync,
+ require => [
+ User['rsync']
+ ],
+ minute => '*/10'
+ }
+
+ cron {'update_malware':
+ ensure => present,
+ command => "python -m sitescripts.subscriptions.bin.updateMalwareDomainsList",
+ user => rsync,
+ require => [
+ User['rsync']
Felix Dahlke 2013/11/14 15:07:31 Just |require => User['rsync']| please.
christian 2013/11/14 15:26:43 Done.
+ ],
+ hour => '*/6',
+ minute => 15
+ }
+
+ cron {'update_repos':
+ ensure => present,
+ command => "/home/rsync/update_repos.sh",
+ user => rsync,
+ require => [
+ User['rsync'],
Felix Dahlke 2013/11/14 15:07:31 Can you indent this and the File below one level?
christian 2013/11/14 15:26:43 Done.
+ File['/home/rsync/update_repos.sh']
+ ],
+ minute => '8-58/10'
+ }
+
+ class {'sitescripts':
+ sitescriptsini_source => 'puppet:///modules/filtermaster/sitescripts'
+ }
+}

Powered by Google App Engine
This is Rietveld