summaryrefslogtreecommitdiff
path: root/manifests/yaml.pp
blob: 7727219fe777c4b839bb80d95c6dbb765dd21b6c (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# A class for an eady start with trocla.
# This will install and configure trocla with the
# default yaml storage.
#
# [*data_file*]        Where to store the passwords.
#                      Default: /var/lib/trocla/trocla_data.yaml
#                      This should be managed using the package.
class trocla::yaml(
  $manage_data_dir = true,
  $data_file       = '/var/lib/trocla/trocla_data.yaml',
) {

  class{'trocla::config':
    store         => 'moneta',
    store_options => {
      adapter         => 'YAML',
      adapter_options => {
        file => $data_file,
      },
    },
  }

  if $manage_data_dir {
    $data_dir = dirname($data_file)
    file{$data_dir:
      ensure  => directory,
      owner   => puppet,
      group   => 0,
      mode    => '0600',
      require => Package['trocla'];
    }
  }
  file{
    $data_file:
      ensure  => file,
      owner   => puppet,
      group   => 0,
      mode    => '0600',
      require => Package['trocla'];
  }
}