title: How to ensure directory path exists on symlinking in Chef?
body: <p>Creating a symlink in Chef:</p>
  
  <pre><code>link "#{node[:tomcat][:home]}/webapps/myface.war" do
    to "/srv/scafandru/current/myface.war"
  end
  </code></pre>
  
  <p>fails, since at that time the parent directory is missing on the node.</p>
  
  <p>In the <a href="http://docs.opscode.com/resource_link.html" rel="nofollow"><code>link</code> resource</a> I couldn't see any attribute similar to the <a href="http://docs.opscode.com/resource_directory.html" rel="nofollow"><code>directory</code> resource</a>'s <code>recursive true</code>, so my current approach is to ensure that the directory structure exists by running </p>
  
  <pre><code>directory "#{node[:tomcat][:home]}/webapps" do
    recursive true
  end
  </code></pre>
  
  <p>right before linking.</p>
  
  <p>Is there any elegant way to encapsulate this behaviour inside the link resource?</p>