Ask Your Question
1

Hiera lookup troubles

asked 2013-09-12 10:42:26 -0500

PorkCharSui gravatar image

I want to have a hiera file in which I maintain a list of possible mount points with there attributes, options and a list of hostnames on which they should get mounted. My yaml looks like this:

mounts.yaml

---
mounts:
  home:
    ensure: mounted
    atboot: yes
    device: /some/dev/  
    mountpoint: /home
    fstype: nfs4
    options: 
      - sec=krb5i
      - rsize=32768
      - wsize=32768
      - clientaddr=123.456.789.012
    dump: 0
    pass: 0
    hosts:
      - some.hostname
      - another.hostname

I shoot the yaml data into the class like this:

nodes.pp

node 'somenode' {
  include stdlib
  class { 'mounts':
    mounts_hash => hiera_hash('mounts'),
  } 
}

My module manifest looks like this ... (more)

edit retag flag offensive close merge delete

Comments

Possibly not related, but I wonder about mounting /some/dev as NFS4.

Rob Ogilvie gravatar imageRob Ogilvie ( 2013-09-12 11:47:06 -0500 )edit

I just entered something, because it isn't relevant. It's actually more like hostname:/mount

PorkCharSui gravatar imagePorkCharSui ( 2013-09-13 03:41:37 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-09-13 03:41:30 -0500

andreas gravatar image

updated 2013-09-13 03:42:03 -0500

I could reproduce the behaviour that mount only uses the first option of the array. Passing a string to the options attribute works as expected. In your hiera file, that would be:

options: "sec=krb5i,rsize=32768,wsize=32768,clientaddr=123.456.789.012"
edit flag offensive delete link more

Comments

Thanks Andreas for your reply. That would solve this problem indeed. Yet I still would like to know why it doesn't work the other way. I'm trying to ...(more)

PorkCharSui gravatar imagePorkCharSui ( 2013-09-13 04:15:36 -0500 )edit

I think it's not hiera but the mount type. Its options attribute is handled as a scalar, not as an array (but I'm just guessing, I don't ...(more)

andreas gravatar imageandreas ( 2013-09-13 04:28:34 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2013-09-12 10:42:26 -0500

Seen: 127 times

Last updated: Sep 13 '13