tips:检查puppet版本:
puppet --version
我安装的版本是3.7.4
最近因为安装了saltstack,不知道为什么salt执行命令很慢(CPU使用率高),又暂时找不到什么解决方案(怀疑是bug),于是滚回puppet的世界
参考了这篇资料,安装了puppet:
分别在master和agent上安装了puppetmaster和puppet(agent),但是默认的agent是不启用的,
so,编辑:/etc/default/puppet文件,把当中的START=no改为yes:
# Defaults for puppet - sourced by /etc/init.d/puppet# Enable puppet agent service?# Setting this to "yes" allows the puppet agent service to run.# Setting this to "no" keeps the puppet agent service from running.START=yes# Startup optionsDAEMON_OPTS=""
再执行:service puppet start即可
后来在agent或master上执行命令时都弹出以下警告:
root@workgroup1:~# puppet agent --server workgroup0.hzg.com --testWarning: Setting templatedir is deprecated. See http://links.puppetlabs.com/env-settings-deprecations (at /usr/lib/ruby/vendor_ruby/puppet/settings.rb:1139:in `issue_deprecation_warning')Info: Caching certificate for caInfo: csr_attributes file loading from /etc/puppet/csr_attributes.yamlInfo: Creating a new SSL certificate request for workgroup1.hzg.comInfo: Certificate Request fingerprint (SHA256): 58:F4:2B:86:1B:26:D8:CF:24:34:C3:5F:C5:C9:46:37:11:65:26:F1:72:C0:AC:E4:A9:C3:6A:BF:F4:70:26:E8Info: Caching certificate for caExiting; no certificate found and waitforcert is disabled
警告内容如下:
Warning: Setting templatedir is deprecated. See http://links.puppetlabs.com/env-settings-deprecations (at /usr/lib/ruby/vendor_ruby/puppet/settings.rb:1139:in `issue_deprecation_warning')
参考这里:
把/etc/puppet/puppet.conf文件中的:
# templatedir=$confdir/templates
注释掉即可。