40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
---
|
|
#
|
|
# setup the vhosts for apache based websites
|
|
|
|
# - name: fetch existing vhosts
|
|
# fetch: src=/etc/apache2/vhost-available/{{ item }} dest=backups/
|
|
# with_items:
|
|
# - 00_default_ssl_vhost.conf
|
|
# - 00_default_vhost.conf
|
|
# - 01_home_vhost.conf
|
|
# - 02_test_vhost.conf
|
|
# - 04_sql_vhost.conf
|
|
# - 05_mail_vhost.conf
|
|
# - default_vhost.include
|
|
#
|
|
# - fetch: src=/etc/apache2/httpd.conf dest=backups/
|
|
|
|
- name: create vhost dirs
|
|
file: state=directory path=/etc/apache2/{{ item }} owner=root group=root mode=0750
|
|
with_items:
|
|
- sites-available
|
|
- sites-enabled
|
|
|
|
- name: main apache conf
|
|
template: src=httpd.conf dest=/etc/apache2/httpd.conf owner=root group=root mode=640
|
|
notify:
|
|
- reload apache2
|
|
|
|
- name: setup available vhosts
|
|
template: src={{ item }}.j2 dest=/etc/apache2/sites-available/{{ item }}.conf owner=root group=root mode=0640
|
|
with_items: "{{ websites.available }}"
|
|
notify:
|
|
- reload apache2
|
|
|
|
- name: enable sites
|
|
file: state=link src=/etc/apache2/sites-available/{{ item }}.conf dest=/etc/apache2/sites-enabled/{{ item }}.conf
|
|
with_items: "{{ websites.enabled }}"
|
|
notify:
|
|
- reload apache2
|