How to reference NFS shares in a file resource

150 views
Skip to first unread message

warron.french

unread,
Jan 13, 2017, 12:23:31 PM1/13/17
to puppet...@googlegroups.com
Hi, I need to understand how to properly write some puppet code that will take files off of an NFS share on serverA and place them on my clients via a puppet module.

My NFS server is serverA.home, providing serverA:/some/path that mounts on my clients
my puppet master is puppetmaster.home,

I believe (please correct me) that I can create a puppet file resource and then use the attribute called source.

I don't know how to properly implement the source attribute with respect to my nfs server serverA.home.  Does the NFS mount need to be on the client machines, or available to the puppetmaster.home host?



Thanks to anyone who can help me with this.
--------------------------
Warron French

Thomas Müller

unread,
Jan 16, 2017, 2:03:56 AM1/16/17
to Puppet Users


Am Freitag, 13. Januar 2017 18:23:31 UTC+1 schrieb Warron French:
Hi, I need to understand how to properly write some puppet code that will take files off of an NFS share on serverA and place them on my clients via a puppet module.

My NFS server is serverA.home, providing serverA:/some/path that mounts on my clients
my puppet master is puppetmaster.home,

I believe (please correct me) that I can create a puppet file resource and then use the attribute called source.

I don't know how to properly implement the source attribute with respect to my nfs server serverA.home.  Does the NFS mount need to be on the client machines, or available to the puppetmaster.home host?


if the nfs share is mounted on all clients you could just reference it as a local file on the server:

file { '/bli/bla/blup':
  ...
  source => '/nfs/share/bli/bla/blup',
  ...
}

this '/nfs/share/bli/bla/blup' is not evaluated on the puppetmaster but only on the client.



if the share is mounted on the master only you might configure another fileserver.conf entry: https://docs.puppet.com/puppet/latest/config_file_fileserver.html

you then reference IMHO like this:


file { '/bli/bla/blup':
  ...
  source => 'puppet:///mount_point_name/bli/bla/blup',
  ...
}

I personally would not introduce a dependency on the nfs share on the puppet master. If the nfs server is not available I'd expect the whole puppet master to lock up. I'd at least would think about rsync'ing them locally or even creating something like a puppet module only containing the data.
 
- Thomas

warron.french

unread,
Jan 16, 2017, 6:38:23 PM1/16/17
to puppet...@googlegroups.com
Merci Thomas,
   I didn't know how to implement the syntax (you solved that problem) and you expressed a technical advisory, against the idea of mounting NFS on the puppet master.

Do you advise strongly against the source being mounted onto clients from the NFS server to source the file?  The idea is the source is going to be available on a NFS shared path so that Party1 can edit the file, and Party2 has control over the Puppet Master.

Thanks for replying, I was wondering if my email got into the queue properly, and I forgot about it over the weekend.

--------------------------
Warron French


--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/9b4f498a-d870-43b2-92a9-d194a0551b4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Neil - Puppet List

unread,
Jan 17, 2017, 3:42:18 AM1/17/17
to PuppetList
Hello

another option is to run a puppet master on the nfs server to share the same files. 

the file source would then be

puppet://servera/blah/filepath. 

Neil

warron.french

unread,
Jan 18, 2017, 2:21:19 PM1/18/17
to puppet...@googlegroups.com
Hello Neil, thanks for the suggestion.  This (idea) would be a deviation from the baseline, and it was shot down already by my supervisor.

--------------------------
Warron French


Reply all
Reply to author
Forward
0 new messages