Puppet模块在'{'处获取语法错误;预期'}'

时间:2015-08-17 11:55:16

标签: linux puppet puppet-enterprise

我正在尝试实施此https://github.com/andytinycat/puppet-rhnsatellite。我已在module/rhnsatellite/manifest/init.pp

下配置了用户名和密码

class rhnsatellite( $server_url = "https://test.example.com/XMLRPC", $username = "testuserver", $password = "test@123" ) { file {'/etc/puppetlabs/puppet/rhn.conf': owner => root, group => root, mode => 0600, content => template('rhnsatellite/rhn.conf.erb') } }

我是木偶的新手,我不知道如何在site.pp中调用satelliterepo,我在客户端计算机上运行时出现语法错误 node 'client' { include vmware class { rhnsatellite : satelliterepo {channel => 'base-stash-el6', } include sudo include sssd include hardening include base-httpd include hpom class { sshd: } } 我在客户端运行时出现以下错误 [root@client puppet]# puppet agent --test --noop --environment=test Info: Retrieving plugin Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/tenant.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppet_vardir.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/windows.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/log_exists_jbossecaps.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/custom_auth_conf.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/concat_basedir.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/cluster.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/postgres_default_version.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/dtap.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppetdb_server_status.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/ip6tables_version.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/pe_version.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/root_home.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/log_exists_jbosshouse.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/iptables_persistent_version.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/gateway.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/iptables_version.rb Info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/facter_dot_d.rb Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not parse for environment test: Syntax error at '{'; expected '}' at /etc/puppetlabs/puppet/environments/test/manifests/site.pp:1157 on node client Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run [root@client puppet]#`

1 个答案:

答案 0 :(得分:1)

你不应该触摸module / rhnsatellite / manifest / init.pp。保持原样。 要覆盖rhnsatellite类的默认参数,请将它放在您的site.pp中,如下所示:

class { "rhnsatellite":
    server_url  => "https://test.example.com/XMLRPC",
    username => "testuserver",
    password => "test@123",
}

完全删除此部分:

class { rhnsatellite :
    satelliterepo {channel => 'base-stash-el6',
}