Ask Your Question

Puppet Mount Error

asked 2013-09-30 10:52:36 -0500

louis gravatar image

I am trying to mount a samba partition with the following code.

mount { 'package-share':
    name    => '/mnt/puppetfs',
    ensure  => 'mounted',
    device  => '//<some-random-server>/shardirs/shardata/puppet',
    fstype  => 'cifs',
    atboot  => true,
    options => 'defaults' 

and it seems to be an error with the resource. Do i need to provide credentials for this to work and if so haven't seen any examples on how to do it.

Notice: /Stage[main]/Master/Mount[puppet file system share]/ensure: ensure changed 'unmounted' to 'mounted'
Error: /Stage[main]/Master/Mount[puppet file system share]: Could not evaluate: Execution of '/bin/mount -o defaults /mnt/puppetfs' returned 32 ...
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-09-30 13:02:59 -0500

GregLarkin gravatar image

Do you need to supply credentials when you run this mount command by hand? If so, then you will need to add some things to your manifest to supply credentials when Puppet executes the mount.

First, create a Samba credentials file and add it to your Puppet fileserver. See the credentials file option in the Samba man page for the exact format of the file. Once you have your credentials file set up, add something like this to your manifest:

file {'smb credentials':
  path   => '/etc/auto.smb.credentials',
  source => 'puppet:///modules/etc/auto.smb.credentials',

Then adjust your mount declaration ... (more)

edit flag offensive delete link more


Interesting. Will try the approach but i dont think i can supply the password in plain text. Wondering if there is another way to enable a readonly access to a ...(more)

louis gravatar imagelouis ( 2013-09-30 21:00:05 -0500 )edit

Yes, the most you can do is secure the auto.smb.credentials file so it's only readable by root, but it will still contain the cleartext password.

GregLarkin gravatar imageGregLarkin ( 2013-10-01 20:17:28 -0500 )edit

I restarted the server vm but it requested a password on boot? Do i need to add something to the /etc/sudoers file? CentOS 5.x here...

louis gravatar imagelouis ( 2013-10-03 10:12:22 -0500 )edit

Do you mean that the machine wouldn't even fully boot until you supplied a password? If so, you probably have to enter the root password to get it to ...(more)

GregLarkin gravatar imageGregLarkin ( 2013-10-03 11:22:25 -0500 )edit

answered 2013-09-30 13:00:46 -0500

jonuwz gravatar image

Yes you do.

You need to pass in the user, password and domain ( unless you've enabled anonymous access to the share )

options would look something like

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2013-09-30 10:52:36 -0500

Seen: 729 times

Last updated: Sep 30 '13