我在Centos 7.2上使用带有Puppet Master的WSUS模块。 我的Puppet Agent服务器正在运行Windows Server 2012。
我想用一个variables的清单。 但是,当Puppet Agent服务器运行puppet代理时,它将显示“错误400,语法错误”。 我试图重写清单和每个我能想到的变化。 我不断收到一些错误。
这是一个清单的一个例子:
class excellent { class { 'wsus_client': $cool = 'Saturday' server_url => 'http://acme.com', auto_update_option => 'Scheduled' scheduled_install_day => $cool, scheduled_install_hour => 1, } }
我试过在花括号{}中分配variables。 我试着用$ LOAD_PATH,–custom-dir和FACTERLIB。 但我不知道如何使用这三个中的任何一个。
我想在一个地方更改variables,并在其父类的范围内使用它。 我该怎么办?
你试过这种方法吗?
class excellent { $cool = 'Saturday' class { 'wsus_client': server_url => 'http://acme.com', auto_update_option => 'Scheduled' scheduled_install_day => $cool, scheduled_install_hour => 1, } }
或者,这样
class excellent ( $cool = 'Saturday' ){ class { 'wsus_client': server_url => 'http://acme.com', auto_update_option => 'Scheduled' scheduled_install_day => $cool, scheduled_install_hour => 1, } }
您目前似乎正试图为类声明中的variables赋值。 您的variables分配需要分开。
$cool = 'Saturday'
你的类声明应该像这样。
class {'namevar': a => 'a', b => 'b', c => 'c' }