无法运行 Puppet 设备(无法请求证书:无法写入……privatekeydir)

无法运行 Puppet 设备(无法请求证书:无法写入……privatekeydir)

我在 Centos 7 服务器上设置了 puppet 4.3。这是一个 puppet master,也运行着 puppet agent。我正尝试设置 Puppet Device 来配置路由器。当我尝试运行时,puppet device我看到了此错误:

sudo puppet device --verbose
Info: starting applying configuration to r1 at telnet://r1/
Info: Creating a new SSL key for r1
Error: Could not request certificate: Could not write /opt/puppetlabs/puppet/cache/devices/r1/ssl/private_keys/r1.pem to privatekeydir: Permission denied @ rb_sysopen - /opt/puppetlabs/puppet/cache/devices/r1/ssl/private_keys/r1.pem

当我运行 puppet device sans sudo 时,我看到此错误:

puppet device --verbose
Error: No device found in /home/<MEEEE>/.puppetlabs/etc/puppet/device.conf

这是我的 /etc/puppetlabs/puppet/device.conf

[r1]
type cisco
url telnet://puppet:123456@r1/

这是我的 /etc/puppetlabs/puppet/puppet.conf

[master]
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
codedir = /etc/puppetlabs/code
dns_alt_names = puppetmaster,puppet,puppet.applebank.ny.com,puppetmaster01

[agent]
server = puppetmaster

答案1

权限一定是出了问题。我运行了以下命令解决了该问题:

sudo chown -R puppet:puppet /opt/puppetlabs

相关内容