No description
Find a file
Marc Crebassa 191c0e11ed
Merge pull request #427 from nextcloud/module/user_list
starting NC identities managment: added module user_list
2025-10-12 01:17:55 +02:00
.github chore: bump ansible from 11.3.0 to 12.0.0 in /.github/workflows 2025-10-09 07:28:48 +00:00
meta update workspace and precommit hooks 2025-06-19 18:06:53 +02:00
molecule/default Refactoring GH-actions with workflows. (#415) 2025-06-26 07:20:15 +02:00
plugins adjust module doc 2025-10-12 01:10:13 +02:00
roles Add variable nextcloud_install_php 2025-06-26 00:01:29 +02:00
tests added user_list module 2025-10-11 00:28:16 +02:00
.ansible-lint Temporary ignore ansible-lint var-naming[no-role-prefix] 2023-05-22 06:16:07 +02:00
.gitignore Refactoring GH-actions with workflows. (#415) 2025-06-26 07:20:15 +02:00
.pre-commit-config.yaml update workspace and precommit hooks 2025-06-19 18:06:53 +02:00
.yamllint.yml Refactoring GH-actions with workflows. (#415) 2025-06-26 07:20:15 +02:00
CHANGELOG.rst Change namespace to nextcloud and collection name to admin (#209) 2023-03-02 00:46:06 +01:00
CONTRIBUTING.md refactor(lint): use pre-commit to force early lint error detection 2023-01-12 16:20:19 +01:00
galaxy-deploy.yml Add no_log to token write 2023-02-27 20:27:32 +01:00
galaxy.yml bump version to 2.2.4 2025-10-07 18:46:02 +02:00
LICENSE.md Initial commit 2016-09-09 04:56:48 +02:00
README.md update readme 2025-10-11 00:32:22 +02:00
requirements.yml Update php-versions 2024-10-07 18:13:24 +02:00

Lint status Tests for all supported versions Tests for latest

Ansible collection for nextcloud administration

This repository hosts the nextcloud.admin Ansible Collection.

The collection includes a variety of Ansible content to help automate the management of nextcloud, as well as provisioning and maintenance of instances of nextcloud.

Ansible version compatibility

This collection has been tested against following Ansible versions: >=2.15.0.

Plugins and modules within a collection may be tested with only specific Ansible versions.

Python Support

  • Collection tested on 3.12+

Supported nextcloud version

This collection supports Nextcloud versions: 30, 31, 32(latest) The community makes it's best efforts to keep tested versions updated with Nextcloud release schedule.

Included content

Modules

Name Description
nextcloud.admin.run_occ Run the occ command line tool with given arguments.
nextcloud.admin.app_info Return state, version, updates and path of one external application.
nextcloud.admin.app Manage nextcloud external applications (install, remove, disable, etc)
nextcloud.admin.user_list List configured users on the server with optional user infos

Roles

Name Description
nextcloud.admin.backup (beta) Create a backup of a Nextcloud server
nextcloud.admin.install_nextcloud Install and configure an Nextcloud instance for a Debian/Ubuntu server

Installation and Usage

Dependencies

netaddr Python Library

Content in this collection requires the network address manipulation library to manipulate network address. You can install it with:

    pip3 install netaddr

required standalone roles

By default, some roles in this collection are dependant of standalone roles from other namespaces. (this can be disabled).

Due to some limitations, ansible-galaxy does not install them automatically, them need to be installed afterward.

Once the collection is installed, run the command ansible-galaxy role install -r <this_collection_folder>/requirements.yml.

Alternatively, you can also add the content of this file in your own requirements.yml file prior to installing the collection

Installing the Collection from Ansible Galaxy

Before using the nextcloud collection, you need to install it with the Ansible Galaxy CLI:

ansible-galaxy collection install nextcloud.admin

You can also include it in a requirements.yml file and install it via ansible-galaxy collection install -r requirements.yml, using the format:

---
collections:
  - name: nextcloud.admin
    version: 2.2.4

Using modules from the Nextcloud Collection in your playbooks

It's preferable to use content in this collection using their Fully Qualified Collection Namespace (FQCN), for example nextcloud.admin.run_occ:

---
- hosts: nextcloud_host
  gather_facts: false
  become: true
  tasks:
    - name: list installed apps
      nextcloud.admin.run_occ:
        nextcloud_path: /var/www/nextcloud
        command: app:list

If upgrading older playbooks from <2.0.0, you can minimise your changes by defining collections in your play and refer to this collection's role as install_nextcloud, instead of nextcloud.admin.install_nextcloud, as in this example:

---
- hosts: localhost
  gather_facts: false
  connection: local

  collections:
    - nextcloud.admin

  tasks:
    - name: deploy nextcloud and dependencies
      include_role:
        name: install_nextcloud

For documentation on how to use:

  • individual modules: please use ansible-doc command after installing this collection.
  • included roles: as per ansible standard, ansible role are documented in their own README file.

Testing and Development

If you want to develop new content for this collection or improve what's already here, the easiest way to work on the collection is to clone it into one of the configured COLLECTIONS_PATHS, and work on it there.

Testing with molecule

The tests directory contains playbooks for running integration tests on various scenarios. There are also integration tests in the molecule directory

Publishing New Versions

Releases are automatically built and pushed to Ansible Galaxy for any new tag.

License

BSD

See LICENCE to see the full text.