Passing argument to puppet using foreman smart class parameter

asked 2014-01-31 07:58:21 -0600

virtuose gravatar image

Hi,

I'm trying to pass a yaml structure to a puppet class using foreman and smart class parameter.

My Yaml structure is defined as follow:

dumpCfg: 
    oracle: 
        DB_USERNAME: toto
        DUMP_TYPE: full
    mysql: 
        DB_USERNAME=titi
        DUMP_TYPE=full

I have to generate each file for each technology:

dump_oracle
    DB_USERNAME=toto
    DUMP_TYPE=full
dump_mysql
    DB_USERNAME=titi
    DUMP_TYPE=full

The definition of my class:

class bacula_client (

$isDirector    = false,
$isHostConcentrator = false,
$dumpCfg = '',
$hasOracle     = false,
$hasLdap       = false,
$data          = '',
$hasMongo      = false,
$hasMysql      = false,
$size          = 'SMALL',
$fileset       = 'common',
$schedule      = '',
$backupCrons   = []
) inherits bacula_client::params {


define foo($DB_USERNAME, $DUMP_TYPE) { 
  notify { "$title: got $DB_USERNAME and $DUMP_TYPE": } 
}

create_resources(foo, $dumpCfg)
}

I ... (more)

edit retag flag offensive close merge delete