multiple possible mount devices

asked 2014-05-20 09:35:44 -0600

banjer gravatar image

So I have two NFS servers my clients mount from. Some Linux clients (CentOS 6) have a share on NFS server fs01 and some have it on fs02. I could add a class parameter and set the device string per host, but I'm wondering if there is a better mechanism, e.g. passing an array of possible mount device strings:

mount { "/usr/local":
  device => ["fs01:/vol/usrlocal/${hostname}","fs02:/vol/usrlocal/${hostname}",]
  fstype  => "nfs",
  ensure  => "mounted",
  atboot  => true,
}

I was hoping it would try the first one and then fail over to the next in the array, but no luck. I just get

Could not evaluate: Execution of '/bin/mount /usr/local' returned 32: mount.nfs: access denied by server while mounting fs01:/vol/usrlocal/testhost01.

Any ideas on how to approach this?

edit retag flag offensive close merge delete

Comments

So manual mounting works, doesn't it?

Kai Burghardt gravatar imageKai Burghardt ( 2015-04-03 18:49:31 -0600 )edit