我有我的木偶主服务器上的2个环境的文件结构。 在主服务器上运行ls /etc/puppetlabs/code/environments/返回两个文件夹beta和production 。
然而,当我去我的代理和运行puppet apply -t --environment beta我得到的错误:
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/environments.rb:38:in `get!': Could not find a directory environment named 'beta' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist? (Puppet::Environments::EnvironmentNotFound)
在主服务器上,我可以成功应用beta版清单,并使用puppet apply /etc/puppetlabs/code/environments/beta/manifests/site.pp 。
我想弄清楚为什么Puppet没有检测到文件夹。 我怎么去debugging呢?
我还尝试了puppet agent -t --environment betabuild议的puppet agent -t --environment beta ,它返回:
注意:本地环境:“beta”与服务器指定的节点环境“生产”不匹配,将代理切换到“生产”。
/etc/puppetlabs/puppet/puppet.conf (在代理上)如下:
# This file can be used to override the default puppet settings. # See the following links for more details on what settings are available: # - https://docs.puppetlabs.com/puppet/latest/reference/config_important_settings.html # - https://docs.puppetlabs.com/puppet/latest/reference/config_about_settings.html # - https://docs.puppetlabs.com/puppet/latest/reference/config_file_main.html # - https://docs.puppetlabs.com/puppet/latest/reference/configuration.html
使用开源版本。
使用puppet agent ... ,而不是puppet apply ... 你使用的参数适用于前者,而不是后者。