I am using Puppet to manage the configurations of some servers. One of the tasks is to create a specific folder structure under /www
for hosting our applications.
But lately, we've had this server where /www
is just a symbolic link to another directory (had to do that because of storage shortage)
$ ls -l /www
lrwxrwxrwx 1 root root 13 Oct 25 15:33 /www -> /storage/www/
And we've been using this so far to manage directories:
file { $path:
ensure => directory,
owner => user,
group => group,
mode => 'a=rx,u+w'
}
The issue with this specific server, is that when running Puppet, the /www
symlink gets deleted and Puppet creates a new regular directory under /www
instead. And that breaks the applications for us unless we intervene manually to create the symbolic link again.
My question:
Does someone know of a way that makes Puppet not delete the symlink and just treat it as a directory: If no /www
directory or no /www
symlink exists, create the /www
directory, else do nothing?