-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request: parent directory for Apache #11
Comments
Actually the (automatic) management of parents directory with Puppet has always been a problem. So you would end up with nodes (or roles) with something like: apache::domain { "mydomain2.com": } Not particularly attractive, but it works. |
Yes, that would work nicely, thanks!! (I'm keeping you busy agian.. :) ) |
Wouldn't a virtual resource fix the problem? The parent directory (in this case /var/www) is defined as a virtual resource and realized in apache::virtualhost. |
Well, don't know, I suppose we have to try. The point is what happens when you realize the same virtual resource twice (as it would happen when you call the virtualhost deifne more than once). I actually never use virtual resources (only exported resources, when needed) so I don't know exactly how they behaves in these cases. |
Virtual resources are made for this. Think about users. Maybe you need a specific user in different modules. Puppet deals with it, as soon as it gets realized. If there is another Realize(File...) it won't get realized again. More about here: http://docs.puppetlabs.com/guides/virtual_resources.html |
Quite useful indeed. I suppose I'll start to use Virtual Resources more often now that I realize their usefulness in these cases (generally I used to place in specific classes resources that could be applied more than once), thanks |
Hi,
I've got several domains with more than one site on it.
On my disk, I keep them ordered like this:
/var/www/domain.com/site1
/var/www/domain.com/site2
/var/www/domain.com/site3
When I make virtualhosts with the virtualhosts manifest, it doesn't create the documentroot directory because the parent doesn't exist.
I've added this to virtualhost.rb to try and fix it:
---------------%<---------------
# creating/managing docroot parent directory
$documentroot_1up = $documentroot_real.chomp(separator='/').rpartition("/")
file { "$documentroot_1up":
owner => "${apache::params::configfile_owner}",
group => "${apache::params::configfile_group}",
mode => '775',
ensure => directory,
}
---------------%<---------------
... but I cannot mix ruby code in.
I've also found this page:
http://www.puppetlabs.com/blog/ruby-dsl/
It looks promising, but I have RedHat servers that use Puppet 0.25.5 from EPEL. I even tried making it work on Ubuntu (which does have Puppet 2.6), but I haven't got a clue where the different parts fit in.
If the apache-module could also check if the parent-directory exist then that would be great, pointers on how to get the parent directory from a string would also be very much appreciated...
Thanks,
Ger.
The text was updated successfully, but these errors were encountered: