I have checked https://docs.chef.io/resource_remote_directory.html and http://joerussbowman.tumblr.com/post/58241535331/chef-remote-directory-is-basically first of all.
chef-client version 12.2.1
OS CentOS 6.6
I'm doing a bit of work with deploying our tomcat deployment to a node, the recipe looks like this
user 'tomcat' do comment 'Tomcat User generated by chef' uid 2004 home '/opt/tomcat' shell '/bin/bash' end remote_directory '/opt/tomcat' do source 'tomcat-6.0.35' owner 'tomcat' group 'tomcat' mode '0755' files_owner 'tomcat' files_group 'tomcat' files_mode '0644' end remote_directory '/opt/tomcat/bin' do source 'bin' files_owner 'tomcat' files_group 'tomcat' files_mode '0755' owner 'tomcat' group 'tomcat' mode '0755' end
For some reason this would leave random directories as root.root
[~~~~~~~~~~~ tomcat]~ ll total 88 drwxr-xr-x 4 root root 4096 Apr 8 13:59 appconfig drwxr-xr-x 2 tomcat tomcat 4096 Apr 8 13:59 bin drwxr-xr-x 4 tomcat tomcat 4096 Apr 8 13:59 conf drwxr-xr-x 2 tomcat tomcat 4096 Apr 8 13:59 lib -rw-r--r-- 1 tomcat tomcat 37951 Apr 8 13:59 LICENSE -rw-r--r-- 1 tomcat tomcat 558 Apr 8 13:59 NOTICE -rw-r--r-- 1 tomcat tomcat 8680 Apr 8 13:59 RELEASE-NOTES -rw-r--r-- 1 tomcat tomcat 6670 Apr 8 13:59 RUNNING.txt drwxr-xr-x 3 root root 4096 Apr 8 13:59 shared drwxr-xr-x 7 root root 4096 Apr 8 13:59 webapps
This odd behaviour continues throughout the tree where directories are not set to tomcat.tomcat (always the same ones are left as root.root)
The only addition recipes are a java one from the supermarket and a basic one to copy over mod_jk and install httpd.
So question is - is it me doing something silly, reading the documentation incorrectly or a glitch.
If it's me, what am I doing wrong. Cheers.
Note I have also tried adding the following, which still doesn't recurs correctly.
directory '/opt/tomcat' do owner 'tomcat' group 'tomcat' recursive true end