--- - name: apache2 modules apache2_module: name: "{{ item }}" state: present with_items: - ssl - rewrite - env notify: restart apache2 - name: apache2 nextcloud vhost template: src: apache-vhost.conf.j2 dest: /etc/apache2/sites-available/nextcloud.conf notify: restart apache2 - name: apache2 nextcloud vhost enabled file: src: ../sites-available/nextcloud.conf dest: /etc/apache2/sites-enabled/nextcloud.conf state: link notify: restart apache2 - name: apache2 ports template: src: apache2-ports.conf.j2 dest: /etc/apache2/ports.conf notify: restart apache2 - name: start apache2 service: name: apache2 state: started