]> git.phdru.name Git - ansible.git/blob - playbooks/debian/roles/apache/tasks/main.yml
f0481d91e1c0a80fcef3672125f20fc8d3602edd
[ansible.git] / playbooks / debian / roles / apache / tasks / main.yml
1 - name: Check apache
2   command: test -L /etc/apache2/conf-enabled/001-phd.conf
3   failed_when: false
4   register: apache
5   changed_when: apache.rc != 0
6
7 - debug:
8     msg: "apache has already been configured"
9   when: apache.rc == 0
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: apache.rc != 0
22
23 - name: Enable SSL module
24   become: true
25   command: a2enmod ssl
26   notify: Reload apache
27   when: apache.rc != 0
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: apache.rc != 0
39
40 - name: Enable config
41   become: true
42   command: a2enconf 001-phd
43   notify: Reload apache
44   when: apache.rc != 0
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'