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

96 lines
2.4 KiB
YAML
Raw Permalink Normal View History

2017-03-21 17:35:42 +01:00
---
- name: Dependencies are satisfied
ansible.builtin.include_tasks: dependencies.yml
- ansible.builtin.fail:
msg: only compatible with Debian >= 8
when:
- ansible_distribution != "Debian" or ansible_distribution_major_version is version('8', '<')
- name: Additional packages are installed
ansible.builtin.apt:
name:
- zip
- unzip
state: present
2017-09-07 23:16:41 +02:00
- name: install info.php
ansible.builtin.copy:
2017-09-07 23:16:41 +02:00
src: info.php
dest: /var/www/info.php
mode: "0644"
- name: enable info.php link in default site index
ansible.builtin.lineinfile:
2017-09-07 23:16:41 +02:00
dest: /var/www/index.html
line: ' <li><a href="/info.php">Infos PHP</a></li>'
regexp: "Infos PHP"
- name: install opcache.php
ansible.builtin.copy:
src: opcache.php
dest: /var/www/opcache.php
mode: "0644"
- name: enable opcache.php link in default site index
ansible.builtin.lineinfile:
dest: /var/www/index.html
line: ' <li><a href="/opcache.php">Infos OpCache PHP</a></li>'
regexp: "Infos OpCache PHP"
2017-03-21 18:21:30 +01:00
- name: Add elements to user account template
ansible.builtin.file:
2017-03-21 17:35:42 +01:00
path: "/etc/skel/{{ item.path }}"
state: "{{ item.state }}"
mode: "{{ item.mode }}"
loop:
2019-01-01 20:04:56 +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
2018-04-22 17:23:31 +02:00
- name: Apache log file (templates) are present
ansible.builtin.command:
cmd: "touch /etc/skel/log/{{ item }}"
2018-04-22 17:23:31 +02:00
args:
creates: "/etc/skel/log/{{ item }}"
loop:
2018-04-22 17:23:31 +02:00
- access.log
- error.log
- name: Apache log file (templates) have the proper permissions
ansible.builtin.file:
2017-07-03 18:22:24 +02:00
dest: "/etc/skel/log/{{ item }}"
mode: "0644"
loop:
2018-04-22 17:23:31 +02:00
- access.log
- error.log
2017-07-03 18:22:24 +02:00
- ansible.builtin.include_role:
name: userlogrotate
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
ansible.builtin.lineinfile:
2017-03-21 17:35:42 +01:00
dest: /etc/adduser.conf
regexp: '^DIR_MODE='
line: 'DIR_MODE=0750'
- ansible.builtin.include: apache.yml
2017-03-21 17:35:42 +01:00
- ansible.builtin.include: phpmyadmin.yml
2017-07-03 18:22:24 +02:00
- ansible.builtin.include: awstats.yml
- ansible.builtin.include: fhs_retrictions.yml
when: packweb_fhs_retrictions | bool
- name: Periodically cache ftp directory sizes for ftpadmin.sh
ansible.builtin.cron:
name: "ProFTPd directory size caching"
special_time: daily
job: "/usr/share/scripts/evoadmin/stats.sh"
- ansible.builtin.include: multiphp.yml
when: packweb_multiphp_versions | length > 0