add ansible roles

This commit is contained in:
Petar Cubela
2025-08-08 11:43:31 +02:00
parent 93917b9483
commit b5a412c14e
17 changed files with 288 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
- name: Set hostname
ansible.builtin.hostname:
name: "{{ hostname }}"
- name: "Enable recommended Apache Modules."
apache2_module: "name={{ item }} state=present"
with_items:
- dir
- env
- headers
- mime
- rewrite
- setenvif
notify: restart apache
- name: Add Apache virtualhost for Nextcloud
template:
src: "templates/{{ site_conf }}.j2"
dest: "/etc/apache2/sites-available/{{ site_conf }}"
owner: root
group: root
mode: 0644
notify: restart apache
- name: Enable the Nextcloud site.
command: >
a2ensite {{ site_conf }}
creates="/etc/apache2/sites-enabled/{{ site_conf }}"
notify: restart apache
- name: Disable the default site.
command: >
a2dissite 000-default
removes=/etc/apache2/sites-enabled/000-default.conf
notify: restart apache