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

Side by Side Diff: modules/downloadserver/manifests/init.pp

Issue 29750621: #10073 - Fix provisioning of downloadserver role (Closed)
Patch Set: For comments 2 and 3 Created April 13, 2018, 9:14 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 class downloadserver( 1 class downloadserver(
2 $domain, 2 $domain,
3 $certificate, 3 $certificate,
4 $private_key, 4 $private_key,
5 $is_default = false 5 $is_default = false
6 ) { 6 ) {
7 7
8 include adblockplus::web 8 include adblockplus::web
9 9
10 class {'nginx': 10 class {'nginx':
(...skipping 21 matching lines...) Expand all
32 ], 32 ],
33 } 33 }
34 34
35 user {'hg': 35 user {'hg':
36 ensure => present, 36 ensure => present,
37 comment => 'Mercurial client user', 37 comment => 'Mercurial client user',
38 home => '/home/hg', 38 home => '/home/hg',
39 managehome => true 39 managehome => true
40 } 40 }
41 41
42 file { '/var/www/downloads':
43 ensure => 'directory',
44 mode => '0755',
45 group => 'hg',
46 owner => 'hg',
47 }
48
42 exec { "fetch_downloads": 49 exec { "fetch_downloads":
43 command => "hg clone https://hg.adblockplus.org/downloads /var/www/downloads ", 50 command => "hg clone https://hg.adblockplus.org/downloads /var/www/downloads ",
44 path => ["/usr/bin/", "/bin/"], 51 path => ["/usr/bin/", "/bin/"],
45 require => Package['mercurial'],
46 user => hg, 52 user => hg,
53 require => [
54 Package['mercurial'],
55 File['/var/www/downloads'],
56 ],
47 timeout => 0, 57 timeout => 0,
48 onlyif => "test ! -d /var/www/downloads" 58 creates => "/var/www/downloads/.hg/hgrc"
49 } 59 }
50 60
51 File { 61 File {
52 owner => root, 62 owner => root,
53 group => root, 63 group => root,
54 mode => '0644', 64 mode => '0644',
55 } 65 }
56 66
57 nginx::hostconfig{$domain: 67 nginx::hostconfig{$domain:
58 source => 'puppet:///modules/downloadserver/site.conf', 68 source => 'puppet:///modules/downloadserver/site.conf',
(...skipping 10 matching lines...) Expand all
69 } 79 }
70 80
71 cron {'mirror': 81 cron {'mirror':
72 ensure => present, 82 ensure => present,
73 command => 'hg pull -q -u -R /var/www/downloads/', 83 command => 'hg pull -q -u -R /var/www/downloads/',
74 environment => hiera('cron::environment', []), 84 environment => hiera('cron::environment', []),
75 user => hg, 85 user => hg,
76 minute => '3-59/20' 86 minute => '3-59/20'
77 } 87 }
78 88
89 ensure_packages([
90 'rsync',
91 ])
92
79 file {'/var/www/devbuilds': 93 file {'/var/www/devbuilds':
80 ensure => directory, 94 ensure => directory,
81 owner => rsync 95 owner => rsync
82 } 96 }
83 97
84 user {'rsync': 98 user {'rsync':
85 ensure => present, 99 ensure => present,
86 home => '/home/rsync', 100 home => '/home/rsync',
87 managehome => true 101 managehome => true
88 } 102 }
(...skipping 14 matching lines...) Expand all
103 117
104 file {'/home/rsync/.ssh/id_rsa.pub': 118 file {'/home/rsync/.ssh/id_rsa.pub':
105 ensure => file, 119 ensure => file,
106 owner => rsync, 120 owner => rsync,
107 mode => '0400', 121 mode => '0400',
108 source => 'puppet:///modules/private/rsync@downloads.adblockplus.org.pub' 122 source => 'puppet:///modules/private/rsync@downloads.adblockplus.org.pub'
109 } 123 }
110 124
111 cron {'mirror-devbuilds': 125 cron {'mirror-devbuilds':
112 ensure => present, 126 ensure => present,
113 require => [File['/home/rsync/.ssh/id_rsa'], 127 require => [
114 File['/var/www/devbuilds']], 128 File['/home/rsync/.ssh/id_rsa'],
129 File['/var/www/devbuilds'],
130 Package['rsync'],
131 ],
115 command => 'rsync -e ssh -ltprz --delete devbuilds@buildmaster.adblockplus.o rg:. /var/www/devbuilds', 132 command => 'rsync -e ssh -ltprz --delete devbuilds@buildmaster.adblockplus.o rg:. /var/www/devbuilds',
116 environment => hiera('cron::environment', []), 133 environment => hiera('cron::environment', []),
117 user => rsync, 134 user => rsync,
118 hour => '*', 135 hour => '*',
119 minute => '4-54/10' 136 minute => '4-54/10'
120 } 137 }
121 } 138 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld