On Sunday, April 13, 2014 10:24:22 PM UTC-5, John S wrote:
>
> Hi All,
>  
> I have created a puppet manifest for creating hadoop folder for each user  
> and changing the ownership for each user.Am giving the user with title 
> parameter from nodes.pp
>  
> I was trying to execute two commands using exec parameter, but its 
> executing the first command, second command it is not executing .  Dont 
> know if am following the correct syntax . please help .
>  
> Attached below complete manifest module .
>  
> define hadoop::dir {
> exec { "/usr/bin/hadoop fs -mkdir /user/$title && /usr/bin/hadoop fs 
> -chown $title:title /user/$title ":
>     creates => "/usr/bin/hadoop fs -ls /user/$title",
> }
>


As Matthias said, the "creates" parameter wants a file name, not a 
command.  I don't see why Puppet would handle it any other way than by 
testing for a file with that strange name, which is surely not what you 
wanted.  Instead, choose a characteristic file and name only it.

But that's not the reason for the behavior you observe.  Matthias is also 
right that the second command in that '&&' list will not run if the first 
exits with nonzero status.  ALSO, however, the second will not run if 
Puppet uses the 'posix' Exec provider (instead, that provider will pass the 
'&&', subsequent command, and command-line parameters as additional 
parameters to the first command).  If you want to use a shell to run your 
Exec 'command' (as apparently you do), then you should specify "provider => 
'shell'" as well.


John

-- 
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/146a766e-cdff-4cbc-b6b9-90e2dc8d7375%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to