I have this strange problem where I just upgraded from puppetserver 5.5 to 
6, and now the 2nd environment doesn't see hiera values, but the production 
environment does.  I wonder if top level lookups don't work anymore?  
Here's how I have it configured:


Here's my directory layout:

code
└── environments
    ├── preprod
    │   ├── environment.conf
    │   ├── gitclone
    │   │   └── production
    │   │       ├── hieradata
    │   │       │   ├── common.yaml
    │   │       │   └── nodes
    │   │       ├── manifests
    │   │       │   ├── nodes.pp
    │   │       │   └── site.pp
    │   │       └── modules
    └── production
        ├── hieradata
        │   ├── common.yaml
        │   └── nodes
        ├── manifests
        │   ├── nodes.pp
        │   └── site.pp
        └── modules






/etc/puppetlabs/puppet:

$ cat hiera.yaml 
---
version: 5
defaults:
  # The default value for "datadir" is "data" under the same directory as 
the hiera.yaml
  # file (this file)
  # When specifying a datadir, make sure the directory exists.
  # See https://puppet.com/docs/puppet/latest/environments_about.html for 
further details on environments.
  # datadir: data
  # data_hash: yaml_data

  datadir: "/etc/puppetlabs/code/environments/%{::environment}/hieradata"
  data_hash: yaml_data


hierarchy:
  - name: "Per-node data (yaml version)"
    path: "nodes/%{::trusted.certname}.yaml"
  - name: "Other YAML hierarchy levels"
    paths:
      - "common.yaml"





/etc/puppetlabs/code/environments/preprod:


$ ls -la
total 4
drwxr-xr-x  3 root root  62 Jun  8 21:44 ./
drwxr-xr-x. 4 root root  39 Jun  8 14:33 ../
-rw-r--r--  1 root root 142 Jun  8 14:38 environment.conf
drwxr-xr-x  3 root root  24 Jun  8 14:36 gitclone/
lrwxrwxrwx  1 root root  29 Jun  8 21:44 hierdata -> 
gitclone/production/hieradata/





$ cat environment.conf 
manifest = $codedir/environments/preprod/gitclone/production/manifests
modulepath = $codedir/environments/preprod/gitclone/production/modules





 
$ cat hierdata/common.yaml 
---
infraserver:             'bigmachine.local'




$ cat site.pp 

$infraserver          = hiera( 'infraserver' )




But the clients don't see it in preprod, failing their puppet runs, and the 
codebase is exactly the same:

Error 500 on SERVER: Server Error: Function lookup() did not find a value 
for the name 'infraserver' on node dev1.local


$ puppet lookup infraserver --environment production --node dev1.local
--- bigmachine.local
 
$ puppet lookup infraserver --environment preprod --node dev1.local


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a0655c3e-9b5e-4097-a793-60f3117df82do%40googlegroups.com.

Reply via email to