vm-ansible/roles/webserver/tasks/main.yaml

29 lines
518 B
YAML

---
- 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
- name: Allow https port via ufw
community.general.ufw:
rule: allow
port: https