X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=playbooks%2Fdebian%2Froles%2Fapache%2Ftasks%2Fmain.yml;h=a5b662a36e9ccd94311bed8d017ccdb98c8271dc;hb=2e89ce86ff469b61661a0c7335b75ba6d5bcf05f;hp=f0481d91e1c0a80fcef3672125f20fc8d3602edd;hpb=9801f9b6a2732043a4643d02554defdd474ce63e;p=ansible.git diff --git a/playbooks/debian/roles/apache/tasks/main.yml b/playbooks/debian/roles/apache/tasks/main.yml index f0481d9..a5b662a 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: phd_conf.stat.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.stat.exists - name: Enable SSL module become: true command: a2enmod ssl notify: Reload apache - when: apache.rc != 0 + when: not phd_conf.stat.exists - name: Configure apache become: true @@ -35,13 +34,13 @@ group: root mode: '0640' force: no - when: apache.rc != 0 + when: not phd_conf.stat.exists - name: Enable config become: true command: a2enconf 001-phd notify: Reload apache - when: apache.rc != 0 + when: not phd_conf.stat.exists - name: Configure logrotate become: true