- From:
- To:
- Subject: [chef] Re: Re: not_if not being respected in execute resource?
- Date: Mon, 25 Jun 2012 13:16:09 -0700
On Mon, 25 Jun 2012, Adam Jacob wrote:
>
The obvious question: does java_home exist? Your print statement and
>
the not_if are not identical...
::blinkblink:: .. there it is! thanks for the eyeballs. tis fixed now.
"/usr/java" != "#{java_home}".
>
On Mon, Jun 25, 2012 at 12:34 PM,
>
<
>
>
wrote:
>
>
>
> or maybe i'm doing something silly and don't see it yet..
>
>
>
> i have a recipe that downloads and unpacks a tarball. my intention for
>
> this is to have it download only if the target directory does not
>
> exist on the node. but what's happening is, the tarball gets downloaded
>
> on each run.
>
>
>
> am i using "not_if" correctly below? any suggestions?
>
>
>
> thanks!
>
> kallen
>
>
>
>
>
> if File.directory?("/usr/java/jdk#{java_version}.hoight.#{m_arch}")
>
> # after the first run, the above line is true
>
> Chef::Log.debug("HIGGS-BOSON: dir exists:
>
> /usr/java/jdk#{java_version}.hoight.#{m_arch}")
>
> end
>
>
>
> execute "install_jdk_tarball" do
>
> user "root"
>
> cwd "/usr/java"
>
> command "curl -s
>
> http://#{depot}/depot/jdk#{java_version}.hoight.#{m_arch}.tgz | tar zxf -"
>
> not_if
>
> {File.directory?("#{java_home}/jdk#{java_version}.hoight.#{m_arch}")}
>
> end
>
>
>
>
>
>
--
>
Opscode, Inc.
>
Adam Jacob, Chief Customer Officer
>
T: (206) 619-7151 E:
>
Archive powered by MHonArc 2.6.16.