mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 03:32:12 +00:00
Update nextcloud_enabled.yml
This commit is contained in:
parent
fe601de121
commit
4fcbd1c922
1 changed files with 14 additions and 10 deletions
|
@ -4,7 +4,7 @@
|
||||||
nextcloud_required_ip: "{{ ansible_default_ipv4.network }}/{{ ansible_default_ipv4.netmask }}"
|
nextcloud_required_ip: "{{ ansible_default_ipv4.network }}/{{ ansible_default_ipv4.netmask }}"
|
||||||
when: ansible_default_ipv4.network is defined
|
when: ansible_default_ipv4.network is defined
|
||||||
|
|
||||||
- name: Enable Nextcloud by copying template to httpd config
|
- name: Install Apache's nextcloud.conf from template, for http://box/nextcloud
|
||||||
template:
|
template:
|
||||||
src: nextcloud.conf.j2
|
src: nextcloud.conf.j2
|
||||||
dest: "/etc/{{ apache_config_dir }}/nextcloud.conf"
|
dest: "/etc/{{ apache_config_dir }}/nextcloud.conf"
|
||||||
|
@ -13,20 +13,20 @@
|
||||||
mode: 0644
|
mode: 0644
|
||||||
when: nextcloud_enabled
|
when: nextcloud_enabled
|
||||||
|
|
||||||
- name: Enable Nextcloud (debuntu)
|
- name: Create symlink from sites-available to sites-enabled for http://box/nextcloud (debuntu)
|
||||||
file:
|
file:
|
||||||
path: /etc/apache2/sites-enabled/nextcloud.conf
|
path: /etc/apache2/sites-enabled/nextcloud.conf
|
||||||
src: /etc/apache2/sites-available/nextcloud.conf
|
src: /etc/apache2/sites-available/nextcloud.conf
|
||||||
state: link
|
state: link
|
||||||
when: nextcloud_enabled and is_debuntu
|
when: nextcloud_enabled and is_debuntu
|
||||||
|
|
||||||
- name: Remove the config file if not nextcloud_enabled (redhat)
|
- name: Remove nextcloud.conf if not nextcloud_enabled (redhat)
|
||||||
file:
|
file:
|
||||||
path: "/etc/{{ apache_config_dir }}/nextcloud.conf"
|
path: "/etc/{{ apache_config_dir }}/nextcloud.conf"
|
||||||
state: absent
|
state: absent
|
||||||
when: not nextcloud_enabled and is_redhat
|
when: not nextcloud_enabled and is_redhat
|
||||||
|
|
||||||
- name: Restart Apache, so it picks up the new aliases
|
- name: Restart Apache, enabling http://box/nextcloud
|
||||||
service:
|
service:
|
||||||
name: "{{ apache_service }}"
|
name: "{{ apache_service }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
@ -34,9 +34,11 @@
|
||||||
# the install wizard does not succeed if already installed
|
# the install wizard does not succeed if already installed
|
||||||
- name: Determine if Nextcloud is installed
|
- name: Determine if Nextcloud is installed
|
||||||
shell: >
|
shell: >
|
||||||
sudo -u {{ apache_user }} php
|
#sudo -u {{ apache_user }}
|
||||||
'{{ nextcloud_prefix }}/nextcloud/occ' status |
|
php '{{ nextcloud_prefix }}/nextcloud/occ' status |
|
||||||
gawk '/installed:/ { print $3 }'
|
gawk '/installed:/ { print $3 }'
|
||||||
|
become: yes
|
||||||
|
become_user: {{ apache_user }}
|
||||||
register: returned
|
register: returned
|
||||||
|
|
||||||
- name: Run Nextcloud initial install wizard
|
- name: Run Nextcloud initial install wizard
|
||||||
|
@ -59,9 +61,11 @@
|
||||||
|
|
||||||
- name: Determine if Nextcloud user exists already
|
- name: Determine if Nextcloud user exists already
|
||||||
shell: >
|
shell: >
|
||||||
sudo -u {{ apache_user }} php
|
#sudo -u {{ apache_user }}
|
||||||
'{{ nextcloud_prefix }}/nextcloud/occ' user:list |
|
php '{{ nextcloud_prefix }}/nextcloud/occ' user:list |
|
||||||
grep {{ nextcloud_user }} | wc | cut -d' ' -f1
|
grep {{ nextcloud_user }} | wc | cut -d' ' -f1
|
||||||
|
become: yes
|
||||||
|
become_user: {{ apache_user }}
|
||||||
register: returned_count
|
register: returned_count
|
||||||
|
|
||||||
# nextcloud wants to make users rather than just mysql users and not done
|
# nextcloud wants to make users rather than just mysql users and not done
|
||||||
|
@ -74,8 +78,8 @@
|
||||||
--group="users" {{ nextcloud_user }}'
|
--group="users" {{ nextcloud_user }}'
|
||||||
when: nextcloud_enabled and returned_count == "0"
|
when: nextcloud_enabled and returned_count == "0"
|
||||||
|
|
||||||
- name: Remove Rewrite URL
|
- name: Remove overwrite.cli.url line (Rewrite URL) from /opt/nextcloud/config/config.php
|
||||||
lineinfile:
|
lineinfile:
|
||||||
regexp: "overwrite.cli.url"
|
regexp: "overwrite.cli.url"
|
||||||
state: absent
|
state: absent
|
||||||
dest: "{{ nextcloud_prefix }}/nextcloud/config/config.php"
|
path: "{{ nextcloud_prefix }}/nextcloud/config/config.php"
|
||||||
|
|
Loading…
Reference in a new issue