]> git.phdru.name Git - ansible.git/blob - playbooks/debian/roles/apache/tasks/main.yml
5cd209acc7f0a7ebd876d87ef18803ce83e58e96
[ansible.git] / playbooks / debian / roles / apache / tasks / main.yml
1 - name: Check apache
2   stat:
3     path: /etc/apache2/conf-enabled/001-phd.conf
4   register: phd_conf
5   changed_when: not phd_conf.stat.exists
6
7 - debug:
8     msg: "apache has already been configured"
9   when: phd_conf.stat.exists
10
11 - name: Install apache
12   become: true
13   apt:
14     autoclean: yes
15     autoremove: yes
16     install_recommends: no
17     name: apache2
18     purge: yes
19     state: latest
20     update_cache: yes
21   when: not phd_conf.stat.exists
22
23 - name: Enable SSL module
24   become: true
25   command: a2enmod ssl
26   notify: Reload apache
27   when: not phd_conf.stat.exists
28
29 - name: Configure apache
30   become: true
31   template:
32     src: 001-phd.conf
33     dest: /etc/apache2/conf-available
34     owner: root
35     group: root
36     mode: '0640'
37     force: no
38   when: not phd_conf.stat.exists
39
40 - name: Enable config
41   become: true
42   command: a2enconf 001-phd
43   notify: Reload apache
44   when: not phd_conf.stat.exists
45
46 - name: Configure logrotate
47   become: true
48   copy:
49     src: apache2
50     dest: /etc/logrotate.d
51     owner: root
52     group: root
53     mode: '0640'