-2

我正在尝试实现这个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') } }

我是 puppet 的新手,我不知道如何在 site.pp 中调用卫星存储库,当我在客户端机器上运行它时出现语法错误当我在客户端 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]#`

4

1 回答 1

1

你不应该接触模块/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',
}
于 2015-08-24T16:15:21.280 回答