Ask Your Question
0

Facts not found from world.json

asked 2017-01-16 22:13:15 -0500

cm01 gravatar image

Hi Guys,

see files etc below, but basically it can't seem to see ANY vars in world.json... ?
(File shown is subset of the full thing)
Why?

Chris

puppet.conf

[master]
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
codedir = /etc/puppetlabs/code


ca = false
dns_alt_names = pm101.qa.x.x.x

reports = store, foreman
reportdir = $vardir/reports

[main]
server      = pm101.qa.x.x.x
ca_server   = pmca.ops.x.x.x
environment = qa2

hiera.yaml

---

:backends: 
  - json

:hierarchy: 
  - "%{hostname}.%{nt_environment}.%{nt_location}"
  - "%{nt_type}.%{nt_environment}.%{nt_location}"
  - "%{nt_type}.%{nt_environment}"
  - "%{nt_environment}.%{nt_location}"
  - "%{nt_environment}"
  - "%{nt_location}"
  - world
  - default

:logger: console # debug

:json:
    :datadir: '/etc/puppetlabs/code/environments/%{::environment}/hieradata' # this is the default anyway


/etc/puppetlabs/code/environments/qa2/hieradata<br/>

    -rw-rw-r-- 1 jenkins jenkins 2398 Jan 14 00:38 world.json
       "env" : {
                 "puppetusers" : [
             "jjenkins",
             "rob",
             "phil",
             "mark",
             "snowpaws",
             "djenkins",
             "ikrayn",
             "chris",
             "tay",
             "dave",
             "cpl"
          ],
       }

Info: Using configured environment 'qa2'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Failed to parse template common/etc/profile.d/tmx_profile.sh.erb:
  Filepath: /etc/puppetlabs/code/environments/qa2/modules/common/templates/etc/profile.d/tmx_profile.sh.erb
  Line: 25
  Detail: undefined method `[]' for nil:NilClass
 at /etc/puppetlabs/code/environments/qa2/manifests/modules/common/manifests/classes/configuration.pp:19:14 on node pm101.qa.sac.int.threatmetrix.com
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-01-17 09:23:14 -0500

DarylW gravatar image

updated 2017-01-17 09:24:07 -0500

Are you able to see the facts when running sudo facter -p, puppet facts --environment qa2, or directly in your puppet code (add a notice() or notify resource)? Generally, I always try to create localized variables that I used in my templates. If you look to using epp templates, you actually can declare parameters for your templates and have them explicitly passed in.

Can you show a snippet of the template where it is using your variable?

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: 2017-01-16 22:13:15 -0500

Seen: 32 times

Last updated: Jan 17