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/d62071e2-847e-4725-b0fd-4ed5356b0f75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.