ansible-roles/packweb-apache/tasks/main.yml
Jérémy Lecour 2b9354b549
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
re-enable phpmyadmin
2019-06-27 16:19:17 +02:00

80 lines
2 KiB
YAML

---
- fail:
msg: only compatible with Debian >= 8
when:
- ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('8', '<')
- name: install info.php
copy:
src: info.php
dest: /var/www/info.php
mode: "0644"
- name: enable info.php link in default site index
lineinfile:
dest: /var/www/index.html
line: ' <li><a href="/info.php">Infos PHP</a></li>'
regexp: "Infos PHP"
- name: Add elements to user account template
file:
path: "/etc/skel/{{ item.path }}"
state: "{{ item.state }}"
mode: "{{ item.mode }}"
with_items:
- { path: log, mode: "0750", state: directory }
- { path: awstats, mode: "0750", state: directory }
- { path: www, mode: "0750", state: directory }
- name: Apache log file (templates) are present
command: "touch /etc/skel/log/{{ item }}"
args:
creates: "/etc/skel/log/{{ item }}"
with_items:
- access.log
- error.log
- name: Apache log file (templates) have the proper permissions
file:
dest: "/etc/skel/log/{{ item }}"
mode: "0644"
with_items:
- access.log
- error.log
- name: "Install userlogrotate (jessie)"
copy:
src: userlogrotate_jessie
dest: /etc/cron.weekly/userlogrotate
mode: "0755"
when: ansible_lsb.codename == "jessie"
- name: "Install userlogrotate (Debian 9 or later)"
copy:
src: userlogrotate
dest: /etc/cron.weekly/userlogrotate
mode: "0755"
when: ansible_distribution_major_version | version_compare('9', '>=')
- name: Force DIR_MODE to 0750 in /etc/adduser.conf
lineinfile:
dest: /etc/adduser.conf
regexp: '^DIR_MODE='
line: 'DIR_MODE=0750'
- include: apache.yml
- include: phpmyadmin.yml
- include: awstats.yml
- include: fhs_retrictions.yml
when: packweb_fhs_retrictions
- name: Periodically cache ftp directory sizes for ftpadmin.sh
cron:
name: "ProFTPd directory size caching"
special_time: daily
job: "/usr/share/scripts/evoadmin/stats.sh"