This message was deleted.
# puppet-enterprise
s
This message was deleted.
b
there was this bug fixed Puppet 7.15 / 6.27 https://tickets.puppetlabs.com/browse/PUP-11437 . I was told that with the new versions the resolution will work, but that's not the case
aha!
I was stupid and my testenv was broken. it indeed works in PE 2019.8.9, but not in 2019.8.10 and newer
s
We're PE 2019.0 (project to upgrade in progress) and it definitely doesn't work
c
@josh
b
josh is on vacation I heard 😞
c
@bastelfreak i can confirm that I can't get the variable to work on my env in 2019.8.9 ... i added tier to PE Masters group as variable... with value of foo
trying to do puppet lookup doesn't work
how can I test this?
b
it's important to add --compile to the lookup
c
Copy code
puppet lookup tier --explain --compile --node MASTER_FQDN
no dice
s
Yeah, at least on 2019.0,
--compile
doesn't change the behavior.
b
can you add the variable to an environment group? I only tested it with them. maybe that makes a difference
c
ok checking
b
too bad I deleted my test env an hour ago 😄
I added the variable
testvar
with value
testvalue
to the production environment group and used this hiera:
Copy code
version: 5
defaults:  
  datadir: data         
  data_hash: yaml_data

hierarchy:
    path: "foo/%{::testvar}.yaml"
and this `foo/testvalue.yaml`:
Copy code
---
hello: "it works!"
doing
puppet lookup --compile --environment foo --explain --node some.node hello
returns
it works!
on PE 2019.8.9, but not on newer versions
c
ok maybe I need the
--environment
b
maybe the node also requires one run in that environment where the code it
c
so in that env group... i have ap_env and role set ... i added tier to that... what's weird is if you do the explain the hiera hierarchy doesn't resolve the ap_env and role facts either... but still no dice on tier:
Copy code
Searching for "tier"
  Global Data Provider (hiera configuration version 5)
    Using configuration "/etc/puppetlabs/puppet/hiera.yaml"
    Hierarchy entry "Classifier Configuration Data"
      No such key: "tier"
  Environment Data Provider (hiera configuration version 5)
    Using configuration "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/hiera.yaml"
    Hierarchy entry "defaults"
      Path "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/data/role///.yaml"
        Original path: "role/%{facts.role}/%{facts.ap_env}/%{facts.ap_region}.yaml"
        Path not found
      Path "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/data/role/all_in_one/prod/.yaml"
        Original path: "role/%{trusted.extensions.pp_role}/%{trusted.extensions.pp_apptier}/%{trusted.extensions.pp_region}.yaml"
        Path not found
      Path "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/data/role//.yaml"
        Original path: "role/%{facts.role}/%{facts.ap_env}.yaml"
        Path not found
      Path "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/data/role/all_in_one/prod.yaml"
        Original path: "role/%{trusted.extensions.pp_role}/%{trusted.extensions.pp_apptier}.yaml"
        Path not found
      Path "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/data/role/.yaml"
        Original path: "role/%{facts.role}.yaml"
        Path not found
      Path "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/data/role/all_in_one.yaml"
        Original path: "role/%{trusted.extensions.pp_role}.yaml"
        No such key: "tier"
      Path "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/data/common.yaml"
        Original path: "common.yaml"
        No such key: "tier"
    Hierarchy entry "eyaml defaults"
      Path "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/data/role///.eyaml"
        Original path: "role/%{facts.role}/%{facts.ap_env}/%{facts.ap_region}.eyaml"
        Path not found
      Path "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/data/role/all_in_one/prod/.eyaml"
        Original path: "role/%{trusted.extensions.pp_role}/%{trusted.extensions.pp_apptier}/%{trusted.extensions.pp_region}.eyaml"
        Path not found
      Path "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/data/role//.eyaml"
        Original path: "role/%{facts.role}/%{facts.ap_env}.eyaml"
        Path not found
      Path "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/data/role/all_in_one/prod.eyaml"
        Original path: "role/%{trusted.extensions.pp_role}/%{trusted.extensions.pp_apptier}.eyaml"
        Path not found
      Path "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/data/role/.eyaml"
        Original path: "role/%{facts.role}.eyaml"
        Path not found
      Path "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/data/role/all_in_one.eyaml"
        Original path: "role/%{trusted.extensions.pp_role}.eyaml"
        No such key: "tier"
      Path "/opt/puppetlabs/server/data/puppetserver/filesync/client/versioned-dirs/puppet-code/main_2ad02e4bf1b0a8ad73616e899a49876213c2945c/data/common.eyaml"
        Original path: "common.eyaml"
        No such key: "tier"
Function lookup() did not find a value for the name 'tier'
not sure what you mean in the env where code is? I'm not doing any code changes just a lookup to confirm it works on 2019.8.9 and can't get it to work
weren't top scope vars deprecated? maybe they aren't allowed anymore in 2019?
b
I'm not trying to do a lookup on a topscope variable, I'm using top scope variabes in paths in the hiera.yaml
s
At least for us, we're setting these variables at node-scope, not global
c
if
tier
is set in NodeGroup its a TL right? Maybe it works during a hiera lookup but not a
puppet lookup
?
That's probably more of a @helindbe question
b
while that's interesting, I don't think that's my problem. I'm only looking up actual hiera keys in yaml file. but the paths to those files are constructed by top scope variables from node environment groups
see the yaml I posted above, I'm doing a lookup for the key
hello
, which is in
"foo/%{::testvar}.yaml"
. and
testvar
is set in a node environment group
c
gotcha... but you see from my explain that my hierarchy of role and ap_env it can't find which are top-level set in node env group.. so while tier might not be in any of my yaml's its not resolving those paths via the top-level
granted they are written now as facts.ap_env and facts.role now... I removed the
::role
and
::ap_env
a while back due to what I thought was deprecation
but you'd think the beginning part of the lookup showing
Copy code
Searching for "tier"
  Global Data Provider (hiera configuration version 5)
    Using configuration "/etc/puppetlabs/puppet/hiera.yaml"
    Hierarchy entry "Classifier Configuration Data"
      No such key: "tier"
would get these from the variables specified in the Node Classifier
b
together with PE support we came up with a fix: https://tickets.puppetlabs.com/browse/PUP-11595