Minor fixes and cleanup nextcloud role.
This commit is contained in:
parent
0a32f99552
commit
985cc477b5
5 changed files with 28 additions and 17 deletions
1
host_vars/blackbox.yml
Normal file
1
host_vars/blackbox.yml
Normal file
|
@ -0,0 +1 @@
|
|||
allow_download: True
|
1
host_vars/bluebox.yml
Normal file
1
host_vars/bluebox.yml
Normal file
|
@ -0,0 +1 @@
|
|||
allow_download: True
|
|
@ -4,3 +4,4 @@ nc_admin_pwd_file: "/root/nc-admin.pwd"
|
|||
www_root: "/var/www"
|
||||
nc_dir: "{{ www_root }}/nextcloud"
|
||||
data_dir: "/var/nc-data"
|
||||
allow_download: False
|
||||
|
|
|
@ -15,4 +15,4 @@
|
|||
name: nextcloudcron.timer
|
||||
state: started
|
||||
enabled: True
|
||||
listen: "enable nextcloudcron.service"
|
||||
listen: "enable nextcloudcron.timer"
|
||||
|
|
|
@ -1,4 +1,24 @@
|
|||
## Install and configure nextcloud
|
||||
## Install and configure nextcloud.
|
||||
|
||||
- name: check if we are installing
|
||||
stat: path="{{ nc_dir }}"
|
||||
register: nextcloud
|
||||
|
||||
- name: check for nextcloud archive
|
||||
local_action: stat path=nextcloud.tar.bz2
|
||||
become: No
|
||||
register: nc_archive
|
||||
when: not nextcloud.stat.exists
|
||||
|
||||
- name: stop if nextcloud archive is unavailable
|
||||
fail:
|
||||
msg: >
|
||||
The nextcloud archive nextcloud.tar.bz2 is not available.
|
||||
Download the latest stable release from 'nextcloud.com',
|
||||
check the signature, rename it and copy it next to 'cloudbox.yml'.
|
||||
when: not nextcloud.stat.exists and not nc_archive.stat.exists
|
||||
|
||||
## We can start with the installation now:
|
||||
|
||||
- name: install apache, php- and db-packages
|
||||
apt:
|
||||
|
@ -113,12 +133,7 @@
|
|||
owner: www-data
|
||||
group: www-data
|
||||
|
||||
|
||||
## install nextcloud:
|
||||
- name: check if we are installing
|
||||
stat: path="{{ nc_dir }}"
|
||||
register: nextcloud
|
||||
|
||||
- name: create database with name 'nextcloud'
|
||||
mysql_db:
|
||||
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||
|
@ -186,15 +201,7 @@
|
|||
with_items:
|
||||
- nextcloudcron.service
|
||||
- nextcloudcron.timer
|
||||
register: nextcloudcron
|
||||
notify: "enable nextcloudcron.service"
|
||||
|
||||
- name: switch to systemd timer
|
||||
command: sudo -u www-data php ./occ background:cron
|
||||
args:
|
||||
chdir: "{{ nc_dir }}"
|
||||
warn: False
|
||||
when: nextcloudcron.changed
|
||||
notify: "enable nextcloudcron.timer"
|
||||
|
||||
- name: check/run upgrade
|
||||
command: sudo -u www-data php updater.phar --no-interaction
|
||||
|
@ -203,6 +210,7 @@
|
|||
warn: False
|
||||
register: cmd_result
|
||||
changed_when: cmd_result.stdout is not search('Nothing to do.')
|
||||
when: allow_download
|
||||
|
||||
### app installations:
|
||||
- name: install extra apps
|
||||
|
@ -216,7 +224,7 @@
|
|||
register: cmd_result
|
||||
changed_when: cmd_result.stdout is not search('already installed')
|
||||
failed_when: cmd_result.stdout is not search('already installed') and cmd_result.rc != 0
|
||||
|
||||
when: allow_download
|
||||
|
||||
## ToDo kerberox integration:
|
||||
# sudo -u www-data php ./occ app:enable user_ldap
|
||||
|
|
Loading…
Add table
Reference in a new issue