Showing with 19 additions and 17 deletions.
  1. +14 −14 roles/apache/tasks/main.yml
  2. +1 −0 roles/sympa/defaults/main.yml
  3. +2 −1 roles/sympa/tasks/main.yml
  4. +1 −1 roles/sympa/tasks/sympa_db.yml
  5. +1 −1 roles/sympa/templates/sympa.conf.j2
@@ -6,6 +6,20 @@
- apache2
- apache2-utils

- name: Put Apache vhost certs
no_log: True
copy: content="{{ item.ssl_certificate }}" dest=/etc/ssl/certs/{{ item.name }}.crt owner=root group=root mode=644
when: item.ssl
with_items: "{{ vhosts }}"
notify: Restart Apache

- name: Put Apache vhost keys
no_log: True
copy: content="{{ item.ssl_key }}" dest=/etc/ssl/private/{{ item.name }}.key owner=root group=ssl-cert mode=640
with_items: "{{ vhosts }}"
when: item.ssl
notify: Restart Apache

- name: Disable default Apache sites
command: /usr/sbin/a2dissite {{ item }} removes=/etc/apache2/sites-enabled/{{ item }}.conf
with_items:
@@ -52,20 +66,6 @@
with_items: "{{ vhosts }}"
notify: Restart Apache

- name: Put Apache vhost certs
no_log: True
copy: content="{{ item.ssl_certificate }}" dest=/etc/ssl/certs/{{ item.name }}.crt owner=root group=root mode=644
when: item.ssl
with_items: "{{ vhosts }}"
notify: Restart Apache

- name: Put Apache vhost keys
no_log: True
copy: content="{{ item.ssl_key }}" dest=/etc/ssl/private/{{ item.name }}.key owner=root group=ssl-cert mode=640
with_items: "{{ vhosts }}"
when: item.ssl
notify: Restart Apache

- name: Enable Apache vhost sites
no_log: True
command: /usr/sbin/a2ensite {{ item.name }}:{{ item.port }} creates=/etc/apache2/sites-enabled/{{ item.name }}:{{ item.port }}.conf
@@ -45,3 +45,4 @@ sympa_apply_patches: 1
sympa_force_smtp_route: 0
sympa_incoming_smtp: '192.168.66.66'
sympa_outgoing_server: "{{ sympa_incoming_smtp }}"
sympa_db_app_user: sympa
@@ -49,4 +49,5 @@
loop_control:
loop_var: robot_item


# Include environment specific tasks
- include: "{{ inventory_dir }}/tasks/sympa.yml"
@@ -35,7 +35,7 @@
mysql_user:
login_user: root
login_password: "{{ sympa_db_root_password }}"
name: sympa_user
name: "{{ sympa_db_app_user }}"
password: "{{ sympa_db_app_password }}"
host: "{{ item }}"
priv: "sympa.*:ALL"
@@ -258,7 +258,7 @@ db_name sympa
db_host localhost

## User for the database connection
db_user sympa_user
db_user {{ sympa_db_app_user }}

## Password for the database connection
## What ever you use a password or not, you must protect the SQL server (is it