简体   繁体   English

在人偶中设置人偶目录环境

[英]Setting up puppet directory environment in puppet

I am learning puppet but I stuck with one problem. 我正在学习木偶,但遇到一个问题。 I have a Puppet installation with one Puppet master and one Puppet agent, and I am using open source Puppet. 我有一个带有一个Puppet主服务器和一个Puppet代理的Puppet安装,并且我正在使用开源Puppet。 I to set up a environment named Test. 我建立一个名为Test的环境。 The directory is as follows /etc/puppet/environments/Test its having modules and manifests directories. 目录如下/etc/puppet/environments/Test其具有的modulesmanifests目录。 And environment.conf file. environment.conf文件。

My environment.conf contains the following line: 我的environment.conf包含以下行:

modulepath = $confdir/environments/production/modules

I created a module named sample inside the modules directory of the environment. 我在环境的modules目录中创建了一个名为samplemodules Described one class called sample inside the init.pp of the sample module's manifests directory. sample模块的manifests目录的init.pp中描述了一个称为sample类。 The class is used to install a small software. 该类用于安装小型软件。 In the the manifests directory of the environment Test I created a file site.pp which will implement the class sample defined inside the module. 在环境Test的manifests目录中,我创建了一个文件site.pp ,它将实现在模块内部定义的类sample

My puppet.conf contains this following lines: 我的puppet.conf包含以下几行:

[main] logdir=/var/log/puppet vardir=/var/lib/puppet ssldir=/var/lib/puppet/ssl rundir=/var/run/puppet factpath=$vardir/lib/facter prerun_command=/etc/puppet/etckeeper-commit-pre postrun_command=/etc/puppet/etckeeper-commit-post server=puppet.master

[master] ssl_client_header = SSL_CLIENT_S_DN ssl_client_verify_header = SSL_CLIENT_VERIFY

But whenever I tried to implement the manifests in the Puppet agent, It is using the default site.pp and not using the environments site.pp 但是,每当我尝试在Puppet代理中实现清单时,它都使用默认的site.pp ,而不使用环境site.pp

Can anyone tell me where I am doing the mistake. 谁能告诉我我在哪里做错了。

In puppet agent configuration (usually /etc/puppet/puppet.conf) set the environment var to Test as follows: 在人偶代理配置中(通常为/etc/puppet/puppet.conf),将环境var设置为Test,如下所示:

[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
prerun_command=/etc/puppet/etckeeper-commit-pre
postrun_command=/etc/puppet/etckeeper-commit-post
server=puppet.master

[agent]
pluginsync      = true
report          = true
ignoreschedules = true
daemon          = false
ca_server       = server fqdn
certname        = client fqdn (signed in the server)
server          = server fqdn
show_diff       = true
listen          = true
environment     = Test

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM