CERIT-SC / puppet-yum

Puppet module for Yum
MIT License
6 stars 116 forks source link

The first element of the merge has wrong type, expects a Hash value, got Tuple #22

Open gameforce opened 6 years ago

gameforce commented 6 years ago

Sorry for the newb question and its me doing something wrong here and hoping to get some help I am getting the error message when doing lookups trying to get the yum::managed_repos bits to work if I use merge => unique I get no errors but nothing applies

Here's my config files:

$ cat /etc/puppetlabs/code/environments/production/manifests/site.pp 
# Needed for hiera v5
# Merge several arrays of class names into one array:
# lookup('classes', {merge =>  'hash'})
# lookup('classes', { 'merge' => 'unique' })
hiera_include(classes)
lookup('classes', {merge =>  'hash'})
$ cat /etc/puppetlabs/code/environments/production/data/nodes/box53.stellarcreative.lab.yaml

---
  classes:
    - role::base
    - role::repo
    - yum

yum::managed_repos:
  - 'stellar'

yum::repos:
 stellar:
   ensure: 'present'
   enabled: true
   descr: 'Stellar Repo'
   baseurl: 'http://repo/stellar/x86_64/'
   gpgcheck: false
   gpgkey: ''
   target: '/etc/yum.repos.d/stellar.repo'
$ cat /etc/puppetlabs/code/environments/production/hiera.yaml 
---
version: 5
defaults:                          # Used for any hierarchy level that omits these keys.
  datadir: data                    # This path is relative to hiera.yaml's directory.
  data_hash: yaml_data             # Use the built-in YAML backend.

hierarchy:
  - name: "Nodes"                        # Human-readable name.
    #path: "nodes/%{facts.hostname}.yaml"     # File path, relative to datadir. IMPORTANT: include the file extension!
    path: "nodes/%{trusted.certname}.yaml"     # File path, relative to datadir. IMPORTANT: include the file extension!

  - name: "Common Data"
    path: "common.yaml"
$ puppet lookup classes --merge hash --environment production --explain
Searching for "classes"
  Merge strategy hash
    Global Data Provider (hiera configuration version 5)
      Using configuration "/etc/puppetlabs/puppet/hiera.yaml"
      Merge strategy hash
        Hierarchy entry "Nodes"
          Path "/etc/puppetlabs/puppet/data/nodes/kam1.yaml"
            Original path: "nodes/%{facts.hostname}.yaml"
            Path not found
        Hierarchy entry "Common"
          Path "/etc/puppetlabs/puppet/data/common.yaml"
            Original path: "common.yaml"
            Path not found
    Environment Data Provider (hiera configuration version 5)
      Using configuration "/etc/puppetlabs/code/environments/production/hiera.yaml"
      Merge strategy hash
        Hierarchy entry "Nodes"
          Path "/etc/puppetlabs/code/environments/production/data/nodes/kam1.stellarcreative.lab.yaml"
            Original path: "nodes/%{trusted.certname}.yaml"
            Found key: "classes" value: [
              "role::base",
              "role::puppet",
              "role::repo",
              "role::kickstart"
            ]
        Hierarchy entry "Common Data"
          Path "/etc/puppetlabs/code/environments/production/data/common.yaml"
            Original path: "common.yaml"
            Found key: "classes" value: [
              "role::base",
              "role::ssh"
            ]
The first element of the merge has wrong type, expects a Hash value, got Tuple

Thank you