mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2025-01-02 08:10:18 +01:00
Merge pull request #85 from Christoph-D/single-config
Merge the templates for apache 2.2 and 2.4
This commit is contained in:
commit
6d623d00c4
6 changed files with 16 additions and 73 deletions
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
- name: Add apache vhosts configuration.
|
- name: Add apache vhosts configuration.
|
||||||
template:
|
template:
|
||||||
src: "vhosts-{{ apache_vhosts_version }}.conf.j2"
|
src: "vhosts.conf.j2"
|
||||||
dest: "{{ apache_conf_path }}/sites-available/{{ apache_vhosts_filename }}"
|
dest: "{{ apache_conf_path }}/sites-available/{{ apache_vhosts_filename }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
- name: Add apache vhosts configuration.
|
- name: Add apache vhosts configuration.
|
||||||
template:
|
template:
|
||||||
src: "vhosts-{{ apache_vhosts_version }}.conf.j2"
|
src: "vhosts.conf.j2"
|
||||||
dest: "{{ apache_conf_path }}/{{ apache_vhosts_filename }}"
|
dest: "{{ apache_conf_path }}/{{ apache_vhosts_filename }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
- name: Add apache vhosts configuration.
|
- name: Add apache vhosts configuration.
|
||||||
template:
|
template:
|
||||||
src: "vhosts-{{ apache_vhosts_version }}.conf.j2"
|
src: "vhosts.conf.j2"
|
||||||
dest: "{{ apache_conf_path }}/{{ apache_vhosts_filename }}"
|
dest: "{{ apache_conf_path }}/{{ apache_vhosts_filename }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
- name: Add apache vhosts configuration.
|
- name: Add apache vhosts configuration.
|
||||||
template:
|
template:
|
||||||
src: "vhosts-{{ apache_vhosts_version }}.conf.j2"
|
src: "vhosts.conf.j2"
|
||||||
dest: "{{ apache_conf_path }}/{{ apache_vhosts_filename }}"
|
dest: "{{ apache_conf_path }}/{{ apache_vhosts_filename }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
|
@ -1,69 +0,0 @@
|
||||||
{{ apache_global_vhost_settings }}
|
|
||||||
|
|
||||||
{# Set up VirtualHosts #}
|
|
||||||
{% for vhost in apache_vhosts %}
|
|
||||||
<VirtualHost {{ apache_listen_ip }}:{{ apache_listen_port }}>
|
|
||||||
ServerName {{ vhost.servername }}
|
|
||||||
{% if vhost.serveralias is defined %}
|
|
||||||
ServerAlias {{ vhost.serveralias }}
|
|
||||||
{% endif %}
|
|
||||||
{% if vhost.documentroot is defined %}
|
|
||||||
DocumentRoot {{ vhost.documentroot }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if vhost.serveradmin is defined %}
|
|
||||||
ServerAdmin {{ vhost.serveradmin }}
|
|
||||||
{% endif %}
|
|
||||||
{% if vhost.documentroot is defined %}
|
|
||||||
<Directory "{{ vhost.documentroot }}">
|
|
||||||
AllowOverride All
|
|
||||||
Options -Indexes FollowSymLinks
|
|
||||||
Order allow,deny
|
|
||||||
Allow from all
|
|
||||||
</Directory>
|
|
||||||
{% endif %}
|
|
||||||
{% if vhost.extra_parameters is defined %}
|
|
||||||
{{ vhost.extra_parameters }}
|
|
||||||
{% endif %}
|
|
||||||
</VirtualHost>
|
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{# Set up SSL VirtualHosts. #}
|
|
||||||
{% for vhost in apache_vhosts_ssl %}
|
|
||||||
<VirtualHost {{ apache_listen_ip }}:{{ apache_listen_port_ssl }}>
|
|
||||||
ServerName {{ vhost.servername }}
|
|
||||||
{% if vhost.serveralias is defined %}
|
|
||||||
ServerAlias {{ vhost.serveralias }}
|
|
||||||
{% endif %}
|
|
||||||
{% if vhost.documentroot is defined %}
|
|
||||||
DocumentRoot {{ vhost.documentroot }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
SSLEngine on
|
|
||||||
SSLCipherSuite {{ apache_ssl_cipher_suite }}
|
|
||||||
SSLProtocol {{ apache_ssl_protocol }}
|
|
||||||
SSLHonorCipherOrder On
|
|
||||||
SSLCertificateFile {{ vhost.certificate_file }}
|
|
||||||
SSLCertificateKeyFile {{ vhost.certificate_key_file }}
|
|
||||||
{% if vhost.certificate_chain_file is defined %}
|
|
||||||
SSLCertificateChainFile {{ vhost.certificate_chain_file }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if vhost.serveradmin is defined %}
|
|
||||||
ServerAdmin {{ vhost.serveradmin }}
|
|
||||||
{% endif %}
|
|
||||||
{% if vhost.documentroot is defined %}
|
|
||||||
<Directory "{{ vhost.documentroot }}">
|
|
||||||
AllowOverride All
|
|
||||||
Options -Indexes FollowSymLinks
|
|
||||||
Order allow,deny
|
|
||||||
Allow from all
|
|
||||||
</Directory>
|
|
||||||
{% endif %}
|
|
||||||
{% if vhost.extra_parameters is defined %}
|
|
||||||
{{ vhost.extra_parameters }}
|
|
||||||
{% endif %}
|
|
||||||
</VirtualHost>
|
|
||||||
|
|
||||||
{% endfor %}
|
|
|
@ -18,7 +18,12 @@
|
||||||
<Directory "{{ vhost.documentroot }}">
|
<Directory "{{ vhost.documentroot }}">
|
||||||
AllowOverride All
|
AllowOverride All
|
||||||
Options -Indexes +FollowSymLinks
|
Options -Indexes +FollowSymLinks
|
||||||
|
{% if apache_vhosts_version == "2.2" %}
|
||||||
|
Order allow,deny
|
||||||
|
Allow from all
|
||||||
|
{% else %}
|
||||||
Require all granted
|
Require all granted
|
||||||
|
{% endif %}
|
||||||
</Directory>
|
</Directory>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if vhost.extra_parameters is defined %}
|
{% if vhost.extra_parameters is defined %}
|
||||||
|
@ -44,7 +49,9 @@
|
||||||
SSLCipherSuite {{ apache_ssl_cipher_suite }}
|
SSLCipherSuite {{ apache_ssl_cipher_suite }}
|
||||||
SSLProtocol {{ apache_ssl_protocol }}
|
SSLProtocol {{ apache_ssl_protocol }}
|
||||||
SSLHonorCipherOrder On
|
SSLHonorCipherOrder On
|
||||||
|
{% if apache_vhosts_version == "2.4" %}
|
||||||
SSLCompression off
|
SSLCompression off
|
||||||
|
{% endif %}
|
||||||
SSLCertificateFile {{ vhost.certificate_file }}
|
SSLCertificateFile {{ vhost.certificate_file }}
|
||||||
SSLCertificateKeyFile {{ vhost.certificate_key_file }}
|
SSLCertificateKeyFile {{ vhost.certificate_key_file }}
|
||||||
{% if vhost.certificate_chain_file is defined %}
|
{% if vhost.certificate_chain_file is defined %}
|
||||||
|
@ -58,7 +65,12 @@
|
||||||
<Directory "{{ vhost.documentroot }}">
|
<Directory "{{ vhost.documentroot }}">
|
||||||
AllowOverride All
|
AllowOverride All
|
||||||
Options -Indexes +FollowSymLinks
|
Options -Indexes +FollowSymLinks
|
||||||
|
{% if apache_vhosts_version == "2.2" %}
|
||||||
|
Order allow,deny
|
||||||
|
Allow from all
|
||||||
|
{% else %}
|
||||||
Require all granted
|
Require all granted
|
||||||
|
{% endif %}
|
||||||
</Directory>
|
</Directory>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if vhost.extra_parameters is defined %}
|
{% if vhost.extra_parameters is defined %}
|
Loading…
Reference in a new issue