DEBOPS.OWNCLOUD(5)

NAME
debops.owncloud - Install and manage ownCloud instances

SYNOPSIS

debops run service/owncloud [--limit group,host,...] [--diff] [--check] [--tags tag1,tag2,...] [--skip-tags tag1,tag2,...] [<ansible-playbook options>] ...

DESCRIPTION

This role installs a NextCloud <https://nextcloud.com/> or ownCloud <https://en.wikipedia.org/wiki/OwnCloud> instance on a specified host, either with SQLite, MySQL, MariaDB or PostgreSQL database as a backend and an Nginx or Apache webserver as a frontend.

Nextcloud will be installed using the upstream tarballs. ownCloud will be installed as package coming directly from upstream.

Note that Nginx is not officially supported by ownCloud nor NextCloud <https://github.com/debops/ansible-owncloud/issues/49> but it is community supported and should work without problems. Apache is supported by the role but not yet used by default and not very well tested.

Features:

•   Support for LDAP using the debops.ldap Ansible role.

•   In memory caching using Redis for file locking and APCu.

•   Theming support (only tested with ownCloud 10).

•   Extensive configuration options via Ansible’s inventory.

GETTING STARTED

  Database setup

It is recommended that you install a database server. You can install one on the same host as ownCloud or choose a different host:

[debops_service_mariadb_server]
hostname

In case you chose a different host, you will need to specify which of your database servers the ownCloud instance should use by specifying the database server host as owncloud__database_server.

If you are upgrading an existing Nextcloud installation, you should follow Enabling MySQL 4-byte support <https://docs.nextcloud.com/server/16/admin_manual/configuration_database/mysql_4byte_support.html> and then set the following in your inventory of the database server:

mariadb_server__options:
  - section: 'mysqld'
    options:
      ## https://docs.nextcloud.com/server/16/admin_manual/configuration_database/mysql_4byte_support.html
      'innodb_large_prefix': 'on'
      'innodb_file_format': 'barracuda'
      'innodb_file_per_table': 'true'

For database clean installs this is not required anymore because MySQL 4-byte is enabled by default by the debops.mariadb_server Ansible role.

  In memory caching

Nextcloud and ownCloud recommend to setup Redis <https://en.wikipedia.org/wiki/Redis> for caching. You can install a Redis server on the same host as ownCloud or choose a different host:

[debops_service_redis_server]
hostname

This role will use a Redis server automatically when it is managed by debops.redis_server Ansible role.

In case you chose a different host, you will need to specify which of your Redis servers the ownCloud instance should use by setting the Redis server host as owncloud__redis_host and setting owncloud__redis_enabled to True. Additionally, you will need to set the owncloud__redis_password. Refer to debops.redis_server documentation for details.

  PHP configuration

Starting with Nextcloud 16, a setup warning is emitted in the Nextcloud admin web interface "The PHP memory limit is below the recommended value of 512MB.". The role already configures Nginx to pass an increased memory_limit to PHP. However, this might not be picked up in some cases. When this happens you might want to set the following in your inventory:

php__ini_memory_limit: '512M'

  Choosing a Webserver

Supported webservers:

•   Nginx <https://en.wikipedia.org/wiki/Nginx>

•   Apache <https://en.wikipedia.org/wiki/Apache_HTTP_Server>

    This role started out using Nginx <https://en.wikipedia.org/wiki/Nginx> as Webserver. However, ownCloud <https://en.wikipedia.org/wiki/OwnCloud> don’t officially support Nginx <https://en.wikipedia.org/wiki/Nginx>. Support for the Apache HTTP Server <https://en.wikipedia.org/wiki/Apache_HTTP_Server> has been added to the role using debops.apache as role dependency. NextCloud <https://nextcloud.com/> lists Nginx as supported but still recommends Apache.

    The current default Webserver is Nginx <https://en.wikipedia.org/wiki/Nginx>. Because despite the fact that only Apache <https://en.wikipedia.org/wiki/Apache_HTTP_Server> is officially supported/recommended, Nginx <https://en.wikipedia.org/wiki/Nginx> has been successfully used with this role for some time now. If you have trouble then this would be a good time to try to run it with Apache.

    The ownCloud System Requirements <https://doc.owncloud.org/server/9.0/admin_manual/installation/system_requirements.html> don’t use PHP-FPM in their default configuration. You can set the following in your inventory to not install FPM on the ownCloud host:

    php__server_api_packages:
      - 'cli'

  Switching Webservers

Assuming you where using one Webserver before on a host but want to switch then follow the steps in Choosing a Webserver and additionally add the host to the debops_service_${not_chosen_webserver} group of the opposite webserver you chose for ownCloud. Now add this:

${not_chosen_webserver}__deploy_state: 'absent'

to your inventory.

Note: Replace the ${not_chosen_webserver} placeholders.

Then run the site playbook or just the playbook of the unwanted webserver followed by the debops.owncloud playbook. This will render ${not_chosen_webserver} the unwanted webserver harmless and setup the chosen webserver.

  Upgrade

All upgrades be it major or patch need to be done manually for now. The role does not automate this. The way to support Nextcloud auto upgrades would be to use the Nextcloud Docker image because it includes an application upgrade script. The role could be extended to support using the Docker image if needed.

Upgrade the application using the built-in upgrade feature, then rerun the service playbook for this role to ensure the matching settings are applied.

If the application complains under /settings/admin/overview then you might need to run:

occ upgrade; occ db:add-missing-indice; occ db:add-missing-columns; occ db:convert-filecache-bigint; occ db:add-missing-primary-keys && occ maintenance:mode --off

It also does not hurt to run that by default.

  Expected warnings

Nextcloud and ownCloud have a self check under "Administration" -> "Overview". Some warnings are expected to be shown.

•   Nextcloud 21 and newer: Module php-imagick in this instance has no SVG support. For better compatibility it is recommended to install it.

    Background: SVG support is disabled for security reasons by default. Lets keep it at that for now until we can better assess the situation.

  Example inventory

To setup ownCloud on a given host it should be included in the [debops_service_owncloud] Ansible inventory group:

[debops_service_owncloud]
hostname

Note that the debops_service_owncloud group uses the default webserver, refer to Choosing a Webserver.

  Recommended settings

owncloud__config:
  # https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#user-experience
  default_phone_region: 'DE'

  Ansible facts

The role gathers various Ansible facts about ownCloud for internal use or use by other roles or playbooks.

One of the sources for the facts is the /var/www/owncloud/config/config.php file which has 0640 as default permissions. The remote user who gathers the facts should be able to read this file. Note that facts gathering does not happen with elevated privileges by default. One way to achieve this is by making your configuration management user member of the www-data group by including the following in your inventory:

bootstrap__admin_groups: [ 'admins', 'staff', 'adm', 'sudo', 'www-data' ]

The following Ansible facts are available:

{
    "auto_security_updates_enabled": false,
    "datadirectory": "/var/www/owncloud/data",
    "enabled": true,
    "instanceid": "xxxxxxxxxxxx",
    "maintenance": false,
    "release": "9.0",
    "theme": "debops",
    "trusted_domains": [
        "cloud.example.org"
    ],
    "updatechecker": false,
    "variant": "owncloud",
    "version": "9.0.7.1",
    "webserver": "nginx"
}

Note that the role uses Ansible facts gathered from the config.php file internally and might not work as expected when those facts can not be gathered.

The following can happen when the configuration management user has no access to the config.php file:

•   Certain occ commands are not available in maintenance mode. The role normally filters those commands out if it detects that ownCloud is in maintenance mode. Maintenance mode is assumed to be off if it can not be detected. If it is on, role execution will stop when one of those occ commands is encountered.

    and only the following facts will be available in this case:

    {
        "auto_security_updates_enabled": true,
        "enabled": true,
        "variant": "owncloud",
        "webserver": "nginx"
    }

  Example playbook

The following playbooks are used in DebOps. If you are using these role without DebOps you might need to adapt them to make them work in your setup.

Ansible playbook that uses the debops.owncloud role together with debops.nginx:

---
- name: Install and manage ownCloud instances with Nginx as webserver
  collections: [ 'debops.debops', 'debops.roles01',
                 'debops.roles02', 'debops.roles03' ]
  hosts: [ 'debops_service_owncloud', 'debops_service_owncloud_nginx' ]
  become: True
  environment: '{{ inventory__environment | d({})
                   | combine(inventory__group_environment | d({}))
                   | combine(inventory__host_environment  | d({})) }}'
  pre_tasks:
    - name: Apply keyring configuration for php environment
      ansible.builtin.import_role:
        name: 'keyring'
      vars:
        keyring__dependent_apt_keys:
          - '{{ php__keyring__dependent_apt_keys }}'
          - '{{ mariadb__keyring__dependent_apt_keys if (owncloud__database == "mariadb") else [] }}'
          - '{{ postgresql__keyring__dependent_apt_keys if (owncloud__database == "postgresql") else [] }}'
          - '{{ nginx__keyring__dependent_apt_keys }}'
          - '{{ owncloud__keyring__dependent_apt_keys }}'
        keyring__dependent_gpg_keys:
          - '{{ owncloud__keyring__dependent_gpg_keys }}'
      tags: [ 'role::keyring', 'skip::keyring', 'role::php',
              'role::mariadb', 'role::postgresql',
              'role::nginx', 'role::owncloud' ]
    - name: Prepare php environment
      ansible.builtin.import_role:
        name: 'php'
        tasks_from: 'main_env'
      tags: [ 'role::php', 'role::php:env', 'role::logrotate' ]
    - name: Prepare owncloud environment
      ansible.builtin.import_role:
        name: 'owncloud'
        tasks_from: 'main_env'
      tags: [ 'role::owncloud', 'role::owncloud:env', 'role::nginx' ]
  roles:
    - role: apt_preferences
      tags: [ 'role::apt_preferences', 'skip::apt_preferences', 'role::nginx', 'role::php' ]
      apt_preferences__dependent_list:
        - '{{ nginx__apt_preferences__dependent_list }}'
        - '{{ owncloud__apt_preferences__dependent_list }}'
        - '{{ php__apt_preferences__dependent_list }}'
    - role: ferm
      tags: [ 'role::ferm', 'skip::ferm', 'role::nginx' ]
      ferm__dependent_rules:
        - '{{ nginx__ferm__dependent_rules }}'
    - role: python
      tags: [ 'role::python', 'skip::python', 'role::ldap', 'role::mariadb', 'role::postgresql' ]
      python__dependent_packages3:
        - '{{ ldap__python__dependent_packages3 }}'
        - '{{ mariadb__python__dependent_packages3
              if (owncloud__database == "mariadb")
              else [] }}'
        - '{{ postgresql__python__dependent_packages3
              if (owncloud__database == "postgresql")
              else [] }}'
        - '{{ nginx__python__dependent_packages3 }}'
      python__dependent_packages2:
        - '{{ ldap__python__dependent_packages2 }}'
        - '{{ mariadb__python__dependent_packages2
              if (owncloud__database == "mariadb")
              else [] }}'
        - '{{ postgresql__python__dependent_packages2
              if (owncloud__database == "postgresql")
              else [] }}'
        - '{{ nginx__python__dependent_packages2 }}'
    - role: ldap
      tags: [ 'role::ldap', 'skip::ldap' ]
      ldap__dependent_tasks:
        - '{{ owncloud__ldap__dependent_tasks }}'
    - role: mariadb
      tags: [ 'role::mariadb', 'skip::mariadb' ]
      mariadb__dependent_databases: '{{ owncloud__mariadb__dependent_databases }}'
      mariadb__dependent_users: '{{ owncloud__mariadb__dependent_users }}'
      when: (owncloud__database == 'mariadb')
    - role: postgresql
      tags: [ 'role::postgresql', 'skip::postgresql' ]
      postgresql__dependent_roles: '{{ owncloud__postgresql__dependent_roles }}'
      postgresql__dependent_groups: '{{ owncloud__postgresql__dependent_groups }}'
      postgresql__dependent_databases: '{{ owncloud__postgresql__dependent_databases }}'
      when: (owncloud__database == 'postgresql')
    - role: unattended_upgrades
      tags: [ 'role::unattended_upgrades', 'skip::unattended_upgrades' ]
      unattended_upgrades__dependent_origins: '{{ owncloud__unattended_upgrades__dependent_origins }}'
    - role: php
      tags: [ 'role::php', 'skip::php' ]
      php__dependent_packages:
        - '{{ owncloud__php__dependent_packages }}'
      php__dependent_configuration:
        - '{{ owncloud__php__dependent_configuration }}'
      php__dependent_pools:
        - '{{ owncloud__php__dependent_pools }}'
    - role: cron
      tags: [ 'role::cron', 'skip::cron' ]
    - role: logrotate
      tags: [ 'role::logrotate', 'skip::logrotate' ]
      logrotate__dependent_config:
        - '{{ php__logrotate__dependent_config }}'
        - '{{ owncloud__logrotate__dependent_config }}'
    - role: nginx
      tags: [ 'role::nginx', 'skip::nginx' ]
      nginx__dependent_maps:
        - '{{ owncloud__nginx__dependent_maps }}'
      nginx__dependent_servers:
        - '{{ owncloud__nginx__dependent_servers }}'
      nginx__dependent_upstreams:
        - '{{ owncloud__nginx__dependent_upstreams }}'
    - role: owncloud
      tags: [ 'role::owncloud', 'skip::owncloud' ]

Ansible playbook that uses the debops.owncloud role together with debops.apache:

---
- name: Install and manage ownCloud instances with Apache as webserver
  collections: [ 'debops.debops', 'debops.roles01',
                 'debops.roles02', 'debops.roles03' ]
  hosts: [ 'debops_service_owncloud_apache' ]
  become: True
  environment: '{{ inventory__environment | d({})
                   | combine(inventory__group_environment | d({}))
                   | combine(inventory__host_environment  | d({})) }}'
  pre_tasks:
    - name: Apply keyring configuration for php environment
      ansible.builtin.import_role:
        name: 'keyring'
      vars:
        keyring__dependent_apt_keys:
          - '{{ php__keyring__dependent_apt_keys }}'
          - '{{ mariadb__keyring__dependent_apt_keys if (owncloud__database == "mariadb") else [] }}'
          - '{{ postgresql__keyring__dependent_apt_keys if (owncloud__database == "postgresql") else [] }}'
          - '{{ owncloud__keyring__dependent_apt_keys }}'
        keyring__dependent_gpg_keys:
          - '{{ owncloud__keyring__dependent_gpg_keys }}'
      tags: [ 'role::keyring', 'skip::keyring', 'role::php',
              'role::mariadb', 'role::postgresql', 'role::owncloud' ]
    - name: Prepare php environment
      ansible.builtin.import_role:
        name: 'php'
        tasks_from: 'main_env'
      tags: [ 'role::php', 'role::php:env', 'role::logrotate' ]
    - name: Prepare apache environment
      ansible.builtin.import_role:
        name: 'apache'
        tasks_from: 'main_env'
      tags: [ 'role::apache', 'role::apache:env' ]
    - name: Prepare owncloud environment
      ansible.builtin.import_role:
        name: 'owncloud'
        tasks_from: 'main_env'
      tags: [ 'role::owncloud', 'role::owncloud:env' ]
  roles:
    - role: apt_preferences
      tags: [ 'role::apt_preferences', 'skip::apt_preferences' ]
      apt_preferences__dependent_list:
        - '{{ owncloud__apt_preferences__dependent_list }}'
        - '{{ php__apt_preferences__dependent_list }}'
    - role: ferm
      tags: [ 'role::ferm', 'skip::ferm' ]
      ferm__dependent_rules:
        - '{{ apache__ferm__dependent_rules }}'
    - role: python
      tags: [ 'role::python', 'skip::python', 'role::ldap', 'role::mariadb', 'role::postgresql' ]
      python__dependent_packages3:
        - '{{ ldap__python__dependent_packages3 }}'
        - '{{ mariadb__python__dependent_packages3
              if (owncloud__database == "mariadb")
              else [] }}'
        - '{{ postgresql__python__dependent_packages3
              if (owncloud__database == "postgresql")
              else [] }}'
      python__dependent_packages2:
        - '{{ ldap__python__dependent_packages2 }}'
        - '{{ mariadb__python__dependent_packages2
              if (owncloud__database == "mariadb")
              else [] }}'
        - '{{ postgresql__python__dependent_packages2
              if (owncloud__database == "postgresql")
              else [] }}'
    - role: ldap
      tags: [ 'role::ldap', 'skip::ldap' ]
      ldap__dependent_tasks:
        - '{{ owncloud__ldap__dependent_tasks }}'
    - role: mariadb
      tags: [ 'role::mariadb', 'skip::mariadb' ]
      mariadb__dependent_users: '{{ owncloud__mariadb__dependent_users }}'
      when: (owncloud__database == 'mariadb')
    - role: postgresql
      tags: [ 'role::postgresql', 'skip::postgresql' ]
      postgresql__dependent_roles: '{{ owncloud__postgresql__dependent_roles }}'
      postgresql__dependent_groups: '{{ owncloud__postgresql__dependent_groups }}'
      postgresql__dependent_databases: '{{ owncloud__postgresql__dependent_databases }}'
      when: (owncloud__database == 'postgresql')
    - role: unattended_upgrades
      tags: [ 'role::unattended_upgrades', 'skip::unattended_upgrades' ]
      unattended_upgrades__dependent_origins: '{{ owncloud__unattended_upgrades__dependent_origins }}'
    - role: php
      tags: [ 'role::php', 'skip::php' ]
      php__dependent_packages:
        - '{{ owncloud__php__dependent_packages }}'
      php__dependent_configuration:
        - '{{ owncloud__php__dependent_configuration }}'
      php__dependent_pools:
        - '{{ owncloud__php__dependent_pools }}'
    - role: cron
      tags: [ 'role::cron', 'skip::cron' ]
    - role: logrotate
      tags: [ 'role::logrotate', 'skip::logrotate' ]
      logrotate__dependent_config:
        - '{{ php__logrotate__dependent_config }}'
        - '{{ owncloud__logrotate__dependent_config }}'
    - role: apache
      tags: [ 'role::apache', 'skip::apache' ]
      apache__dependent_snippets: '{{ owncloud__apache__dependent_snippets }}'
      apache__dependent_vhosts:
        - '{{ owncloud__apache__dependent_vhosts }}'
    - role: owncloud
      tags: [ 'role::owncloud', 'skip::owncloud' ]

These playbooks are shipped with DebOps and are also contained in this role under docs/playbooks/.

  Ansible tags

You can use Ansible --tags or --skip-tags parameters to limit what tasks are performed during Ansible run. This can be used after a host was first configured to speed up playbook execution, when you are sure that most of the configuration is already in the desired state.

Available role tags:

role::owncloud
    Main role tag, should be used in the playbook to execute all of the role tasks as well as role dependencies.

role::owncloud:pkg
    Tasks related to system package management like installing, upgrading or removing packages.

role::owncloud:tarball
    Tasks related to installing by Tarball.

role::owncloud:config
    Run tasks related to ownCloud configuration and setup.

role::owncloud:mail
    Run tasks related to the deployment of the mail configuration.

role::owncloud:occ
    Run tasks related to the occ command.

role::owncloud:occ_config
    Run tasks related to occ config: commands generated from owncloud__apps_config variables.

role::owncloud:auto_upgrade
    Run tasks related preparing ownCloud auto upgrade.

role::owncloud:ldap
    Run tasks related to the LDAP configuration.

role::owncloud:theme
    Run tasks related to the configuring the ownCloud theme.

role::owncloud:copy
    Run tasks related to copying and deletion of files in user profiles.

EXTERNAL USERS

This section gives more details on how to setup external users for ownCloud.

  Users from debops.slapd

Should work out of the box when enabled:

owncloud__ldap_enabled: True

Refer to LDAP authentication for details.

  Users from MS Windows Active Directory

First, you will need an AD user with which ownCloud can do a LDAP bind in order to read information about the users and check passwords. This user should be unprivileged.

Create the AD user and configure it like this:

[ ] User must change password at next logon
[x] User cannot change password
[x] Password never expires
[ ] Account is disabled

The user must not be able to login from computers. FIXME: Figure out how that can be configured.

owncloud__ldap_enabled: True
# ownCloud LDAP recommendations by the debops.owncloud maintainers for MS Windows AD [[[
# Note that those recommendations might deviate from ownCloud
# recommendations but those are the settings which are proven to work.
owncloud__ldap_method: 'plain'
owncloud__ldap_expert_username_attr: 'sAMAccountName'
owncloud__ldap_conf_map:
  ldapHost: '{{ owncloud__ldap_primary_server }}'
  ldapPort: '{{ owncloud__ldap_port }}'
  ldapAgentName: '{{ owncloud__ldap_binddn }}'
  ldapBase: '{{ owncloud__ldap_base_dn | join(",") }}'
  ldapExpertUsernameAttr: '{{ owncloud__ldap_expert_username_attr }}'
# .. ]]]
# Custom settings.
owncloud__ldap_primary_server: 'dc01.example.org'
owncloud__ldap_base_dn: [ 'DC=example', 'DC=org' ]
owncloud__ldap_binddn: 'CN=owncloudbind,OU=service-users,{{ owncloud__ldap_base_dn | join(",") }}'

Note that this leaves the LDAP configuration in ownCloud at an unfinished state. The role maintainers consider it to be easier to finish the LDAP configuration via the admin web interface. TODO: Add a backup option of all LDAP settings to the Ansible controller.

Refer to debops.secret to learn how passwords are handled.

EXTERNAL STORAGE

This section gives some hints how to setup external storage for ownCloud. The automation support for this in debops.owncloud currently limited. This might be added in a later version of the role.

  SMB/CIFS

To enable SMB/CIFS support in the role set:

owncloud__smb_support: True

in your inventory.

Setting up SMB/CIFS in different environment based on Debian Jessie required some debugging so if you have trouble with SMB and MS Windows or NetApp file servers, you can try the following.

Add the host(s) to the debops_service_samba Ansible host group:

[debops_service_samba]
hostname

and include this:

# Don’t install the ``samba`` server as it is not needed on a typical
# ownCloud server which acts as SMB client.
samba__base_packages:
  # - 'samba'
  - 'samba-common'
  - 'samba-common-bin'
# Set AD domain. It might be required to adjust in case `netbase__domain`
# is not equal to the Samba domain/workgroup.
# ownCloud as of 9.0 provides a Domain field when setting up an external
# storage but configuring this here is still nice in case you need to debug
# a SMB/CIFS share using `smbclient`.
samba__workgroup: '{{ netbase__domain }}'
samba__global_custom:
  ## DFS workaround:
  'client ntlmv2 auth': 'no'
  ## Downgrade NetApp workaround:
  ## https://community.netapp.com/t5/Network-Storage-Protocols-Discussions/samba-3-6-23-30-on-CentOS-gt-error-in-smbclient/m-p/118486#M8350
  'client use spnego': 'no'

in your inventory to get started.

The run the service/samba playbook.

When you have further suggestions, you are welcome to share them here to save us all some debugging time.

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:

•   owncloud__role_config

•   owncloud__role_recommended_config

•   owncloud__config

•   owncloud__group_config

•   owncloud__host_config

    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 or absent 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 <https://doc.owncloud.org/server/9.0/admin_manual/configuration_server/caching_configuration.html> but is a result of how the configuration file is generated using JSON as intermediate data format.

    Refer to the official ownCloud documentation <https://doc.owncloud.org/server/9.0/admin_manual/configuration_server/config_sample_php_parameters.html> 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 be owncloud__data_path + "/" + item.dest.

state
    Optional. If not specified, or if specified and present, the file(s) will be created. If specified and absent, file will be removed.

    Additionally, all parameters of the Ansible ansible.builtin.copy module <https://docs.ansible.com/ansible/latest/collections/ansible/builtin/copy_module.html> 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__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 <https://docs.nextcloud.com/server/stable/admin_manual/configuration_user/user_auth_ldap.html>

  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. If absent, the configuration will not be set (existing configuration value stays intact). If ignore, a given configuration entry will not be evaluated during role execution.

AUTHOR
Maciej Delmanowski, Hartmut Goebel, Robin Schneider

COPYRIGHT
2014-2024, Maciej Delmanowski, Nick Janetakis, Robin Schneider and others