--- - name: Install the apache packages apt: pkg={{ item }} state=installed force=yes with_items: apache_packages tags: apache - name: Load the required modules apache2_module: name={{ item }} state=present with_items: apache_default_modules notify: apache2 reload tags: apache - name: Remove the default virtualhost file file: dest=/etc/apache2/sites-enabled/{{ item }} state=absent with_items: - 000-default - 000-default.conf notify: apache2 reload tags: apache