I'm trying to push parameters from foreman to my puppet class to generate configuration file.
Eeach file should be like this:
file1
DB_USERNAME=toto
DUMP_TYPE=full
[...]
file2
DB_USERNAME=toto
DUMP_TYPE=full
[...]
I define a parameter in Foreman which is an array of hashes
bacula_client dumpCfg [{"techno"=>"oracle", "DB_USERNAME"=>"toto", "DUMP_TYPE"=>"full", ...},
{"techno"=>"mysql", "DB_USERNAME"=>"toto", "DUMP_TYPE"=>"full", ...}]
I would like to know if it is possible to do something like that to generate for instance 2 different config files as I get a 'Ressource title must be a string' when calling dumpdb
class bacula_client (
$isDirector = false,
$backupCrons = [],
$isHostConcentrator = false,
$dumpCfg = [],
define bacula_client::dumpdb () {
$techno = $name['techno']
$dbusername = $name['DB_USERNAME']
$dumptype = $name['DUMP_TYPE']
# call a function that generates the files
}
[.....]
}#myclass
bacula_client::dumpdb{$dumpCfg:}
Thank you in advance,