У меня проблема с модулем Puppet, который я создаю. Этот модуль не извлекает значение переменных, включенных в мой файл YAML.
Кажется, проблема в том, что он не читает файл params.pp в любом случае ...
Они расположены в правильных каталогах, совпадая с тем, что в имени переменной.
Можете ли вы иметь какие-либо идеи?
Мой класс :
class bluesky::components::webapp::offerimport (
$temp_path = undef,
$rejects_path = undef,
$logs_path = undef,
$done_path = undef,
$app_name = undef,
$app_version = undef,
$pkg_prefix = undef,
$archiver = undef,
$pkg_repos = undef,
$interface_input_path = undef,
) inherits bluesky::components::webapp::offerimport::params {
$tmp_dir = "D:\\Temp\\${app_name}_${app_version}"
$install_dir = "D:\\BSIC\\${pkg_prefix}${app_version}"
$pkg = "${pkg_repos}\\CoreLibScripts\\${app_name}_${app_version}.zip"
$inner_zip = "$tmp_dir\\${app_name}.zip"
$output_inner_zip = "$tmp_dir\\Cab"
bluesky::resources::extract { "Extract ${app_name}":
pkg => $pkg,
archiver => $archiver,
output => $tmp_dir,
}
-> bluesky::resources::extract { "Extract InnerZIP ${app_name}":
pkg => $inner_zip,
archiver => $archiver,
output => $output_inner_zip,
}
-> bluesky::resources::copydir { "Copy ${app_name}":
source => $output_inner_zip,
target => $install_dir,
}
-> class {'bluesky::components::webapp::offerimport::configtemplates':
install_dir => $install_dir
}
-> file {["D:\Interface","D:\Interface\OfferImport","D:\BSIC_DATA\OfferImport"]:
ensure => directory
}
-> file {["${interface_input_path}",
"${temp_path}",
"${rejects_path}",
"${logs_path}",
"${done_path}",]:
ensure => directory
}
}
My Params.pp:
class bluesky::components::webapp::offerimport::params (
String $interface_input_path = undef,
String $temp_path = undef,
String $rejects_path = undef,
String $logs_path = undef,
String $done_path = undef,
String $output_path = undef,
String $om_servername = undef,
String $om_dbname = undef,
String $om_login = undef,
String $om_pwd = undef,
String $name_cfg_ptnametopitype = undef,
String $name_cfg_pttors = undef,
String $name_cfg_suppponametotype = undef,
String $mn_schema_file = undef,
String $name_pivot_tmp = undef,
String $name_rejects_nopitype = undef,
String $name_rejects_norstype = undef,
String $name_rejects_piwithoutrs = undef,
String $name_rejects_powithoutpi = undef,
String $name_rejects_rswithoutre = undef,
String $name_warning_productoffering = undef,
String $mn_helper_dll = undef,
String $archiver = lookup('bluesky::params::global::archiver'),
String $pkg_repos = lookup('bluesky::params::global::pkg_repos'),
) inherits bluesky::resources::webapp::params {
}
My ConfigTemplates.pp:
class bluesky::components::webapp::offerimport::configtemplates(
# $title = undef,
$install_dir = undef,
) inherits bluesky::components::webapp::offerimport::params {
file { "${title} Parameters.ini":
ensure => 'file',
path => "${install_dir}\\Config\\Parameters.ini",
content => template('bluesky/offerimport/config/Parameters.ini.erb'),
}
}
Мой YAML
bluesky::components::webapp::offerimport::app_name: OfferImport
bluesky::components::webapp::offerimport::pkg_prefix: OfferImport\OfferImport_
bluesky::components::webapp::offerimport::signal_file: BlueSky.BSIC.DA.UI.dll
bluesky::components::webapp::offerimport::configfolder: config
##
bluesky::components::webapp::offerimport::params::interface_input_path: D:\Interface\OfferImport\Input
bluesky::components::webapp::offerimport::params::temp_path: D:\BSIC_DATA\OfferImport\Temp
bluesky::components::webapp::offerimport::params::rejects_path: D:\BSIC_DATA\OfferImport\Rejects
bluesky::components::webapp::offerimport::params::logs_path: D:\BSIC_DATA\OfferImport\Logs
bluesky::components::webapp::offerimport::params::done_path: D:\BSIC_DATA\OfferImport\Done
bluesky::components::webapp::offerimport::params::output_path: D:\BSIC_DATA\OfferImport\Output
bluesky::components::webapp::offerimport::params::om_servername: Servername
bluesky::components::webapp::offerimport::params::om_dbname: DatabaseName
bluesky::components::webapp::offerimport::params::om_login: DatabaseLogin
bluesky::components::webapp::offerimport::params::om_pwd: DatabasePassword
bluesky::components::webapp::offerimport::params::name_cfg_ptnametopitype: PTNameToPIType.csv
bluesky::components::webapp::offerimport::params::name_cfg_pttors: PTtoREandRS.csv
bluesky::components::webapp::offerimport::params::name_cfg_suppponametotype: SuppPONameToType.csv
bluesky::components::webapp::offerimport::params::mn_schema_file: ProductCatalogtoBIver7.6.0.xsd
bluesky::components::webapp::offerimport::params::name_pivot_tmp: OFFER_IMPORT_PIVOT_TMP.csv
bluesky::components::webapp::offerimport::params::name_rejects_nopitype: OFFER_IMPORT_REJECTS_NoPIType.csv
bluesky::components::webapp::offerimport::params::name_rejects_norstype: OFFER_IMPORT_REJECTS_NoRSorREType.csv
bluesky::components::webapp::offerimport::params::name_rejects_piwithoutrs: OFFER_IMPORT_REJECTS_PIWithoutRS.csv
bluesky::components::webapp::offerimport::params::name_rejects_powithoutpi: OFFER_IMPORT_REJECTS_POWithoutPI.csv
bluesky::components::webapp::offerimport::params::name_rejects_rswithoutre: OFFER_IMPORT_REJECTS_RSWithoutRE.csv
bluesky::components::webapp::offerimport::params::name_warning_productoffering OFFER_IMPORT_ProductOffering_Warning.csv
bluesky::components::webapp::offerimport::params::mn_helper_dll: BlueSky.BSIC.Com.MetraNet.dll
My hiera.yaml :
hierarchy:
- name: "Per-node data"
path: "nodes/%{trusted.certname}.yaml"
- name: Common
path: common.yaml
- name: OfferImport
path: offerimport.yaml
defaults:
data_hash: yaml_data
datadir: data
Спасибо!