--- - name: Enable proxy modules become: true community.general.apache2_module: name: "{{ item }}" state: present with_items: - proxy - proxy_http notify: Reload apache2 service - name: Copy vHost conf become: true ansible.builtin.template: src: apache2/git.tunuifranken.info.conf.j2 dest: /etc/apache2/sites-available/git.tunuifranken.info.conf mode: 0644 notify: Reload apache2 service - name: Activate vHost become: true ansible.builtin.command: a2ensite git.tunuifranken.info.conf register: result changed_when: "'already enabled' not in result.stdout" notify: Reload apache2 service