Linux

無法執行 puppet 設備(無法請求證書:無法寫入… privatekeydir)

  • April 24, 2017

我在 Centos 7 伺服器上設置了 puppet 4.3。這是一個同時執行 puppet 代理的 puppet master。我正在嘗試設置 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

不知何故,權限一定搞砸了。我執行了以下解決問題的方法:

sudo chown -R puppet:puppet /opt/puppetlabs

引用自:https://serverfault.com/questions/740683