我有一个简单的 Puppet 环境,刚开始有一个 master 和一个 agent。
当我puppet module list
从我的代理那里做时,我收到了以下错误。我运行puppet agent -t
它甚至不会访问我的 site.pp 和 test.pp。
我不确定我是否遗漏了 Puppet 配置中的任何内容。
puppet module list
/usr/lib/ruby/site_ruby/1.8/puppet/environments.rb:38:in `get!': Could not find a directory environment named 'test' anywhere in the path: /etc/puppet/environments. Does the directory exist? (Puppet::Environments::EnvironmentNotFound)
from /usr/lib/ruby/site_ruby/1.8/puppet/application.rb:365:in `run'
from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:146:in `run'
from /usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:92:in `execute'
from /usr/bin/puppet:8
这是我的木偶大师 puppet.conf
[main]
# The Puppet log directory.
# The default value is '$vardir/log'.
logdir = /var/log/puppet
# Where Puppet PID files are kept.
# The default value is '$vardir/run'.
rundir = /var/run/puppet
# Where SSL certificates are kept.
# The default value is '$confdir/ssl'.
ssldir = $vardir/ssl
dns_alt_names = cssdb-poc-01.cisco.com cssdb-poc-01
[master]
server = cssdb-poc-01.cisco.com
certname = cssdb-poc-01.cisco.com
dns_alt_names = cssdb-poc-01.cisco.com cssdb-poc-01
environmentpath = /etc/puppet/environments
environment = test
[agent]
# The file in which puppetd stores a list of the classes
# associated with the retrieved configuratiion. Can be loaded in
# the separate ``puppet`` executable using the ``--loadclasses``
# option.
# The default value is '$confdir/classes.txt'.
classfile = $vardir/classes.txt
# Where puppetd caches the local configuration. An
# extension indicating the cache format is added automatically.
# The default value is '$confdir/localconfig'.
localconfig = $vardir/localconfig
~
这是 puppet master 的目录结构。
[root@cssdb-poc-01 test]# tree /etc/puppet/environments/
/etc/puppet/environments/
├── example_env
│ ├── manifests
│ ├── modules
│ └── README.environment
├── production
└── test
├── environment.conf
├── manifests
│ └── site.pp
└── modules
└── cassandra
├── manifests
└── test.pp
这是我的木偶代理 puppet.conf
cat /etc/puppet/puppet.conf
[main]
# The Puppet log directory.
# The default value is '$vardir/log'.
logdir = /var/log/puppet
# Where Puppet PID files are kept.
# The default value is '$vardir/run'.
rundir = /var/run/puppet
# Where SSL certificates are kept.
# The default value is '$confdir/ssl'.
ssldir = $vardir/ssl
[main]
server=cssdb-poc-01.cisco.com
environmentpath = /etc/puppet/environments
environment = test
[agent]
# The file in which puppetd stores a list of the classes
# associated with the retrieved configuratiion. Can be loaded in
# the separate ``puppet`` executable using the ``--loadclasses``
# option.
# The default value is '$confdir/classes.txt'.
classfile = $vardir/classes.txt
# Where puppetd caches the local configuration. An
# extension indicating the cache format is added automatically.
# The default value is '$confdir/localconfig'.
localconfig = $vardir/localconfig