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:
matt...@saou.eu ████ ██████ ████
██████████████████████
GPG: 4096R/E755CC63 ██ ██████████████ ██
8D91 7E2E F048 9C9C 46AF ██ ██ ██ ██
21A9 7A51 7B82 E755 CC63 ████ ████