--- - name: "Install Apache via apt" apt: update_cache: yes state: present name: - apache2 - name: Upload site config to destination copy: src: apache-site.conf dest: /etc/apache2/sites-available/site.conf mode: 644 owner: root - name: Enable site command: a2ensite site.conf - name: Enable and restart Apache2 daemon service: name: apache2 state: restarted enabled: yes