Hi,

I am writing a module to place a file into a directory only if the 
directory exist. If the directory or source does not exist it should simply 
ignore without throwing an error message. However I get an error saying 
that the file could not be created. Can anyone please help me to find out 
what is wrong with the below code?

err: /File[/home/user/.bashrc]/ensure: change from absent to file failed: 
Could not set 'file on ensure: cannot generate tempfile 
 
define test::user (username = $user){

file { "/home/${name}/.bashrc":
       ensure  => file,
       source  => ["puppet:///modules/test/${fqdn}_${$user}_bashrc" , 
'puppet:///modules/test/bashrc-default'],
       before  =>  Exec ["${user}_check"],
}

exec {"${user}_check":
      command => '/bin/false',
      provider => shell,
      unless => "/usr/bin/test -d /home/$name",
    }

Thank You

-- 
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/e5de03ec-c7ae-4b4d-86dd-62270ef2856a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to