bring up your nextcloud usage to the next level 🚀
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Markus Bergholz 6b5cde5f7b
update 6.0.0
5 days ago
plugins add optional details parameter to password lookup 5 days ago
tests fix talk test 7 days ago
.gitignore add envrc to gitignore 10 months ago
.gitlab-ci.yml #2 test basic build 10 months ago
LICENSE Initial commit 10 months ago
Makefile add whisper and syntax test 7 days ago add optional details parameter to password lookup 5 days ago
drone.yml add first draft for user_info module 3 months ago
galaxy.yml update 6.0.0 5 days ago

Ansible Nextcloud Collection

Ansible Nextcloud Collection - is not meant to install nor to maintain your nextcloud itself.
It's meant to bring up your nextcloud usage to the next level 🚀
No ssh required.


Build Status

  • 🔑 lookup plugin for passwords app
  • 💾 file module - download, upload and delete files
  • 🗨 talk module - post messages in conversations
  • 👥 user module - maintain nextcloud users


host category origin pull mirror, merge-requests and Issues push mirror, pull-requests and Issues



ansible-galaxy collection install markuman.nextcloud


You can authenticate either with your user password or with an App-Token (Settings -> Security -> "Create new app password).
When you've setup MFA/2FA/TOTP, you must authenticate with an App-Token.

The collection modules and plugins require the following parameter. Alternatively the parameter can also be set as an ENV variable.

Ansible Parameter ENV Variable


ssl_mode parameter, default value (https).

  • ability to use http:// for integration tests
  • ability to skip ssl verification
  • Possible values https, http, skip

lookup passwords

When details=False, only the password is returned.
When details=True, the entire object is returned.

- name: Retrieve Password with label "Stackoverflow"
    var: lookup('markuman.nextcloud.passwords', 'Stackoverflow' , host='nextcloud.tld', user='ansible', api_token='some-token', details=False)

file module

The file module supports also access_token as an alias for api_token, to be closer on ansible S3 module.

mode: get

- name: fetch file from nextcloud
    mode: get
    src: anythingeverything.jpg
    dest: /tmp/anythingeverything.jpg
    overwritten: different # 'always' is the default. 'never' is an option too.
    host: nextcloud.tld
    user: myuser
    api_token: xxx

mode: delete

CAUTION ⚠ removes files and folders - recursive!

- name: delete file on nextcloud
    mode: delete
    src: bla.docx

mode: put

- name: upload file on nextcloud
    mode: put
    src: /tmp/testtt.jpg
    dest: testtt.jpg

talk module

- name: send hello
    msg: Ho Hi from Ansible.
    channel: 8fyrb4ec


List all nextcloud users.

- name: get nc users
  register: out

- debug: msg="{{ out.users }}"