| OLD | NEW |
| 1 class filterserver($is_default = false) { | 1 class filterserver($is_default = false) { |
| 2 if !defined(Class['nginx']) { | 2 if !defined(Class['nginx']) { |
| 3 class {'nginx': | 3 class {'nginx': |
| 4 worker_connections => 4000, | 4 worker_connections => 4000, |
| 5 ssl_session_cache => off, | 5 ssl_session_cache => off, |
| 6 } | 6 } |
| 7 } | 7 } |
| 8 | 8 |
| 9 if !defined(File['/var/www']) { | 9 if !defined(File['/var/www']) { |
| 10 file {'/var/www': | 10 file {'/var/www': |
| 11 ensure => directory, | 11 ensure => directory, |
| 12 owner => nginx, | 12 owner => nginx, |
| 13 mode => 0755, | 13 mode => '0755', |
| 14 require => User['nginx'] | 14 require => User['nginx'] |
| 15 } | 15 } |
| 16 } | 16 } |
| 17 | 17 |
| 18 user {'subscriptionstat': | 18 user {'subscriptionstat': |
| 19 ensure => absent, | 19 ensure => absent, |
| 20 } | 20 } |
| 21 | 21 |
| 22 user {'rsync': | 22 user {'rsync': |
| 23 ensure => present, | 23 ensure => present, |
| 24 comment => 'Filter list mirror user', | 24 comment => 'Filter list mirror user', |
| 25 home => '/home/rsync', | 25 home => '/home/rsync', |
| 26 managehome => true | 26 managehome => true |
| 27 } | 27 } |
| 28 | 28 |
| 29 File { | 29 File { |
| 30 owner => root, | 30 owner => root, |
| 31 group => root, | 31 group => root, |
| 32 mode => 0644, | 32 mode => '0644', |
| 33 } | 33 } |
| 34 | 34 |
| 35 file {'/var/www/easylist': | 35 file {'/var/www/easylist': |
| 36 ensure => directory, | 36 ensure => directory, |
| 37 owner => rsync | 37 owner => rsync |
| 38 } | 38 } |
| 39 | 39 |
| 40 nginx::hostconfig{'easylist-downloads.adblockplus.org': | 40 nginx::hostconfig{'easylist-downloads.adblockplus.org': |
| 41 alt_names => ['easylist-msie.adblockplus.org'], | 41 alt_names => ['easylist-msie.adblockplus.org'], |
| 42 source => 'puppet:///modules/filterserver/site.conf', | 42 source => 'puppet:///modules/filterserver/site.conf', |
| 43 is_default => $is_default, | 43 is_default => $is_default, |
| 44 certificate => 'easylist-downloads.adblockplus.org_sslcert.pem', | 44 certificate => 'easylist-downloads.adblockplus.org_sslcert.pem', |
| 45 private_key => 'easylist-downloads.adblockplus.org_sslcert.key', | 45 private_key => 'easylist-downloads.adblockplus.org_sslcert.key', |
| 46 log => 'access_log_easylist_downloads', | 46 log => 'access_log_easylist_downloads', |
| 47 global_config => join([ | 47 global_config => join([ |
| 48 'proxy_cache_path /var/cache/nginx/proxy levels=1 keys_zone=filters:1m;', | 48 'proxy_cache_path /var/cache/nginx/proxy levels=1 keys_zone=filters:1m;', |
| 49 ], "\n"), | 49 ], "\n"), |
| 50 } | 50 } |
| 51 | 51 |
| 52 file {'/home/rsync/.ssh': | 52 file {'/home/rsync/.ssh': |
| 53 ensure => directory, | 53 ensure => directory, |
| 54 require => User['rsync'], | 54 require => User['rsync'], |
| 55 owner => rsync, | 55 owner => rsync, |
| 56 mode => 0600; | 56 mode => '0600', |
| 57 } | 57 } |
| 58 | 58 |
| 59 concat {'/home/rsync/.ssh/known_hosts': | 59 concat {'/home/rsync/.ssh/known_hosts': |
| 60 owner => rsync, | 60 owner => rsync, |
| 61 mode => 0444, | 61 mode => '0444', |
| 62 } | 62 } |
| 63 | 63 |
| 64 concat::fragment {'filtermaster_hostname': | 64 concat::fragment {'filtermaster_hostname': |
| 65 target => '/home/rsync/.ssh/known_hosts', | 65 target => '/home/rsync/.ssh/known_hosts', |
| 66 content => 'filtermaster.adblockplus.org ', | 66 content => 'filtermaster.adblockplus.org ', |
| 67 order => 1, | 67 order => 1, |
| 68 } | 68 } |
| 69 | 69 |
| 70 concat::fragment {'filtermaster_hostkey': | 70 concat::fragment {'filtermaster_hostkey': |
| 71 target => '/home/rsync/.ssh/known_hosts', | 71 target => '/home/rsync/.ssh/known_hosts', |
| 72 source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.pub', | 72 source => 'puppet:///modules/private/filtermaster.adblockplus.org_ssh.pub', |
| 73 order => 2, | 73 order => 2, |
| 74 } | 74 } |
| 75 | 75 |
| 76 file {'/home/rsync/.ssh/id_rsa': | 76 file {'/home/rsync/.ssh/id_rsa': |
| 77 ensure => file, | 77 ensure => file, |
| 78 require => [ | 78 require => [ |
| 79 File['/home/rsync/.ssh'], | 79 File['/home/rsync/.ssh'], |
| 80 User['rsync'] | 80 User['rsync'] |
| 81 ], | 81 ], |
| 82 owner => rsync, | 82 owner => rsync, |
| 83 mode => 0400, | 83 mode => '0400', |
| 84 source => 'puppet:///modules/private/rsync@easylist-downloads.adblockplus.or
g' | 84 source => 'puppet:///modules/private/rsync@easylist-downloads.adblockplus.or
g' |
| 85 } | 85 } |
| 86 | 86 |
| 87 file {'/home/rsync/.ssh/id_rsa.pub': | 87 file {'/home/rsync/.ssh/id_rsa.pub': |
| 88 ensure => file, | 88 ensure => file, |
| 89 require => [ | 89 require => [ |
| 90 File['/home/rsync/.ssh'], | 90 File['/home/rsync/.ssh'], |
| 91 User['rsync'] | 91 User['rsync'] |
| 92 ], | 92 ], |
| 93 owner => rsync, | 93 owner => rsync, |
| 94 mode => 0400, | 94 mode => '0400', |
| 95 source => 'puppet:///modules/private/rsync@easylist-downloads.adblockplus.or
g.pub' | 95 source => 'puppet:///modules/private/rsync@easylist-downloads.adblockplus.or
g.pub' |
| 96 } | 96 } |
| 97 | 97 |
| 98 cron {'mirror': | 98 cron {'mirror': |
| 99 ensure => present, | 99 ensure => present, |
| 100 require => [ | 100 require => [ |
| 101 File['/home/rsync/.ssh/known_hosts'], | 101 File['/home/rsync/.ssh/known_hosts'], |
| 102 File['/home/rsync/.ssh/id_rsa'], | 102 File['/home/rsync/.ssh/id_rsa'], |
| 103 User['rsync'] | 103 User['rsync'] |
| 104 ], | 104 ], |
| 105 command => 'rsync -e "ssh -o CheckHostIP=no" -ltprz --delete rsync@filtermas
ter.adblockplus.org:. /var/www/easylist/', | 105 command => 'rsync -e "ssh -o CheckHostIP=no" -ltprz --delete rsync@filtermas
ter.adblockplus.org:. /var/www/easylist/', |
| 106 environment => hiera('cron::environment', []), | 106 environment => hiera('cron::environment', []), |
| 107 user => rsync, | 107 user => rsync, |
| 108 hour => '*', | 108 hour => '*', |
| 109 minute => '2-52/10' | 109 minute => '2-52/10' |
| 110 } | 110 } |
| 111 } | 111 } |
| OLD | NEW |