Hi

I want to use exec to create a recursive directory (I know I can use file
but for another reason I don't want to)

So as a variable I get passed in $home and it may be for example
/first/second/userdirectory where first and second may not exist.

Puppet's user wraps useradd so it won't recursively create my directory so
I want to use exec to create the directory /first/second before the user is
created.
If I allow puppet to recursively create /first/second/userdirectory in it's
entirety with file.....when the user is created it doesn't contain the
.bashrc and .profile files which I want.

So I wanted to do a simple exec command which does the following if I were
to do it at the command line:

mkdir -p ${home%/*}

...this would make /first/second and I can allow useradd create the
userdirectory.

BUT....puppet doesn't like me passing that to command.

exec { "$home.create":
      path      => '/bin:/usr/bin',
      command   => "mkdir -p '${home%/*}'",
    }

I get Could not match %/*}\"

Is this possible and if so what is the correct syntax? I've tried lots of
options.
Thanks in advance
Julia

-- 
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error please notify the system manager. 
This message contains confidential information and is intended only for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to