-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0e9cd4
commit d66a213
Showing
12 changed files
with
473 additions
and
354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
# @summary | ||
# manage client configs for bareos | ||
# | ||
# @api private | ||
# | ||
class bareos::client::config ( | ||
$ensure = present, | ||
$absolute_job_timeout = undef, | ||
$allow_bandwidth_bursting = undef, | ||
$allowed_job_command = undef, | ||
$allowed_script_dir = undef, | ||
$always_use_lmdb = undef, | ||
$compatible = undef, | ||
$description = undef, | ||
$fd_address = undef, | ||
$fd_addresses = undef, | ||
$fd_port = undef, | ||
$fd_source_address = undef, | ||
$heartbeat_interval = undef, | ||
$lmdb_threshold = undef, | ||
$log_timestamp_format = undef, | ||
$maximum_bandwidth_per_job = undef, | ||
$maximum_concurrent_jobs = undef, | ||
$maximum_connections = undef, | ||
$maximum_network_buffer_size = undef, | ||
$messages = undef, | ||
$name_client = 'bareos-fd', | ||
$pid_directory = undef, | ||
$pki_cipher = undef, | ||
$pki_encryption = undef, | ||
$pki_key_pair = undef, | ||
$pki_master_key = undef, | ||
$pki_signatures = undef, | ||
$pki_signer = undef, | ||
$plugin_directory = undef, | ||
$plugin_names = undef, | ||
$scripts_directory = undef, | ||
$sd_connect_timeout = undef, | ||
$secure_erase_command = undef, | ||
$tls_allowed_cn = undef, | ||
$tls_authenticate = undef, | ||
$tls_ca_certificate_dir = undef, | ||
$tls_ca_certificate_file = undef, | ||
$tls_certificate = undef, | ||
$tls_certificate_revocation_list = undef, | ||
$tls_cipher_list = undef, | ||
$tls_dh_file = undef, | ||
$tls_enable = undef, | ||
$tls_key = undef, | ||
$tls_require = undef, | ||
$tls_verify_peer = undef, | ||
$ver_id = undef, | ||
$working_directory = undef, | ||
) { | ||
assert_private() | ||
|
||
[ | ||
"${bareos::client_config_directory}/client", | ||
"${bareos::client_config_directory}/director", | ||
"${bareos::client_config_directory}/messages", | ||
].each |$config_directory| { | ||
file { $config_directory: | ||
ensure => directory, | ||
force => true, | ||
purge => true, | ||
recurse => true, | ||
group => $bareos::config_group, | ||
mode => $bareos::config_directory_mode, | ||
owner => $bareos::config_owner, | ||
tag => ['bareos', 'bareos_client'], | ||
} | ||
} | ||
|
||
$_resource = 'Client' | ||
$_resource_dir = 'client' | ||
|
||
if $ensure == 'present' { | ||
$_require_res_messages = $messages ? { undef => undef, default => Bareos::Client::Messages[$messages] } | ||
|
||
$_require_resource = delete_undef_values([ | ||
$_require_res_messages, | ||
]) | ||
|
||
$_settings = bareos_settings( | ||
[$name_client, 'Name', 'name', true], | ||
[$description, 'Description', 'string', false], | ||
[$absolute_job_timeout, 'Absolute Job Timeout', 'pint32', false], | ||
[$allow_bandwidth_bursting, 'Allow Bandwidth Bursting', 'boolean', false], | ||
[$allowed_job_command, 'Allowed Job Command', 'string_list', false], | ||
[$allowed_script_dir, 'Allowed Script Dir', 'directory_list', false], | ||
[$always_use_lmdb, 'Always Use Lmdb', 'boolean', false], | ||
[$compatible, 'Compatible', 'boolean', false], | ||
[$fd_address, 'Fd Address', 'address', false], | ||
[$fd_addresses, 'Fd Addresses', 'addresses', false], | ||
[$fd_port, 'Fd Port', 'port', false], | ||
[$fd_source_address, 'Fd Source Address', 'address', false], | ||
[$heartbeat_interval, 'Heartbeat Interval', 'time', false], | ||
[$lmdb_threshold, 'Lmdb Threshold', 'pint32', false], | ||
[$log_timestamp_format, 'Log Timestamp Format', 'string', false], | ||
[$maximum_bandwidth_per_job, 'Maximum Bandwidth Per Job', 'speed', false], | ||
[$maximum_concurrent_jobs, 'Maximum Concurrent Jobs', 'pint32', false], | ||
[$maximum_connections, 'Maximum Connections', 'pint32', false], | ||
[$maximum_network_buffer_size, 'Maximum Network Buffer Size', 'pint32', false], | ||
[$messages, 'Messages', 'res', false], | ||
[$pid_directory, 'Pid Directory', 'directory', false], | ||
[$pki_cipher, 'Pki Cipher', 'encryption_cipher', false], | ||
[$pki_encryption, 'Pki Encryption', 'boolean', false], | ||
[$pki_key_pair, 'Pki Key Pair', 'directory', false], | ||
[$pki_master_key, 'Pki Master Key', 'directory_list', false], | ||
[$pki_signatures, 'Pki Signatures', 'boolean', false], | ||
[$pki_signer, 'Pki Signer', 'directory_list', false], | ||
[$plugin_directory, 'Plugin Directory', 'directory', false], | ||
[$plugin_names, 'Plugin Names', 'plugin_names', false], | ||
[$scripts_directory, 'Scripts Directory', 'directory', false], | ||
[$sd_connect_timeout, 'Sd Connect Timeout', 'time', false], | ||
[$secure_erase_command, 'Secure Erase Command', 'string', false], | ||
[$tls_allowed_cn, 'Tls Allowed Cn', 'string_list', false], | ||
[$tls_authenticate, 'Tls Authenticate', 'boolean', false], | ||
[$tls_ca_certificate_dir, 'Tls Ca Certificate Dir', 'directory', false], | ||
[$tls_ca_certificate_file, 'Tls Ca Certificate File', 'directory', false], | ||
[$tls_certificate, 'Tls Certificate', 'directory', false], | ||
[$tls_certificate_revocation_list, 'Tls Certificate Revocation List', 'directory', false], | ||
[$tls_cipher_list, 'Tls Cipher List', 'string', false], | ||
[$tls_dh_file, 'Tls Dh File', 'directory', false], | ||
[$tls_enable, 'Tls Enable', 'boolean', false], | ||
[$tls_key, 'Tls Key', 'directory', false], | ||
[$tls_require, 'Tls Require', 'boolean', false], | ||
[$tls_verify_peer, 'Tls Verify Peer', 'boolean', false], | ||
[$ver_id, 'Ver Id', 'string', false], | ||
[$working_directory, 'Working Directory', 'directory', false] | ||
) | ||
} else { | ||
$_require_res_messages = undef | ||
} | ||
|
||
file { "${bareos::client::config_dir}/${_resource_dir}/bareos-fd.conf": | ||
ensure => $ensure, | ||
mode => $bareos::file_mode, | ||
owner => $bareos::file_owner, | ||
group => $bareos::file_group, | ||
content => template('bareos/resource.erb'), | ||
notify => Service[$bareos::client::service_name], | ||
require => $_require_res_messages, | ||
tag => ['bareos', 'bareos_client'], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# @summary | ||
# manage client packages for bareos | ||
# | ||
# @api private | ||
# | ||
class bareos::client::package ( | ||
) { | ||
assert_private() | ||
|
||
if $bareos::manage_client_package { | ||
$bareos::client_packages.each |$client_package| { | ||
package { $client_package: | ||
ensure => $bareos::client_package_ensure, | ||
tag => ['bareos', 'bareos_client'], | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# @summary | ||
# manage client service for bareos | ||
# | ||
# @api private | ||
# | ||
class bareos::client::service ( | ||
) { | ||
assert_private() | ||
|
||
if $bareos::manage_client_service { | ||
service { $bareos::client_service_name: | ||
ensure => $bareos::client_service_ensure, | ||
enable => $bareos::client_service_enable, | ||
tag => [ | ||
'bareos', | ||
'bareos_client', | ||
], | ||
} | ||
} | ||
} |
Oops, something went wrong.