summaryrefslogtreecommitdiff
path: root/manifests/config.pp
blob: a3a6e01fed7b7bcf1718592dbf3059392e50a4d9 (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
#Installs configuration files for the trocla agent/CLI
#
#Options
# [*adapter*]            Defines the adapter type to use for trocla agent.
#                        By default it's YAML
# [*adapter_options*]    This will contain a hash of the adapter options to pass the
#                        trocla configuration.
# [*password_length*]    Define the length of default passwords to create. 16 by default
# [*random_passwords*]   Should trocla generate random passwords
#                        if none can be found. *true* by default.
# [*manage_dependencies*] Whether to manage the dependencies or not. Default *true*
class trocla::config (
  $adapter            = 'YAML',
  $password_length      = 16,
  $random_passwords     = true,
  $adapter_options      = {},
  $manage_dependencies  = true,
) {
  if $manage_dependencies {
    require trocla::master
  }

  # Deploy default config file and link it for trocla cli lookup
  file{
    "${settings::confdir}/troclarc.yaml":
      ensure  => present,
      content => template('trocla/troclarc.yaml.erb'),
      owner   => root,
      group   => puppet,
      mode    => '0640';
    '/etc/troclarc.yaml':
      ensure => link,
      target => "${settings::confdir}/troclarc.yaml";
  }

}