Comments (6)
Actually the (automatic) management of parents directory with Puppet has always been a problem.
Generally because you have to define every single directory in the path. This can be fixed in a pure ruby class, but as you've said this won't work on pre 2.6.
In this case a generic virtualhost define that tries to recreate the parent dir, would fail if called twice having a duplicate recource for the parent dir, so I can't fix i upstream.
What I can say is that you should manage this a a custom way, that fits your needs and takes some assumptions.
For example have a custom apache::domain define that just creates the parent directory and is called only once (hand then have all the apache::virtualhosts defines that you need.
ThisiIs not particularly pratical but maybe can be useful to manage, besides the /var/www/domain.com dir, whatever other resource you might manage that is related to the single domain.
So you would end up with nodes (or roles) with something like:
apache::domain { "mydomain1.com": }
apache::virtualhost { "site1": documentroot => "/var/www/mydomain1.com/site1" ... }
apache::virtualhost { "site2": documentroot => "/var/www/mydomain1.com/site2" ... }
apache::domain { "mydomain2.com": }
apache::virtualhost { "site1": documentroot => "/var/www/mydomain2.com/site1" ... }
apache::virtualhost { "site2": documentroot => "/var/www/mydomain2.com/site2" ... }
Not particularly attractive, but it works.
from psick.
Yes, that would work nicely, thanks!!
(I'm keeping you busy agian.. :) )
from psick.
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.
from psick.
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.
from psick.
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
from psick.
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
from psick.
Related Issues (20)
- Refine general Vagrantfile and review/test all environments config.yaml
- puppet_install.sh not working on fedora 27 HOT 1
- Minimal install miss hiera.yaml
- More structured, dynamic, and manageable control-repo spec tests
- Move hieradata to separated module
- Missing development tools in vagrant gitlab.foss.psick.io HOT 3
- boxes.yaml has a duplicate line
- Allow to choose sync folder mount type
- all_roles task missing HOT 2
- Windows compatibility HOT 1
- Link does not work
- Rename Gitlab CI variable CI_BUILD_REF_NAME -> CI_COMMIT_REF_NAME HOT 4
- docs: image is missing
- pool_size throws errors HOT 1
- docs: pe vagrant environment README is missing a plugin
- tp-profile repo is wrong
- Vagrant FOSS shows missing profile psick::puppet::tp HOT 2
- add root passwords rotation script HOT 2
- Update Vagrant PE Env
- Vagrant PE environment causes puppet compiler error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psick.