But when I do a puppet resource mount /mnt -e with the code below, it just 
works. Why would it failed in a puppet agent run but not in a puppet 
resource command?

mount { '/mnt':
  ensure => 'mounted',
  fstype => 'cifs',
  device => '//10.200.206.83/Installation\040Media',
  options=> 'credentials=/root/.smb_cred',
}



On Thursday, May 1, 2014 10:31:46 AM UTC+4, Choon Ming Goh wrote:
>
> Hi all, 
>
> I'm trying to mount a Windows file share on the Linux system. Changing 
> names are not possible as per client's policy. I'm trying with the code 
> below but presented with errors:
>
> class nas_storage ($username, $password, $domain, $naslocation) { 
>
>     #replace the \ with / and whitespace with ascii 040 as fstab does not 
> accepts these characters
>     $nasmount = regsubst(regsubst($naslocation, ' ', '040', 'G'), '\\', 
> '/', 'G')
>     
>     file { '/root/.smb_cred':
>       ensure  => file,
>       content => 
> "username=${username}\npassword=${password}\ndomain=${domain}"
>     }
>     
>     mount { 'mount NAS storage':
>       ensure  => 'mounted',
>       device  => $nasmount,
>       fstype  => 'cifs',
>       target  => '/mnt',
>       options => "auto,credentials=/root/.smb_cred",
>     }
> }
>
> Error: Parameter name failed on Mount[mount NAS storage]: name must not 
> contain whitespace: mount NAS storage at 
> /etc/puppetlabs/puppet/modules/nas_storage/manifests/init.pp:37
> Wrapped exception:
> name must not contain whitespace: mount NAS storage
>
> It says that whitespaces are not accepted but in /etc/fstab they do accept 
> the \040 as a whitespace replacement. Can anyone enlighten me?
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/11f29dd8-29cc-4e82-8fd1-60b2b9082be4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to