-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define resource bacula::director::console
- Loading branch information
Showing
5 changed files
with
252 additions
and
0 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,70 @@ | ||
# @summary Define a Bacula Director Console | ||
# | ||
# This define creates a console declaration for the director. | ||
# Resources of this type are intended to manage conf.d/console.conf entries. | ||
# | ||
# @param conf_dir The bacula configuration director. Should not need adjusting | ||
# @param password The password that must be supplied for a named Bacula Console to be authorized | ||
# @param jobacl A list of Job resource names that can be accessed by the console. | ||
# @param clientacl A list of Client resource names that can be accessed by the console. | ||
# @param storageacl A list of Storage resource names that can be accessed by the console. | ||
# @param scheduleacl A list of Schedule resource names that can be accessed by the console. | ||
# @param poolacl A list of Pool resource names that can be accessed by the console. | ||
# @param filesetacl A list of FileSet resource names that can be accessed by the console. | ||
# @param catalogacl A list of Catalog resource names that can be accessed by the console. | ||
# @param commandacl A list of of console commands that can be executed by the console. | ||
# @param whereacl This directive permits you to specify where a restricted console can restore files. | ||
# | ||
# Aside from Director resource names and console command names, | ||
# the special keyword *all* can be specified in any of the above access control lists. | ||
# When this keyword is present, any resource or command name (which ever is appropriate) will be accepted. | ||
# | ||
# @example | ||
# bacula::director::console { 'Monitoring': | ||
# password => 'monitoring_password', | ||
# } | ||
# | ||
define bacula::director::console ( | ||
String[1] $password, | ||
String $conf_dir = $bacula::conf_dir, | ||
String[1] $catalogacl = '*all*', | ||
Array[Enum[ | ||
['add'], ['autodisplay'], ['automount'], ['cancel'], ['cloud'], ['create'], ['delete'], ['disable'], ['enable'], ['estimate'], | ||
['exit'], ['gui'], ['help'], ['label'], ['list'], ['llist'], ['messages'], ['memory'], ['mount'], ['prune'], ['purge'], ['query'], | ||
['quit'], ['relabel'], ['release'], ['reload'], ['restart'], ['resume'], ['restore'], ['run'], ['setbandwidth'], ['setdebug'], | ||
['setip'], ['show'], ['sqlquery'], ['status'], ['tag'], ['time'], ['trace'], ['umount'], ['unmount'], ['update'], ['use'], ['var'], | ||
['version'], ['wait'], ['.api'], ['.backups'], ['.clients'], ['.catalogs'], ['.defaults'], ['.die'], ['.dir'], ['.dump'], ['.exit'], | ||
['.events'], ['.filesets'], ['.help'], ['.jobs'], ['.estimate'], ['.jlist'], ['.levels'], ['.messages'], ['.msgs'], ['.pools'], | ||
['.quit'], ['.putfile'], ['.schedule'], ['.sql'], ['.status'], ['.storage'], ['.volstatus'], ['.media'], ['.mediatypes'], | ||
['.locations'], ['.actiononpurge'], ['.bvfs_lsdirs'], ['.bvfs_lsfiles'], ['.bvfs_get_volumes'], ['.bvfs_update'], | ||
['.bvfs_get_jobids'], ['.bvfs_get_jobs'], ['.bvfs_get_bootstrap'], ['.bvfs_get_fileindex'], ['.bvfs_versions'], ['.bvfs_get_delta'], | ||
['.bvfs_restore'], ['.bvfs_cleanup'], ['.bvfs_decode_lstat'], ['.bvfs_clear_cache'], ['.bvfs_update_fv'], ['.bvfs_delete_fileid'], | ||
['.setuid'], ['.ls'], ['.types'], ['.query'], ['.tags'], | ||
]] $commandacl = ['list'], | ||
Optional[String[1]] $jobacl = undef, | ||
Optional[String[1]] $clientacl = undef, | ||
Optional[String[1]] $storageacl = undef, | ||
Optional[String[1]] $scheduleacl = undef, | ||
Optional[String[1]] $poolacl = undef, | ||
Optional[String[1]] $filesetacl = undef, | ||
Optional[String[1]] $whereacl = undef, | ||
) { | ||
$epp_console_variables = { | ||
name => $name, | ||
password => $password, | ||
commandacl => $commandacl, | ||
whereacl => $whereacl, | ||
jobacl => $jobacl, | ||
clientacl => $clientacl, | ||
storageacl => $scheduleacl, | ||
scheduleacl => $scheduleacl, | ||
poolacl => $poolacl, | ||
filesetacl => $filesetacl, | ||
catalogacl => $catalogacl, | ||
} | ||
|
||
concat::fragment { "bacula-director-console-${name}": | ||
target => "${conf_dir}/conf.d/console.conf", | ||
content => epp('bacula/bacula-dir-console.epp', $epp_console_variables), | ||
} | ||
} |
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,42 @@ | ||
<% | ||
| | ||
String $name, | ||
String $password, | ||
String $catalogacl, | ||
Array $commandacl, | ||
Optional[String] $jobacl, | ||
Optional[String] $clientacl, | ||
Optional[String] $storageacl, | ||
Optional[String] $scheduleacl, | ||
Optional[String] $poolacl, | ||
Optional[String] $filesetacl, | ||
Optional[String] $whereacl, | ||
| | ||
-%> | ||
Console { | ||
Name = <%= $name %> | ||
Password = "<%= $password %>" | ||
<% if $jobacl { -%> | ||
JobACL = <%= $jobacl %> | ||
<% } -%> | ||
<% if $clientacl { -%> | ||
ClientACL = <%= $clientacl %> | ||
<% } -%> | ||
<% if $storageacl { -%> | ||
StorageACL = <%= $storageacl %> | ||
<% } -%> | ||
<% if $scheduleacl { -%> | ||
ScheduleACL = <%= $scheduleacl %> | ||
<% } -%> | ||
<% if $poolacl { -%> | ||
PoolACL = <%= $poolacl %> | ||
<% } -%> | ||
<% if $filesetacl { -%> | ||
FileSetACL = <%= $filesetacl %> | ||
<% } -%> | ||
CatalogACL = <%= $catalogacl %> | ||
CommandACL = <%= $commandacl.join(', ') %> | ||
<% if $whereacl { -%> | ||
WhereACL = <%= $whereacl %> | ||
<% } -%> | ||
} |
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