This message was deleted.
# puppet
s
This message was deleted.
b
Hiera is fully parsed on the puppetserver. It doesn't matter what the OS of the agent is
can you share an explicit example that fails?
d
I will check for any errors, but I don't think we got any, I believe the variable values just remain empty. Let me confirm.
b
which variable?
m
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Class[Wincognos]: expects a value for parameter 'hostname' expects a value for parameter 'dispatcher_domain' expects a value for parameter 'content_hostname' expects a value for parameter 'groupname' expects a value for parameter 'database' expects a value for parameter 'database_user' expects a value for parameter 'database_password' expects a value for parameter 'efs_suffix' expects a value for parameter 'cogstartup_xml' expects a value for parameter 'environment' (file: /etc/puppetlabs/code/environments/development/modules/profiles/manifests/wincognos.pp, line: 4, column: 3) on node w01.dev1.***.com Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run
b
ah it's not finding the value in hiera
you can use
puppet lookup...
on the puppetserver to debug where it's looking for the data
m
ok let me explore that thanks for the suggestion.
b
did you set those parameters in hiera?
m
yes we did
b
okay. sounds like it's in the wrong file
m
Copy code
this is init.pp manifest
class wincognos (
  #String           $hostname                 = 'xxx',
  #String           $dispatcher_domain        = 'xxx',
  #String           $content_hostname         = 'xxx',
  #String           $groupname                = 'xxx',         
  #String           $database                 = 'xxx',
  #String           $database_user            = 'xxx',
  #String           $database_password        = 'xxx',
  #String           $efs_suffix               = 'xxx',
  #String           $cogstartup_xml           = 'xxx',
  #String           $environment              = 'dev',
  #String           $version                  = $trusted['extensions']['pp_software_version'],
  String           $hostname,
  String           $dispatcher_domain,
  String           $content_hostname,
  String           $groupname,  
  String           $database,
  String           $database_user,
  String           $database_password,
  String           $efs_suffix,
  String           $cogstartup_xml,
  String           $environment,
  String           $version                  = $trusted['extensions']['pp_software_version'],
) {

  if ( $facts['datacenter'] == 'aws' ) {
    case $trusted['extensions']['pp_role'] {
      'Dispatcher': {
        include wincognos::dispatcher::config
      }
      default: {
        fail('No valid Role tag value found, aborting component specific installation')
      }
    }
  }
}

this is config.pp manifest

class wincognos::dispatcher::config (
  String $cogstartup_xml        = $wincognos::cogstartup_xml,
  String $hostname              = $wincognos::hostname,
  String $dispatcher_domain     = $wincognos::dispatcher_domain,
  String $content_hostname      = $wincognos::content_hostname,
  String $groupname             = $wincognos::groupname,
  String $database              = $wincognos::database,
  String $database_user         = $wincognos::database_user,
  String $database_password     = $wincognos::database_password,
  String $version               = $wincognos::version,
  String $efs_suffix            = $wincognos::efs_suffix,
) {

}
Copy code
This is hiera values yaml file

---
wincognos::gw_cert_prefix:       'xxx'
wincognos::efs_suffix:           'xxx'
wincognos::hosted_zone_suffix:   'xxx'
wincognos::dispatcher_domain:    'xxx'
wincognos::gw_elb_cname:         'xxx'
wincognos::database:             'xxx'
wincognos::cogstartup_xml:       'xxx'
wincognos::hostname:             'xxx'
wincognos::content_hostname:     'xxx'
wincognos::groupname:            'xxx'
puppet node able to retrieve the values when we hard code variable values in init.pp but not from hiera
b
yeah check with puppet lookup which hiera files are used
m
i tried this command on puppet master but it didn't list anything
puppet lookup --node <http://w01.dev1.xxx.com|w01.dev1.xxx.com> keyname
b
check the help
m
i repalced keyname with one of variable name
b
you probably want
--explain
and
--compile
and if the node isn't running in production, provide the environment as well
m
ok now it gave me below output
Copy code
Warning: Defining "data_provider": "hiera" in metadata.json is deprecated. It is ignored since a 'hiera.yaml' with version >= 5 is present
   (file: /etc/puppetlabs/code/environments/development/modules/wincognos/metadata.json)
Warning: /etc/puppetlabs/code/environments/development/modules/wincognos/data/common.yaml: file does not contain a valid yaml hash
Error: Could not run: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Class[Wincognos]:
  expects a value for parameter 'hostname'
  expects a value for parameter 'dispatcher_domain'
  expects a value for parameter 'content_hostname'
  expects a value for parameter 'groupname'
  expects a value for parameter 'database'
  expects a value for parameter 'database_user'
  expects a value for parameter 'database_password'
  expects a value for parameter 'efs_suffix'
  expects a value for parameter 'cogstartup_xml'
  expects a value for parameter 'environment' (file: /etc/puppetlabs/code/environments/development/modules/profiles/manifests/wincognos.pp, line: 4, column: 3)
b
ah it fails to compile because the data cannot be found. try without
--compile
m
ok
Copy code
Searching for "lookup_options"
  Global Data Provider (hiera configuration version 5)
    Using configuration "/etc/puppetlabs/puppet/hiera.yaml"
    Hierarchy entry "Classifier Configuration Data"
      No such key: "lookup_options"
  Environment Data Provider (hiera configuration version 5)
    Using configuration "/etc/puppetlabs/code/environments/development/hiera.yaml"
    Hierarchy entry "Eyaml Hierarchy"
      Merge strategy hash
        Path "/etc/puppetlabs/code/environments/development/data/nodes/.yaml"
          Original path: "nodes/%{trusted.certname}.yaml"
          Path not found
        Path "/etc/puppetlabs/code/environments/development/data/environment/development.yaml"
          Original path: "environment/%{environment}.yaml"
          No such key: "lookup_options"
        Path "/etc/puppetlabs/code/environments/development/data/teamdata/data_/development///.yaml"
          Original path: "teamdata/data_%{trusted.extensions.pp_application}/%{environment}/%{trusted.extensions.pp_software_version}/%{trusted.extensions.pp_role}/%{trusted.extensions.pp_cluster}.yaml"
          Path not found
        Path "/etc/puppetlabs/code/environments/development/data/teamdata/data_/development///.yaml"
          Original path: "teamdata/data_%{trusted.extensions.pp_application}/%{environment}/%{trusted.extensions.pp_software_version}/%{trusted.extensions.pp_role}/%{trusted.extensions.pp_role}.yaml"
          Path not found
        Path "/etc/puppetlabs/code/environments/development/data/teamdata/data_/development//.yaml"
          Original path: "teamdata/data_%{trusted.extensions.pp_application}/%{environment}/%{trusted.extensions.pp_software_version}/%{trusted.extensions.pp_cluster}.yaml"
          Path not found
        Path "/etc/puppetlabs/code/environments/development/data/teamdata/data_/development//.yaml"
          Original path: "teamdata/data_%{trusted.extensions.pp_application}/%{environment}/%{trusted.extensions.pp_software_version}/%{trusted.extensions.pp_software_version}.yaml"
          Path not found
        Path "/etc/puppetlabs/code/environments/development/data/teamdata/data_/development/development.yaml"
          Original path: "teamdata/data_%{trusted.extensions.pp_application}/%{environment}/%{environment}.yaml"
          Path not found
        Path "/etc/puppetlabs/code/environments/development/data/teamdata/data_/teamdata.yaml"
          Original path: "teamdata/data_%{trusted.extensions.pp_application}/teamdata.yaml"
          Path not found
        Path "/etc/puppetlabs/code/environments/development/data/common.yaml"
          Original path: "common.yaml"
          No such key: "lookup_options"
Searching for "groupname"
  Global Data Provider (hiera configuration version 5)
    Using configuration "/etc/puppetlabs/puppet/hiera.yaml"
    Hierarchy entry "Classifier Configuration Data"
      No such key: "groupname"
  Environment Data Provider (hiera configuration version 5)
    Using configuration "/etc/puppetlabs/code/environments/development/hiera.yaml"
    Hierarchy entry "Eyaml Hierarchy"
      Path "/etc/puppetlabs/code/environments/development/data/nodes/.yaml"
        Original path: "nodes/%{trusted.certname}.yaml"
        Path not found
      Path "/etc/puppetlabs/code/environments/development/data/environment/development.yaml"
        Original path: "environment/%{environment}.yaml"
        No such key: "groupname"
      Path "/etc/puppetlabs/code/environments/development/data/teamdata/data_/development///.yaml"
        Original path: "teamdata/data_%{trusted.extensions.pp_application}/%{environment}/%{trusted.extensions.pp_software_version}/%{trusted.extensions.pp_role}/%{trusted.extensions.pp_cluster}.yaml"
        Path not found
      Path "/etc/puppetlabs/code/environments/development/data/teamdata/data_/development///.yaml"
        Original path: "teamdata/data_%{trusted.extensions.pp_application}/%{environment}/%{trusted.extensions.pp_software_version}/%{trusted.extensions.pp_role}/%{trusted.extensions.pp_role}.yaml"
        Path not found
      Path "/etc/puppetlabs/code/environments/development/data/teamdata/data_/development//.yaml"
        Original path: "teamdata/data_%{trusted.extensions.pp_application}/%{environment}/%{trusted.extensions.pp_software_version}/%{trusted.extensions.pp_cluster}.yaml"
        Path not found
      Path "/etc/puppetlabs/code/environments/development/data/teamdata/data_/development//.yaml"
        Original path: "teamdata/data_%{trusted.extensions.pp_application}/%{environment}/%{trusted.extensions.pp_software_version}/%{trusted.extensions.pp_software_version}.yaml"
        Path not found
      Path "/etc/puppetlabs/code/environments/development/data/teamdata/data_/development/development.yaml"
        Original path: "teamdata/data_%{trusted.extensions.pp_application}/%{environment}/%{environment}.yaml"
        Path not found
      Path "/etc/puppetlabs/code/environments/development/data/teamdata/data_/teamdata.yaml"
        Original path: "teamdata/data_%{trusted.extensions.pp_application}/teamdata.yaml"
        Path not found
      Path "/etc/puppetlabs/code/environments/development/data/common.yaml"
        Original path: "common.yaml"
        No such key: "groupname"
Function lookup() did not find a value for the name 'groupname'
b
is your data in one of the paths that use the trusted hash and your windows cert doesn't have the correct data?
m
not sure we will explore that and will update here. Thankyou for the quick responses.
👍 1
Hi Tim- Thankyou for your troubleshooting guidance. It helped us to figure out the issue and now puppet windows manifest are parsing values from hiera correctly. We've defined hiera repo in puppet control and that name is not matching with the facts we defined. It worked after fixing that facts value.
👍 1
b
nice, sounds good
thankyou 1