Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gameforce opened this issue Dec 13, 2017 · 0 comments

Comments

@gameforce
Copy link

gameforce commented Dec 13, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant