Ask Your Question
0

puppet compilation pointing incorrect site.pp

asked 2015-10-16 07:10:37 -0500

Chutki gravatar image

Hi,

I have site.pp under /etc/puppetlabs/puppet/environments/production/manifests/, created during the puppet 3.8 installation. But , I got few errors so created another site.pp under /etc/puppetlabs/puppet/manifests/ and removed the file /etc/puppetlabs/puppet/environments/production/manifests/site.pp

I am using hiera_include('classes') function to invoke classes. so created the hiera.yaml under /etc/puppetlabs/puppet/hiera.yaml and added classes in this file.

/etc/puppetlabs/puppet/hiera.yaml

---
:backends:
  - yaml
:hierarchy:
  - defaults
  - "%{clientcert}"
  - "%{environment}"
  - global
  - 'hieradata/common'
:yaml:
  :datadir: '/etc/puppetlabs/puppet'

below is common.yaml file under /etc/puppetlabs/puppet/hieradata

---
classes
  - example

but when I run "puppet agent -t", it's not picking the classes what I included in common.yaml. But didn't throw any error.

So again I created site.pp under etc/puppetlabs/puppet/environments/production/manifests/ and the compilation picked the classes from common.yaml

My doubts is, why site.pp not picked up my classes though the common.yaml present on the same directory /etc/puppetlabs/puppet

How manifests compiled with all classes when I added site.pp under /etc/puppetlabs/puppet/environments/production/manifests/ though the common.yaml present under diffrent directory.

below is /etc/puppetlabs/puppet/puppet.conf in master server

[main]
    certname = puppet.server.com
    vardir = /var/opt/lib/pe-puppet
    logdir = /var/log/pe-puppet
    rundir = /var/run/pe-puppet
    basemodulepath = /etc/puppetlabs/puppet/modules:/opt/puppet/share/puppet/modules
    environmentpath = /etc/puppetlabs/puppet/environments
    server = puppet.server.com
    user  = pe-puppet
    group = pe-puppet
    archive_files = true
    archive_file_server =puppet.server.com
    module_groups = base+pe_only
    future = parser
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-10-16 20:25:07 -0500

lupin gravatar image

updated 2015-10-17 12:10:01 -0500

It could be due to directory environment enabled. If you do a puppet config print | grep manifest you'll see the output. Here's the doc explaning of what it do.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-10-16 07:10:37 -0500

Seen: 58 times

Last updated: Oct 17 '15