1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Refine @jvonau\'s \'Move NGINX shims to roles\'

This commit is contained in:
root 2020-01-12 12:12:49 -05:00
parent ef93b30370
commit fff83cd5fb
22 changed files with 223 additions and 271 deletions

View file

@ -1,47 +1,39 @@
# This should go in computed_network.yml, but here for now
#- name: Compute Nextcloud listen ip addr for nextcloud.conf
# set_fact:
# nextcloud_required_ip: "{{ ansible_default_ipv4.network }}/{{ ansible_default_ipv4.netmask }}"
# when: ansible_default_ipv4.network is defined
# Apache
- name: Create symlink nextcloud.conf from sites-enabled to sites-available for http://box/nextcloud (debuntu)
file:
src: "/etc/{{ apache_config_dir }}/nextcloud.conf"
path: /etc/apache2/sites-enabled/nextcloud.conf
state: link
when: nextcloud_enabled and is_debuntu
- name: Enable http://box{{ nextcloud_url }} via Apache # http://box/nextcloud
command: a2ensite nextcloud.conf
when: apache_install and nextcloud_enabled
- name: Remove symlink nextcloud.conf from /etc/apache2/sites-enabled if not nextcloud_enabled (debuntu)
file:
path: /etc/apache2/sites-enabled/nextcloud.conf
state: absent
when: not nextcloud_enabled and is_debuntu
- name: Disable http://box{{ nextcloud_url }} via Apache # http://box/nextcloud
command: a2dissite nextcloud.conf
when: apache_install and not nextcloud_enabled
- name: Remove sites-available/nextcloud.conf if not nextcloud_enabled (redhat)
file:
path: "/etc/{{ apache_config_dir }}/nextcloud.conf"
state: absent
when: not nextcloud_enabled and is_redhat
- name: Install Nextcloud's nginx conf.d file from template
template:
src: nextcloud-nginx.conf
dest: "{{ nginx_config_dir }}/nextcloud-nginx.conf"
when: nextcloud_enabled and nginx_enabled
- name: Restart {{ apache_service }}, enabling/disabling http://box/nextcloud
- name: Restart Apache systemd service ({{ apache_service }})
systemd:
name: "{{ apache_service }}"
daemon-reload: yes
state: restarted
when: apache_enabled | bool
- name: Restart nginx enabling/disabling http://box/nextcloud
# NGINX
- name: "SHIM: Enable http://box{{ nextcloud_url }} via NGINX, by installing {{ nginx_config_dir }}/nextcloud-nginx.conf from template" # http://box/nextcloud
template:
src: nextcloud-nginx.conf.j2
dest: "{{ nginx_config_dir }}/nextcloud-nginx.conf"
when: nginx_install and nextcloud_enabled
- name: "SHIM: Disable http://box{{ nextcloud_url }} via NGINX, by removing {{ nginx_config_dir }}/nextcloud-nginx.conf" # http://box/nextcloud
file:
path: "{{ nginx_config_dir }}/nextcloud-nginx.conf"
state: absent
when: nginx_install and not nextcloud_enabled
- name: Restart 'nginx' systemd service
systemd:
name: nginx
daemon-reload: yes
state: restarted
when: nginx_enabled
when: nginx_enabled | bool
- name: Add 'nextcloud' variable values to {{ iiab_ini_file }}
ini_file: