Move bacula::bacula_ssl_ca_path to hiera
[mirror/dsa-puppet.git] / modules / bacula / manifests / init.pp
1 # bacula class -- defines all the variables we care about in our bacula deployment
2 #
3 # @param operator_email   email address for reports
4 # @param do_ssl           use TLS between systems
5 # @param ssl_ca_path      full path and filename specifying a PEM encoded TLS CA certificate(s)
6 # @param public_addresses this host's public IP addresses.  The ones it connects out from and is reachable from outsite.
7 # @param has_ipv4         daemons should listen on ipv4
8 # @param has_ipv6         daemons should listen on ipv6
9 class bacula (
10   String  $operator_email          = 'root@localhost',
11   Boolean $do_ssl                  = true,
12   Optional[String] $ssl_ca_path,
13   String  $bacula_ssl_client_cert  = '/etc/ssl/debian/certs/thishost.crt',
14   String  $bacula_ssl_client_key   = '/etc/ssl/private/thishost.key',
15   String  $bacula_ssl_server_cert  = '/etc/ssl/debian/certs/thishost-server.crt',
16   String  $bacula_ssl_server_key   = '/etc/ssl/private/thishost-server.key',
17
18   Array[Stdlib::IP::Address] $public_addresses = $base::public_addresses,
19
20   Boolean $has_ipv4        = $bacula::public_addresses.any |$addr| { $addr =~ Stdlib::IP::Address::V4 },
21   Boolean $has_ipv6        = $bacula::public_addresses.any |$addr| { $addr =~ Stdlib::IP::Address::V6 },
22 ) {
23   # This file is used by our helper scripts on the director
24   $bacula_dsa_client_list     = '/etc/bacula/dsa-clients'
25   $tag_bacula_dsa_client_list = 'bacula::dsa::clientlist'
26
27   if $do_ssl {
28     if !$ssl_ca_path { fail('Need ssl_ca_path with do_ssl') }
29
30     $bacula_tls_ca_certificate_file = "TLS CA Certificate File = \"${ssl_ca_path}\""
31   } else {
32     $bacula_tls_ca_certificate_file = ''
33   }
34
35
36   file { '/usr/local/sbin/bacula-idle-restart':
37     mode   => '0555',
38     source => 'puppet:///modules/bacula/bacula-idle-restart',
39   }
40 }