X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=playbooks%2Fdebian%2Froles%2Fapache%2Ftasks%2Fmain.yml;h=b289d9419d2223378b721663adca2ff167b6c2dd;hb=32266b707ada32788d608fa6fbe7f1de623f2755;hp=1c6bd2f7848262a3ac5f25e126ad9caa08d39516;hpb=64f279e592bc291ea76ff9e2246f1fc1760c6e83;p=ansible.git diff --git a/playbooks/debian/roles/apache/tasks/main.yml b/playbooks/debian/roles/apache/tasks/main.yml index 1c6bd2f..b289d94 100644 --- a/playbooks/debian/roles/apache/tasks/main.yml +++ b/playbooks/debian/roles/apache/tasks/main.yml @@ -1,12 +1,11 @@ - 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 @@ -18,13 +17,13 @@ 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 @@ -35,10 +34,19 @@ 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'