mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Update main.yml
This commit is contained in:
parent
114a3f7b84
commit
3b99ff697d
1 changed files with 26 additions and 25 deletions
|
@ -1,17 +1,18 @@
|
||||||
- name: See if Nextcloud version page exists
|
- name: Check for existence of /opt/nextcloud/version.php
|
||||||
stat:
|
stat:
|
||||||
path: "{{ nextcloud_prefix }}/nextcloud/version.php"
|
path: "{{ nextcloud_prefix }}/nextcloud/version.php"
|
||||||
# path: "{{ nextcloud_prefix }}/nextcloud/index.php"
|
|
||||||
register: nextcloud_page
|
register: nextcloud_page
|
||||||
|
|
||||||
- name: FORCE INSTALL OR REINSTALL OR UPGRADE IF /opt/nextcloud/version.php DOESN'T EXIST
|
- name: FORCE INSTALL OR REINSTALL OR UPGRADE IF {{ nextcloud_prefix }}/nextcloud/version.php DOESN'T EXIST
|
||||||
set_fact:
|
set_fact:
|
||||||
nextcloud_force_install: True
|
nextcloud_force_install: True
|
||||||
when: not nextcloud_page.stat.exists
|
when: not nextcloud_page.stat.exists
|
||||||
|
|
||||||
# - debug:
|
# - debug:
|
||||||
# msg: "nextcloud_force_install: {{ nextcloud_force_install }}"
|
# var: nextcloud_force_install
|
||||||
|
|
||||||
|
# - debug:
|
||||||
|
# msg: "nextcloud_force_install: {{ nextcloud_force_install }}"
|
||||||
|
|
||||||
- name: Download {{ nextcloud_dl_url }}/{{ nextcloud_orig_src_file }} to {{ downloads_dir }}/{{ nextcloud_src_file }}
|
- name: Download {{ nextcloud_dl_url }}/{{ nextcloud_orig_src_file }} to {{ downloads_dir }}/{{ nextcloud_src_file }}
|
||||||
get_url:
|
get_url:
|
||||||
|
@ -89,13 +90,13 @@
|
||||||
#creates: "{{ nextcloud_prefix }}/nextcloud/version.php"
|
#creates: "{{ nextcloud_prefix }}/nextcloud/version.php"
|
||||||
when: nextcloud_force_install
|
when: nextcloud_force_install
|
||||||
|
|
||||||
- name: In CentOS, the following config dir is symlink to /etc/nextcloud
|
- name: Create dir /etc/nextcloud (centos) for a subsequent config dir that's symlinked to /etc/nextcloud ?
|
||||||
file:
|
file:
|
||||||
path: /etc/nextcloud
|
path: /etc/nextcloud
|
||||||
state: directory
|
state: directory
|
||||||
when: is_centos
|
when: is_centos
|
||||||
|
|
||||||
- name: Add autoconfig file (CentOS)
|
- name: Install {{ nextcloud_prefix }}/nextcloud/config/autoconfig.php from template (centos)
|
||||||
template:
|
template:
|
||||||
src: autoconfig.php.j2
|
src: autoconfig.php.j2
|
||||||
dest: "{{ nextcloud_prefix }}/nextcloud/config/autoconfig.php"
|
dest: "{{ nextcloud_prefix }}/nextcloud/config/autoconfig.php"
|
||||||
|
@ -104,7 +105,7 @@
|
||||||
mode: 0640
|
mode: 0640
|
||||||
when: is_centos
|
when: is_centos
|
||||||
|
|
||||||
- name: Make Apache owner
|
- name: chown -R {{ apache_user }}:{{ apache_user }} {{ nextcloud_prefix }}/nextcloud
|
||||||
file:
|
file:
|
||||||
path: "{{ nextcloud_prefix }}/nextcloud"
|
path: "{{ nextcloud_prefix }}/nextcloud"
|
||||||
owner: "{{ apache_user }}"
|
owner: "{{ apache_user }}"
|
||||||
|
@ -112,22 +113,20 @@
|
||||||
recurse: yes
|
recurse: yes
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Create data directory library
|
- name: Create data directory {{ nextcloud_data_dir }} # /opt/nextcloud/data
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ nextcloud_data_dir }}"
|
||||||
owner: "{{ apache_user }}"
|
owner: "{{ apache_user }}"
|
||||||
group: "{{ apache_user }}"
|
group: "{{ apache_user }}"
|
||||||
mode: 0750
|
mode: 0750
|
||||||
state: directory
|
state: directory
|
||||||
with_items:
|
|
||||||
- "{{ nextcloud_data_dir }}"
|
|
||||||
|
|
||||||
- name: Create MySQL database {{ nextcloud_dbname }} for Nextcloud
|
- name: Create MySQL database {{ nextcloud_dbname }}
|
||||||
mysql_db:
|
mysql_db:
|
||||||
name: "{{ nextcloud_dbname }}"
|
name: "{{ nextcloud_dbname }}"
|
||||||
when: mysql_enabled and nextcloud_enabled
|
when: mysql_enabled and nextcloud_enabled
|
||||||
|
|
||||||
- name: Create username/password for Nextcloud database
|
- name: Add username/password to the MySQL database (associated with trusted IP's like localhost)
|
||||||
mysql_user:
|
mysql_user:
|
||||||
name: "{{ nextcloud_dbuser }}"
|
name: "{{ nextcloud_dbuser }}"
|
||||||
host: "{{ item }}"
|
host: "{{ item }}"
|
||||||
|
@ -140,17 +139,15 @@
|
||||||
- localhost
|
- localhost
|
||||||
when: mysql_enabled and nextcloud_enabled
|
when: mysql_enabled and nextcloud_enabled
|
||||||
|
|
||||||
|
# Appears unnec as nextcloud_enabled.yml (just below) does the same
|
||||||
|
#- name: Restart Apache
|
||||||
|
# service:
|
||||||
|
# name: "{{ apache_service }}"
|
||||||
|
# state: restarted
|
||||||
|
## when: nextcloud_enabled # taken care of by nextcloud_enabled.yml below
|
||||||
|
# when: not nextcloud_enabled
|
||||||
|
|
||||||
- name: Restart Apache, to enable/disable http://box/nextcloud
|
# Enables or disable Nextcloud!
|
||||||
service:
|
|
||||||
name: "{{ apache_service }}"
|
|
||||||
state: restarted
|
|
||||||
# when: nextcloud_enabled # taken care of by nextcloud_enabled.yml below
|
|
||||||
when: not nextcloud_enabled
|
|
||||||
|
|
||||||
# Enable nextcloud by copying template to httpd config
|
|
||||||
|
|
||||||
# following enables and disables
|
|
||||||
- include_tasks: nextcloud_enabled.yml
|
- include_tasks: nextcloud_enabled.yml
|
||||||
|
|
||||||
- name: Add 'nextcloud' to list of services at {{ iiab_ini_file }}
|
- name: Add 'nextcloud' to list of services at {{ iiab_ini_file }}
|
||||||
|
@ -166,7 +163,11 @@
|
||||||
value: '"NextCloud is a local server-based facility for sharing files, photos, contacts, calendars, etc."'
|
value: '"NextCloud is a local server-based facility for sharing files, photos, contacts, calendars, etc."'
|
||||||
- option: path
|
- option: path
|
||||||
value: "{{ nextcloud_prefix }}/nextcloud"
|
value: "{{ nextcloud_prefix }}/nextcloud"
|
||||||
- option: source
|
- option: nextcloud_force_install
|
||||||
|
value: "{{ nextcloud_force_install }}"
|
||||||
|
- option: nextcloud_orig_src_file
|
||||||
|
value: "{{ nextcloud_orig_src_file }}"
|
||||||
|
- option: nextcloud_src_file
|
||||||
value: "{{ nextcloud_src_file }}"
|
value: "{{ nextcloud_src_file }}"
|
||||||
- option: enabled
|
- option: nextcloud_enabled
|
||||||
value: "{{ nextcloud_enabled }}"
|
value: "{{ nextcloud_enabled }}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue