nextcloud

Install and configure Nextcloud instances.

Table of Contents

  1. Description
  2. Setup - The basics of getting started with nextcloud
  3. Usage - Configuration options and additional functionality
  4. Limitations - OS compatibility, etc.
  5. Development - Guide for contributing to the module

Description

The module installs and configures Nextcloud. It can also extend Nextcloud by installing applications from Nextcloud store.

The 1.X versions of this module permit to install several instances of Nexcloud on a same node. But this feature is removed for version 2.x. It is now only be possible to install one instance on a node.

Setup

What nextcloud affects

This module downloads Nextcloud and applications listed in additional_apps. Nextcloud can be extended by awesome apps. Perhaps the following list can be interesting for you : polls, calendar, unsplash, deck, tasks, contacts, forms, groupfolders, terms_of_service, spreed.

This module can install php packages provided by OS and enable caching with redis.

Some settings can be defined like the datadirectory. This path stores all uploaded files by users. It will grow up.

Setup Requirements

The cron service have to be enabled. And with Puppet 6, you have to install one more dependency puppetlabs-cron_core.

Before using this module you have to configure a database somewhere.

You will also have to setup a web server, you can use puppet-nginx or puppetlabs-apache.

If you prefer using PHP with FMP, you have to set manage_phplibs to false. You can then have a look to puppet-php module.

Beginning with nextcloud

To install Nextcloud on the Puppet node :

  class { 'nextcloud' :
    database_name     => 'nextcloud_example',
    database_user     => 'user_example',
    database_password => 'secret',
    system_user       => 'www-data',
    config            => {
      trusted_domains => [
        'localhost',
        'cloud.example.com',
      ],
    }
  }

Usage

During the install process one administrator account is created named admin, with password changeme.

The application is installed in /var/nextcloud-app. The data uploaded by users is, by default, in /var/nextcloud-data and can be modified by parameter $config::datadirectory. If you modify the datadirectory path, the configuration will be updated but the data will not be moved and will stay in the previous path.

All config settings handled by parameter $config makes accordingly updates into file config.php. But removing a setting from $config does not remove it from config.php (ensure => absent does not exists).

The default values of $config settings are following :

    'datadirectory'        => '/var/nextcloud-data',
    'trusted_domains'      => ['localhost', $facts['networking']['fqdn']],
    'memcache.local'       => '\OC\Memcache\Redis',
    'memcache.distributed' => '\OC\Memcache\Redis',
    'memcache.locking'     => '\OC\Memcache\Redis',
    'filelocking.enabled'  => true,
    'redis'                => {
      'host'    => '127.0.0.1',
      'port'    => 6379,
      'timeout' => '1.5',
    },

Configure an instance with mail with STARTTLS connexion on smtp server :

  class { 'nextcloud' :
    database_name     => 'nextcloud_example',
    database_user     => 'user_example',
    database_password => 'secret',
    admin_password    => 'secret',
    system_user       => 'www-data',
    config            => {
      trusted_domains     => [
        'localhost',
        'cloud.example.com',
      ],
      'mail_smtpmode'     => 'smtp',
      'mail_smtphost'     => 'smtp.example.com',
      'mail_smtpport'     => 425,
      'mail_smtpsecure'   => 'tls',
      'mail_smtpauth'     => true,
      'mail_smtpauthtype' => 'LOGIN',
      'mail_smtpname'     => 'username',
      'mail_smtppassword' => 'password',
    }
  }

See more details in mail settings Nextcloud Configuration > Email

You can also have a look to custom Puppet data type Nextcloud::Config in REFERENCE.md.

Notes about upgrade from 1.x to 2.x

If you are using this module in version 1.x to configure several instances of Nextcloud on the same Puppet node, this is no longer possible with the version 2.x and higher.

To upgrade this Puppet module applied on a running node, you can :

  • disable temporary the Puppet agent with puppet agent --disable,
  • stop the web server,
  • rename the directory /var/nextcloud-<fqdn>-<version> into /var/nextcloud-app,
  • upgrade Puppet module from 1.x to 2.x (warning: default value of version is changed),
  • check that all is ready with puppet agent --test --noop,
  • re-enable the Puppet agent with puppet agent --enable.

Reference

Details in REFERENCE.md.

Limitations

Compatible OSes, dependencies and Puppet versions supported are given in metadata.json.

Development

You can get some guidance in CONTRIBUTING.md.

Release Notes/Contributors/Etc.

All notable changes to this module are documented in CHANGELOG.md.

This module puppet-nextcloud is maintained by ADULLACT, it was written by Fabien 'Dan33l' Combernous.