| OLD | NEW |
| 1 class sitescripts ( | 1 class sitescripts ( |
| 2 $sitescriptsini_source = undef | 2 $sitescriptsini_source = undef |
| 3 ){ | 3 ){ |
| 4 | 4 |
| 5 file {'/etc/sitescripts.ini': | 5 concat {'/etc/sitescripts.ini': |
| 6 mode => 644, | 6 mode => 644, |
| 7 owner => root, | 7 owner => root, |
| 8 group => root, | 8 group => root, |
| 9 source => $sitescriptsini_source | |
| 10 } | 9 } |
| 11 | 10 |
| 11 define configfragment($source = $title) |
| 12 { |
| 13 concat::fragment {$source: |
| 14 target => '/etc/sitescripts.ini', |
| 15 source => $source |
| 16 } |
| 17 } |
| 18 |
| 19 configfragment {$sitescriptsini_source: } |
| 20 |
| 12 exec { "fetch_sitescripts": | 21 exec { "fetch_sitescripts": |
| 13 command => "hg clone https://hg.adblockplus.org/sitescripts /opt/sitescripts
", | 22 command => "hg clone https://hg.adblockplus.org/sitescripts /opt/sitescripts
", |
| 14 path => ["/usr/bin/", "/bin/"], | 23 path => ["/usr/bin/", "/bin/"], |
| 15 require => Package['mercurial'], | 24 require => Package['mercurial'], |
| 16 onlyif => "test ! -d /opt/sitescripts" | 25 onlyif => "test ! -d /opt/sitescripts" |
| 17 } | 26 } |
| 18 | 27 |
| 19 cron {"update_sitescripts": | 28 cron {"update_sitescripts": |
| 20 ensure => present, | 29 ensure => present, |
| 21 command => "hg pull -q -u -R /opt/sitescripts", | 30 command => "hg pull -q -u -R /opt/sitescripts", |
| 22 user => root, | 31 user => root, |
| 23 require => Exec["fetch_sitescripts"], | 32 require => Exec["fetch_sitescripts"], |
| 24 } | 33 } |
| 25 } | 34 } |
| OLD | NEW |