ansible-roles/packweb-apache/tasks/main.yml

81 lines
1.8 KiB
YAML
Raw Normal View History

2017-03-21 17:35:42 +01:00
---
- fail:
msg: only compatible with Debian >= 8
when:
- ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('8', '<')
- name: Include apache role
include_role:
2017-08-22 06:09:58 +02:00
name: apache
- name: Include PHP role
include_role:
name: php
vars:
php_apache_enable: True
2017-08-23 04:28:21 +02:00
when: packweb_apache_modphp
- name: Include PHP role
include_role:
name: php
vars:
php_fpm_enable: True
when: packweb_apache_fpm
2017-03-21 18:21:30 +01:00
- name: Add elements to user account template
2017-03-21 17:35:42 +01:00
file:
path: "/etc/skel/{{ item.path }}"
state: "{{ item.state }}"
mode: "{{ item.mode }}"
with_items:
2017-03-21 18:21:30 +01:00
- { path: log, mode: "0750", state: directory }
- { path: awstats, mode: "0750", state: directory }
- { path: www, mode: "0750", state: directory }
2017-07-03 18:22:24 +02:00
- name: Copy apache empty log files if missing
copy:
src: "log/{{ item }}"
dest: "/etc/skel/log/{{ item }}"
mode: "0644"
force: no
with_items:
- access.log
- error.log
- name: "Install userlogrotate (jessie)"
copy:
src: userlogrotate_jessie
dest: /etc/cron.weekly/userlogrotate
mode: "0755"
when: ansible_distribution_release == "jessie"
- name: "Install userlogrotate (Debian 9 or later)"
2017-07-03 18:22:24 +02:00
copy:
src: userlogrotate
dest: /etc/cron.weekly/userlogrotate
mode: "0755"
when: ansible_distribution_major_version | version_compare('9', '>=')
2017-03-21 17:35:42 +01:00
2017-03-21 18:21:30 +01:00
- name: Force DIR_MODE to 0750 in /etc/adduser.conf
2017-03-21 17:35:42 +01:00
lineinfile:
dest: /etc/adduser.conf
regexp: '^DIR_MODE='
line: 'DIR_MODE=0750'
- include: apache.yml
2017-03-21 17:35:42 +01:00
- include: phpmyadmin.yml
2017-07-03 18:22:24 +02:00
- include: awstats.yml
2017-08-23 03:23:16 +02:00
- include: fhs_retrictions.yml
when: packweb_fhs_retrictions
2017-07-03 18:22:24 +02:00
- name: Install Evoadmin
include_role:
2017-08-22 06:20:18 +02:00
name: webapps/evoadmin-web
vars:
evoadmin_enable_vhost: "{{ packweb_enable_evoadmin_vhost }}"
2017-08-22 06:09:58 +02:00