summaryrefslogtreecommitdiff
path: root/global/overlay/etc/puppet/manifests/catlfish/storage.pp
blob: a325f3e4f972e00929cc8f9005b262125cee75b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
define catlfish::storage(
      $image    = 'docker.sunet.se/ctct/catlfish-dev',
      $version  = 'latest'
)
{
   $base = '/var/local/db'
   $db = "${base}/${name}"
   file {$base: ensure => directory } ->
   file {$db: ensure => directory } ->
   sunet::docker_run {'${name}_storage':
       image    => $image,
       imagetag => $version,
       volumes  => ["/usr/local/etc/catlfish:/usr/local/etc/catlfish:ro","${db}:/var/local/db/catlfish"],
       ports    => ["8081:8081"],
       command  => ["storage"]
   }
   ufw:allow { "${name}-allow-8081-acl0":
      ip     => '130.242.125.0/24',
      port   => 8081
   }
}