X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=playbooks%2Fdebian%2Froles%2Fapache%2Ftasks%2Fmain.yml;h=0d81b0aeed4a9789a1bb47772799a4059a331acf;hb=5066f85b3351fd1cb53e5fe9d484644387fc1ddc;hp=5cd209acc7f0a7ebd876d87ef18803ce83e58e96;hpb=6d82309ce9774f0e8e31947186740cdaccea6ecc;p=ansible.git diff --git a/playbooks/debian/roles/apache/tasks/main.yml b/playbooks/debian/roles/apache/tasks/main.yml index 5cd209a..0d81b0a 100644 --- a/playbooks/debian/roles/apache/tasks/main.yml +++ b/playbooks/debian/roles/apache/tasks/main.yml @@ -8,39 +8,47 @@ msg: "apache has already been configured" when: phd_conf.stat.exists -- name: Install apache - become: true - apt: - autoclean: yes - autoremove: yes - install_recommends: no - name: apache2 - purge: yes - state: latest - update_cache: yes - when: not phd_conf.stat.exists +- block: + - name: Install apache + become: true + apt: + autoclean: yes + autoremove: yes + cache_valid_time: 3600 + install_recommends: no + name: apache2 + state: latest + update_cache: yes -- name: Enable SSL module - become: true - command: a2enmod ssl - notify: Reload apache - when: not phd_conf.stat.exists + - name: Enable SSL module + become: true + command: a2enmod ssl + notify: Reload apache -- name: Configure apache - become: true - template: - src: 001-phd.conf - dest: /etc/apache2/conf-available - owner: root - group: root - mode: '0640' - force: no - when: not phd_conf.stat.exists + - name: Configure apache + become: true + template: + src: 001-phd.conf + dest: /etc/apache2/conf-available + owner: root + group: root + mode: '0640' + force: no -- name: Enable config - become: true - command: a2enconf 001-phd - notify: Reload apache + - name: Setup default host + become: true + copy: + src: _default_ + dest: /usr/local/apache2 + owner: root + group: www-data + directory_mode: '0755' + mode: '0644' + + - name: Enable config + become: true + command: a2enconf 001-phd + notify: Reload apache when: not phd_conf.stat.exists - name: Configure logrotate