![如果没有“sudo”,Puppet 代理将无法运行](https://linux22.com/image/704840/%E5%A6%82%E6%9E%9C%E6%B2%A1%E6%9C%89%E2%80%9Csudo%E2%80%9D%EF%BC%8CPuppet%20%E4%BB%A3%E7%90%86%E5%B0%86%E6%97%A0%E6%B3%95%E8%BF%90%E8%A1%8C.png)
我已经在 Ubuntu 14.04 系统上安装了 puppet。
当我使用时它工作正常:
sudo puppet agent -t
但:
puppet agent -t
返回:
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read finished A
Info: Retrieving pluginfacts
Error: /File[/home/rescue/.puppet/var/facts.d]: Failed to generate additional resources using 'eval_generate': SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read finished A
Error: /File[/home/rescue/.puppet/var/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet://puppet/pluginfacts: Connection reset by peer - SSL_connect
Info: Retrieving plugin
Error: /File[/home/rescue/.puppet/var/lib]: Failed to generate additional resources using 'eval_generate': SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read finished A
Error: /File[/home/rescue/.puppet/var/lib]: Could not evaluate: Could not retrieve file metadata for puppet://puppet/plugins: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read finished A
Info: Loading facts
Error: Could not retrieve catalog from remote server: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read finished A
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Error: Could not send report: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read finished A
我尝试让 Puppet 成为超级用户,sudo usermod -aG sudo puppet
但仍然得到相同的结果。
答案1
这个答案在某种程度上是一种解决方法。
我上面遇到的核心问题是,当 Puppet 每 30 分钟自动运行(检查 master)时,它总是会失败。
我停止了在 ubuntu 上运行的服务,而是使用service puppet start
了sudo service puppet start
。
答案2
据我所知,开源版的 puppet-agent 需要使用 root 权限运行。你可以在这里阅读更多内容(针对企业版): https://puppet.com/blog/new-support-for-non-root-agents-puppet-enterprise