Skip to content
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

Configuring the default variables to allow multiple 1 or more virtualhosts #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mfrost503
Copy link

There was an issue in the Phansible/Phansible repository (#282) asking how to set up multiple virtualhosts. Having done something similar in our Ansible setup, I'd like to propose the following changes.

default/main.yml - alter the yaml structure to include a hosts section, by default it will work the same way as it did before. This also allows some flexibility to set apache level variables, as well as variables at the vhost level. Also provided a config_name option that will allow a user to set the name of the file that will go in /etc/apache2/sites-available

tasks/main.yml - Modify the 2.4 and 2.2 tasks to use the items in apache.hosts to build the virtual hosts and use the {{ item.config_name }} value to name the vhost file.

templates/vhost22.yml & templates/vhost24.yml - Since we are looping through the hosts, on each pass the item will be available, in order for these to be configured correctly - had to change the apache.docroot and apache.servername tokens with item.docroot and item.servername.

Since the default variables will be overwritten by anything, setting up the default variables this way provides a little bit of structure if a user wanted to change where they are using variables

@debo
Copy link
Member

debo commented Oct 30, 2016

@mfrost503 thanks a lot for the contribution; however I have to put temporarily put this on hold because adding the support for this feature will require heavy changed in the fronted to support it. I will merge it in as soon as such changes are available if that's ok with you. What do you think>

@naxhh
Copy link
Contributor

naxhh commented Oct 31, 2016

@debo what about to allow users to only create 1 in the UI and creating a task to extend that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants