Re: [Puppet Users] Mount NFS share defined in hiera

2023-02-24 Thread Laci D
Thank you!

My situation was a bit more complicated since needed support for two 
operating systems, the following implementation worked:

common.yaml
nfs_mounts: 
 device: 'nfs.server.com:/mount'
options: 
'nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport'


manifests/profiles/nfs_home.pp
class site::profiles::nfs_home {
 $nfs_mounts_hiera = hiera_hash('nfs_mounts')

   case $::operatingsystem {
   'ubuntu': {
  mount { "/nfs_mount":
   device  => $nfs_mounts_hiera['device'],
   fstype  => "nfs4",
   ensure  => "mounted",
   options => $nfs_mounts_hiera['options'],
   atboot  => true,
   }
   }
  'freebsd': {
   mounttab { "/nfs_mount":
   device  => $nfs_mounts_hiera['device'],
   fstype  => "nfs4",
   ensure  => "present",
   options => "rw",
   target => "/etc/fstab",
   }

   }
   }
   }

On Friday, February 24, 2023 at 6:31:03 AM UTC-5 Chris Ritson wrote:

> The code I have been given for an NFS mount is like this. Note the module 
> in use on the first line….
>
>  
>
> types::files:
>
>   # derdanne/nfs takes care of mountpoint creation.
>
>   '’:
>
> ensure: directory
>
> mode: '0775'
>
>  
>
> debconfs:
>
>   'apparmor/homedirs':
>
> ensure: present
>
> type: string
>
> value: 
>
> seen: 'true'
>
> notify: Exec[dr_apparmor]
>
>  
>
> nfs::client_enabled:  true
>
> nfs::manage_packages: true
>
> nfs::nfs_v4_client:   false
>
>  
>
> nfs_client_mounts:
>
>   :
>
> server: 
>
> share:  
>
>  
>
> --
>
> Chris Ritson (School of Computing)
>
> Newcastle University, NE1 7RU
>
> Tel: +44(0)1912080073 <+44%20191%20208%200073>
>
>  
>
> *From:* puppet...@googlegroups.com  
> *Sent:* 24 February 2023 11:13
> *To:* Digest recipients 
> *Subject:* [Puppet Users] Digest for puppet...@googlegroups.com - 1 
> update in 1 topic
>
>  
>
> ⚠ External sender. Take care when opening links or attachments. Do not 
> provide your login details. 
>
> puppet...@googlegroups.com 
> 
>  
>
> Google Groups 
> 
>  
>
> [image: Image removed by sender.] 
> 
>
> Topic digest 
> View all topics 
> 
>  
>
> ·  Mount NFS share defined in hiera 
> <#m_6369492644251464280_group_thread_0> - 1 Update 
>
> Mount NFS share defined in hiera 
> 
>
> Laci D : Feb 23 11:45AM -0800 
>
>
> I'm looking for manifest, hiera example which can mount an NFS defined in 
> a hiera_hash.
>  
> Someone must have one, thank you!
>
> Back to top 

RE: [Puppet Users] Mount NFS share defined in hiera

2023-02-24 Thread Chris Ritson
The code I have been given for an NFS mount is like this. Note the module in 
use on the first line….

types::files:
  # derdanne/nfs takes care of mountpoint creation.
  '’:
ensure: directory
mode: '0775'

debconfs:
  'apparmor/homedirs':
ensure: present
type: string
value: 
seen: 'true'
notify: Exec[dr_apparmor]

nfs::client_enabled:  true
nfs::manage_packages: true
nfs::nfs_v4_client:   false

nfs_client_mounts:
  :
server: 
share:  

--
Chris Ritson (School of Computing)
Newcastle University, NE1 7RU
Tel: +44(0)1912080073

From: puppet-users@googlegroups.com 
Sent: 24 February 2023 11:13
To: Digest recipients 
Subject: [Puppet Users] Digest for puppet-users@googlegroups.com - 1 update in 
1 topic


⚠ External sender. Take care when opening links or attachments. Do not provide 
your login details.
puppet-users@googlegroups.com
Google 
Groups
[Image removed by 
sender.]
Topic digest
View all 
topics
·  Mount NFS share defined in hiera - 1 Update
Mount NFS share defined in hiera 

Laci D : Feb 23 11:45AM -0800

I'm looking for manifest, hiera example which can mount an NFS defined in
a hiera_hash.

Someone must have one, thank you!
Back to top
You received this digest because you're subscribed to updates for this group. 
You can change your settings on the group membership 
page.
To unsubscribe from this group and stop receiving emails from it send an email 
to 
puppet-users+unsubscr...@googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/LO2P302MB0044E5FB514B13870B81DD0BC6A89%40LO2P302MB0044.GBRP302.PROD.OUTLOOK.COM.