- name: Check apache
- command: test -L /etc/apache2/conf-enabled/001-phd.conf
- failed_when: false
- register: apache
- changed_when: apache.rc != 0
+ stat:
+ path: /etc/apache2/conf-enabled/001-phd.conf
+ register: phd_conf
- debug:
msg: "apache has already been configured"
- when: apache.rc == 0
+ when: not phd_conf.stats.exists
- name: Install apache
become: true
purge: yes
state: latest
update_cache: yes
- when: apache.rc != 0
+ when: not phd_conf.stats.exists
- name: Enable SSL module
become: true
command: a2enmod ssl
notify: Reload apache
- when: apache.rc != 0
+ when: not phd_conf.stats.exists
- name: Configure apache
become: true
group: root
mode: '0640'
force: no
- when: apache.rc != 0
+ when: not phd_conf.stats.exists
- name: Enable config
become: true
command: a2enconf 001-phd
notify: Reload apache
- when: apache.rc != 0
+ when: not phd_conf.stats.exists
+
+- name: Configure logrotate
+ become: true
+ copy:
+ src: apache2
+ dest: /etc/logrotate.d
+ owner: root
+ group: root
+ mode: '0640'