Skip to content

Latest commit

 

History

History
477 lines (267 loc) · 10.9 KB

REFERENCE.md

File metadata and controls

477 lines (267 loc) · 10.9 KB

Reference

Table of Contents

Classes

Public Classes

Private Classes

  • nextcloud::app_config: Set configuration options for Nextcloud apps
  • nextcloud::apps: Manage Nextcloud apps
  • nextcloud::config: Set configuration options for Nextcloud
  • nextcloud::cron: Configure background cron jobs for Nextcloud
  • nextcloud::hpb: Configure Nextcloud's High Performance Back-end (HPB)
  • nextcloud::install: Download and extract the distribution archive
  • nextcloud::pre_install: Pre installation tasks
  • nextcloud::update: Perform required tasks to update Nextcloud

Defined types

Functions

Classes

nextcloud

Install and manage Nextcloud

Parameters

The following parameters are available in the nextcloud class.

admin_password

Data type: String

Specifies the initial password for the Nextcloud admin user.

admin_user

Data type: String

Specifies the username for the Nextcloud admin.

apps

Data type: Hash

Specifies a list of Nextcloud apps and their desired state.

app_config

Data type: Hash

A hash containing configuration options for Nextcloud apps. The hash should be in the format: { 'my_app_name' => { 'setting1' => 'xyz123', 'setting2' => 'blah', }, }

command_timeout

Data type: Integer

Specifies the time to wait for install/update/maintenance commands to complete. Keep in mind that several commands may take a few hours to complete, depending on the size of your installation.

config

Data type: Hash

A hash containing configuration options for Nextcloud.

cronjobs

Data type: Hash

Specifies a list of cron jobs that should be added when $manage_cron is enabled.

datadir

Data type: Stdlib::Compat::Absolute_path

Specifies the directory where Nextcloud will store user data. It MUST reside outside of Nextcloud's installation directory.

datastatefile

Data type: Stdlib::Compat::Absolute_path

A file that is required by the module to work properly. This value MUST NOT be changed, because the path is hardcoded in several places.

date_expression

Data type: String

A date command that will be used when checking if $post_update_cmd should be executed.

db_driver

Data type: String

The database driver that Nextcloud should use.

db_host

Data type: String

The database host that Nextcloud should use.

db_name

Data type: String

The database name that Nextcloud should use.

db_password

Data type: String

The database password that Nextcloud should use.

db_user

Data type: String

The database user that Nextcloud should use.

debug

Data type: Boolean

Whether to enable additional output for debugging purposes.

hpb_app

Data type: String

Specifies the name of the HPB app to be installed.

hpb_binary

Data type: String

Specifies the relative path to the binary of the HPB app.

hpb_pidfile

Data type: Stdlib::Compat::Absolute_path

Specifies the PID file for the HPB service.

hpb_port

Data type: Integer

Specifies the port for the HPB service.

hpb_service_config_file

Data type: Stdlib::Compat::Absolute_path

Specifies the full path to the HPB service config file.

hpb_service_ensure

Data type: Enum['running', 'stopped']

Specifies the desired state of the HPB service.

hpb_service_file

Data type: Stdlib::Compat::Absolute_path

Specifies the full path to the HPB service definition / startup script.

hpb_service_mode

Data type: String

Specifies the file mode for the HPB service definition / startup script.

hpb_service_name

Data type: String

Specifies the name for the HPB service.

install_enabled

Data type: Boolean

Whether to download and extract the release distribution files, switch the symlink to the specified release. On new installs it also runs the required PHP commands to install Nextcloud. When disabled these commands need to be run manually and some features may not work as expected (not recommended).

installroot

Data type: Stdlib::Compat::Absolute_path

Specifies the base directory where Nextcloud should be installed. A new subdirectory for each version will be created.

manage_apps

Data type: Boolean

Whether to manage Nextcloud apps. They can be installed, removed, enabled or disabled.

manage_cron

Data type: Boolean

Whether to manage Nextcloud's background cron job(s).

manage_hpb

Data type: Boolean

Whehter to manage Nextcloud's notify_push app, the High Performance Back-end (HPB).

manage_php

Data type: Boolean

Whether to setup and maintain PHP (FPM/CLI) and install modules needed for Nextcloud.

manage_redis

Data type: Boolean

Whether to setup and maintain a local Redis server.

manage_symlink

Data type: Boolean

Whether to maintain a symlink for the current version of Nextcloud. This must be enabled for the module to work as expected.

mirror

Data type: Variant[Stdlib::HTTPUrl,Stdlib::HTTPSUrl]

Specifies the base URL where the distribution archive can be downloaded.

path

Data type: String

Specifies the content of the PATH environment variable when running commands.

php_extensions

Data type: Hash

Specifies a list of PHP extensions that should be installed when $manage_php is enabled.

post_update_cmd

Data type: String

An optional command that should be executed after performing an update.

service_provider

Data type: Enum['rc', 'systemd']

The operating system's service manager.

stat_expression

Data type: String

A stat command that will be used when checking if $post_update_cmd should be executed.

statefile

Data type: Stdlib::Compat::Absolute_path

A file that is required by the module to work properly. This value MUST NOT be changed, because the path is hardcoded in several places.

symlink_name

Data type: String

Specifies the name of the symlink. This is considered to represent Nextcloud's home directory. It should be used as DocumentRoot and MUST NOT be changed after completing the Nextcloud installation.

system_group

Data type: String

Specifies the name of the group that is used by the webserver and/or PHP FPM. It will be used to set proper file permission for Nextcloud.

system_user

Data type: String

Specifies the name of the user that is used by the webserver and/or PHP FPM. It will be used as owner for the Nextcloud installation files and it will be used to run optional commands.

update_enabled

Data type: Variant[Boolean, Enum['none']]

Whether to run the required PHP commands to update Nextcloud. When disabled, these commands need to be run manually and some features may not work as expected. Note that this does NOT prevent the module from switching the installation directory to a newer version, it just skips the execution of Nextcloud's update commands. To completely disable all updates, the parameter should be set to none (not recommended).

update_host

Data type: Optional[String]

Optional parameter to specify the FQDN of the host where all critical operations should be performed. This includes operations such as the initial installation, update installations, config commands and all app commands. Limiting these operations to a single host should prevent race conditions.

Default value: undef

version

Data type: String

Specifies the version of Nextcloud that should be installed.

Defined types

nextcloud::app_command

Run a command for a Nextcloud app

Parameters

The following parameters are available in the nextcloud::app_command defined type.

app

Data type: String

The name of the app.

Default value: $title

command

Data type: Enum['install','remove','enable','disable','install_disable','post_update']

The app command that should be executed.

nextcloud::config_command

Set or remove a single configuration value

Parameters

The following parameters are available in the nextcloud::config_command defined type.

key

Data type: Variant[Boolean, Integer, String]

The configuration key that should be altered. If prefixed with DELETE: then the key will be completely removed from configuration.

Default value: $title

section

Data type: Enum['app', 'system']

Specifies whether it is a system or app configuration value.

Default value: 'system'

value

Data type: Variant[Boolean, Integer, String]

The configuration value that should be set.

verify_key

Data type: Variant[Boolean, Integer, String]

The configuration key to find out whether it needs to be altered.

verify_value

Data type: Variant[Boolean, Integer, String]

The configuration verify to find out whether it needs to be altered.

nextcloud::install::distribution

Download and extract the distribution archive

Parameters

The following parameters are available in the nextcloud::install::distribution defined type.

id

Data type: Optional[String]

An optional identifier that can be used to prevent the archive job from being executed multiple times by remembering its state. This is most useful to distinguish between an initial install and an update.

Default value: undef

Functions

nextcloud::create_config_resources

Type: Puppet Language

Create nextcloud::config_command resources from a nested hash, suitable for conveniently loading values from hiera. The key-value pairs from the hash represent config keys and values passed to nextcloud::config_command for simple values, Hash and Array values recursively # create nested sections.

nextcloud::create_config_resources(Hash[String, NotUndef] $config_hash, Array[String] $sections = [])

Create nextcloud::config_command resources from a nested hash, suitable for conveniently loading values from hiera. The key-value pairs from the hash represent config keys and values passed to nextcloud::config_command for simple values, Hash and Array values recursively # create nested sections.

Returns: Any

config_hash

Data type: Hash[String, NotUndef]

A hash of (non-hierarchical) key names mapped to values.

sections

Data type: Array[String]

The section names of the hierarchical key, will usually only be specified on recursive calls from within this function itself.