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. I to set up a environment named Test. The directory is as follows /etc/puppet/environments/Test
its having modules
and manifests
directories. And environment.conf
file.
My environment.conf
contains the following line:
modulepath = $confdir/environments/production/modules
I created a module named sample
inside the modules
directory of the environment. Described one class called sample
inside the init.pp
of the sample
module's manifests
directory. 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.
My puppet.conf
contains this following lines:
[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
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:
[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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.