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

Delta Between Two Patch Sets: modules/sitescripts/manifests/init.pp

Issue 6122106488094720: Issue 1495 - Introduce $sitescriptsini_content in Puppet sitescripts module (Closed)
Left Patch Set: Created Nov. 26, 2014, 2:14 p.m.
Right Patch Set: Issue 1405 - Introduce $sitescriptsini_content in Puppet sitescripts module Created Dec. 10, 2014, 12:50 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 class sitescripts ( 1 class sitescripts (
2 $sitescriptsini_source = '', 2 $sitescriptsini_source = '',
3 $sitescriptsini_content = '', 3 $sitescriptsini_content = '',
4 ){ 4 ){
5 5
6 concat {'/etc/sitescripts.ini': 6 concat {'/etc/sitescripts.ini':
7 mode => 644, 7 mode => 644,
8 owner => root, 8 owner => root,
9 group => root, 9 group => root,
10 } 10 }
11 11
12 define configfragment($content = '', $source = '') 12 define configfragment($content = '', $source = '')
13 { 13 {
14 concat::fragment {"/etc/sitescripts.ini#$title": 14 concat::fragment {"/etc/sitescripts.ini#$title":
15 target => '/etc/sitescripts.ini', 15 target => '/etc/sitescripts.ini',
16 content => $content, 16 content => $content,
17 source => "$source;$content" ? { 17 source => "$source$content" ? {
18 ';' => $title, 18 '' => $title,
Wladimir Palant 2014/11/26 22:47:09 Why not: source => "$source$content" ? { ''
mathias 2014/11/26 23:34:29 I would agree on "more common" rather than "more o
Wladimir Palant 2014/12/08 16:44:00 I do :) In fact, I asked Sebastian as somebody wh
mathias 2014/12/10 12:51:05 Done.
19 default => $source, 19 default => $source,
20 } 20 }
21 } 21 }
22 } 22 }
23 23
24 configfragment {'/etc/sitescripts.ini': 24 configfragment {'/etc/sitescripts.ini':
25 content => $sitescriptsini_content, 25 content => $sitescriptsini_content,
26 source => $sitescriptsini_source, 26 source => $sitescriptsini_source,
27 } 27 }
28 28
29 exec { "fetch_sitescripts": 29 exec { "fetch_sitescripts":
30 command => "hg clone https://hg.adblockplus.org/sitescripts /opt/sitescripts ", 30 command => "hg clone https://hg.adblockplus.org/sitescripts /opt/sitescripts ",
31 path => ["/usr/bin/", "/bin/"], 31 path => ["/usr/bin/", "/bin/"],
32 require => Package['mercurial'], 32 require => Package['mercurial'],
33 onlyif => "test ! -d /opt/sitescripts" 33 onlyif => "test ! -d /opt/sitescripts"
34 } 34 }
35 35
36 cron {"update_sitescripts": 36 cron {"update_sitescripts":
37 ensure => present, 37 ensure => present,
38 command => "hg pull -q -u -R /opt/sitescripts", 38 command => "hg pull -q -u -R /opt/sitescripts",
39 environment => ['MAILTO=admins@adblockplus.org,root'], 39 environment => ['MAILTO=admins@adblockplus.org,root'],
40 user => root, 40 user => root,
41 require => Exec["fetch_sitescripts"], 41 require => Exec["fetch_sitescripts"],
42 } 42 }
43 } 43 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld