summaryrefslogtreecommitdiff
path: root/puppet/modules/site_static/manifests/location.pp
blob: 1ba6807e30bcfa0dece6f687ff7f2783d71c36fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
define site_static::location($path, $format, $source) {

  $file_path = "/srv/static/${name}"

  if ($format == 'amber') {
    exec {"amber_build_${name}":
      cwd     => $file_path,
      command => 'amber rebuild',
      user    => 'www-data',
      timeout => 600,
      subscribe => Vcsrepo[$file_path]
    }
  }

  vcsrepo { $file_path:
    ensure   => present,
    force    => true,
    revision => $source['revision'],
    provider => $source['type'],
    source   => $source['repo'],
    owner    => 'www-data',
    group    => 'www-data'
  }

}