0

我正在尝试使用工头和智能类参数将 yaml 结构传递给 puppet 类。

我的 Yaml 结构定义如下:

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

我必须为每种技术生成每个文件:

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

我的班级的定义:

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)
}

我不明白为什么这不起作用,也许我没有采取正确的方法(我必须在我的类中添加一个参数吗?)

先感谢您,

我正在使用木偶 2.7。

带工头的智能类参数

4

0 回答 0