Ansible Role that sets up Nextcloud with Nginx and PHP on an Ubuntu/Debian server. Designed to not handle DB install and HTTPS setup. So this role is uesefull when running behind a Loabalancer that takes care of HTTPs termination already. Also if you want to run your DB on another host, this role doesn't preinstall a DB for you.
If you want to setup a DB on that host just use another Ansible role for Postgres or MySQL. For example there is mediafellows.postgresql.
This role installs PHP dependencies and installs the PHP runner FastCGI Process Manager (FPM). It also utilizes mediafellows.nginx role for installing Ngxinx as a Websterver.
Linux Distribution with apt package manager. Ideally newer versions (like Ubuntu 18.04) that provide php7.2 as part of their repos.
Role variables that make sense to override to your needs (shows default settings here):
nextcloud_version: 19.0.0
- Nextcloud version to install, pick one that can be downloaded from download server alreadynextcloud_php_version: 7.4
- PHP version to installnextcloud_db_type: pgsql
- DB type to use for Nextcloud. Either 'mysql', 'pgsql' (for Postgres) or 'sqlite' (untested).nextcloud_db_user: nextcloud
- User for connecting to DBnextcloud_db_pass: 1231231
- PW for DB accessnextcloud_install_dir: /opt/nextcloud
- Install dir where Nextcloud will be unpackednextcloud_initial_user_name: admin
- Set username for initial admin usernextcloud_initial_user_pw: 'foobar'
- Set PW for initial admin user for your Nextcloud setup (for first login)
Find more variables in defaults/main.yml
Depends on the mediafellows.nginx role for setting up the Webserver:
Example playbook integration
- name: Install Nextcloud
hosts: nextcloud_hosts
become: true
vars:
nextcloud_version: 19.0.0
nextcloud_install_dir: /opt/nextcloud/
nextcloud_initial_user_name: admin
nextcloud_initial_user_pw: abc123abc
nextcloud_db_pass: 'nextcloud-db-pw'
roles:
- mediafellows.nextcloud
BSD
Stefan Horning [email protected]