Default variable details
Some of debops.owncloud
default variables have more extensive
configuration than simple strings or lists, here you can find documentation and
examples for them.
owncloud__config
Dict keys can be overridden when they are present in multiple dicts. Order of priority from least to most specific:
Each variable can hold multiple keys and values. The dict value can either be a
value directly intended for ownCloud (corresponding directly to the value in
the config.php
file) or a dict itself in case more flexibility is
required. A ownCloud value can also be a dict. The decision is made based on
the presence of the value
and the state
keys. If both are present, the
state
key will be evaluated by Ansible.
Here are the available options of the inner dict:
value
Required, string. Corresponding to the value in the
config.php
file.state
Required, string. Allows to specify if the option should be
present
orabsent
in the configuration.
Note
Parameters with (backslash) need to be double escaped:
owncloud__config: memcache.local: '\\OC\\Memcache\\APCu'
This is not confirmed by the official ownCloud documentation but is a result of how the configuration file is generated using JSON as intermediate data format.
Refer to the official ownCloud documentation for details about the available configuration options.
Change/Disable skeleton files for new users (example)
The skeleton files which new users get copied into there ownCloud profile on
first login can be changed by the skeletondirectory
setting which points to
the skeleton directory to use.
In case users should primarily stored their files on external storage, it can make sense to not provided any skeleton files at all. This can be archived by putting:
owncloud__config:
## Points to the skeleton directory to use on first login of users.
## If this setting is an empty string, no files will be provided by default.
skeletondirectory: ''
into your Ansible inventory.
owncloud__user_files
This section describes the options of owncloud__user_files
and
similar lists.
Each list item is a dict with the following keys:
src
Path to the source file on the Ansible Controller. Alternatively you can use
content
to provide the file contents directly in the inventory.content
String or YAML text block with the file contents to put in the destination file. Alternatively you can use
src
to provide the path to the source file on Ansible Controller.dest
Required, string. Path of the destination. The first directory is the user id. Example:
user_id/files/path
. The destination on the remote host will beowncloud__data_path + "/" + item.dest
.state
Optional. If not specified, or if specified and
present
, the file(s) will be created. If specified andabsent
, file will be removed.
Additionally, all parameters of the Ansible ansible.builtin.copy module are supported.
The reason why these lists exist (instead of using debops.resources) is that ownCloud needs to be aware of any changes.
Examples
Provide an immutable README.md
file in the root directory of the ownCloud admin user:
owncloud__user_files_group:
- dest: '{{ owncloud__admin_username }}/files/README.md'
content: |
This ownCloud instance is managed by Ansible.
Changes done via the ownCloud web interface might be overwritten
by subsequent Ansible runs.
Refer to https://docs.debops.org/en/latest/ansible/roles/debops.owncloud/index.html for details.
owner: 'root'
group: 'root'
Provide an README.md
file in the project_a
subdirectory of the ownCloud admin user.
The project_a
directory will be created if it does not already exist.
The ownCloud admin user can change/delete the file and directory:
owncloud__user_files_group:
- dest: '{{ owncloud__admin_username }}/files/project_a/README.md'
content: |
File template.
Changes done to this file will be overwritten by subsequent Ansible runs.
owncloud__post_upgrade_hook_list
Each element of the owncloud__post_upgrade_hook_list
list either
is a simple string of the script‘s file path or a dict with the following options:
path
Optional, string. File path of the script.
state
Required, string. Allows to specify if upgrade hook script should be invoked (
present
) or ignored (absent
) during after the upgrade.
owncloud__ldap_config
The owncloud__ldap_*_config
variables define the configuration of the "LDAP
user and group backend" Nextcloud plugin. The configuration is stored in the
Nextcloud database and can be manipulated using the occ ldap:*
commands. To view the current LDAP configuration and possible parameters, you
can run the command:
occ ldap:show-config
Detailed information about configuring the LDAP support in Nextcloud can be found in the Nextcloud LDAP documentation page
Examples
The owncloud__ldap_default_config
variable contains the default
parameters used to configure the LDAP support.
To modify the default values, or add new parameters, you can define them in the
Ansible inventory using the owncloud__ldap_config
variable, for
example:
owncloud__ldap_config:
- name: 'turnOnPasswordChange'
value: '0'
Syntax
The owncloud__ldap_*_config
variables contain a list of YAML dictionaries,
each dictionary defines a single configuration entry using specific parameters:
name
Required. The name of the LDAP plugin configuration option, case-sensitive. Multiple configuration entries with the same
name
parameter are merged together and can affect each other.value
Required. The value of the configuration option, should be specified as a string.
state
Optional. If not specified or
present
, a given configuration option will be set in the database. Ifabsent
, the configuration will not be set (existing configuration value stays intact). Ifignore
, a given configuration entry will not be evaluated during role execution.