title: Can opscode chef perform wait until a condition becomes true?
body: <p>we have a use case where we want the chef orchestration to wait until a particular directory gets deleted in the machine. is there some way to achieve it?</p>
  
  <p>I searched in the internet and found the following <a href="https://supermarket.chef.io/cookbooks/wait" rel="nofollow">cookbook</a> </p>
  
  <p>I feel it can be used but i am having difficulty in understanding how can I use it, there is no read me about using it.</p>
  
  <p>How can i achieve it?</p>
  
  <p>edit to remove hold:
  say you have following recipe</p>
  
  <pre><code>execute 'making dir' do
    command 'mkdir /tmp/test2'
    not_if do ::File.directory?('/tmp/test1') end
  
  end
  </code></pre>
  
  <p>reference: <a href="https://docs.chef.io/resource_common.html#not-if-examples" rel="nofollow">https://docs.chef.io/resource_common.html#not-if-examples</a></p>
  
  <p>here, what i want by not_if was "wait until /tmp/test1 gets deleted" but how chef executs this is like "it found directory exixting so it did not execute the resource and exited"</p>
  
  <p>i need a way to perform wait until a condition becomes true.</p>