testworks for me in /usr/bin, so adding it to a path might solve the error.
unless => 'bash -c "test -d /home/user/tmp/new_directory"',
Should also work. But I think the correct way is to use creates:
exec { "my_exec_task":
command => "tar zxf /home/user/tmp/test.tar.gz",
creates => "/home/user/tmp/new_directory",
path => "/usr/local/bin/:/bin/",
}
source
share