On Sun, 13 Apr 2014 20:24:22 -0700 (PDT)
John S <bun...@gmail.com> wrote:

> 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",
> }

I'm unsure how the "creates" will behave here, as it expects a local
file (or directory) to check for existence, not a command.

What you need to double check is the exit status of all of the commands
you are running, as well as change the "creates" to "unless", probably.

Run : /usr/bin/hadoop fs -ls /user/foo; echo $?

If you see 0 then the exec will no longer run when using "unless".

Run : /usr/bin/hadoop fs -mkdir /user/foo; echo $?

You'll need to see 0 when the HDFS directory didn't exist in order for
the '&&' to then execute to 2nd command.

HTH,
Matthias

-- 
            Matthias Saou                  ██          ██
                                             ██      ██
Web: http://matthias.saou.eu/              ██████████████
Mail/XMPP:  matth...@saou.eu             ████  ██████  ████
                                       ██████████████████████
GPG: 4096R/E755CC63                    ██  ██████████████  ██
     8D91 7E2E F048 9C9C 46AF          ██  ██          ██  ██
     21A9 7A51 7B82 E755 CC63                ████  ████

-- 
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/20140414132119.73f510c3%40r2d2.marmotte.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to