---
- name: Ensure Apache2 and modules are installed and up to date
apt:
name:
- apache2
state: latest
- name: Ensure necessary modules are enabled
apache2_module:
name: "{{ item }}"
state: present
with_items:
- rewrite
- ssl