- name: Set hostname ansible.builtin.hostname: name: "{{ hostname }}" - name: "Enable recommended Apache Modules." apache2_module: "name={{ item }} state=present" with_items: - dir - env - headers - mime - rewrite - setenvif notify: restart apache - name: Add Apache virtualhost for Owncloud template: src: "templates/owncloud.dav.conf.j2" dest: "/etc/apache2/sites-available/owncloud.dav.conf" owner: root group: root mode: 0644 notify: restart apache - name: Enable the ownCloud site. command: > a2ensite owncloud.dav creates=/etc/apache2/sites-enabled/owncloud.dav.conf notify: restart apache - name: Disable the default site. command: > a2dissite 000-default removes=/etc/apache2/sites-enabled/000-default.conf notify: restart apache