bring up your nextcloud usage to the next level 🚀 https://galaxy.ansible.com/markuman/nextcloud
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 56603b73e3 add ci batch 4 months ago
plugins #5 alias access_token for api_token 4 months ago
tests #4 add first implementation of talk module 4 months ago
.gitignore add envrc to gitignore 6 months ago
.gitlab-ci.yml #2 test basic build 6 months ago
LICENSE Initial commit 6 months ago
Makefile update helper Makefile 6 months ago
README.md add ci batch 4 months ago
drone.yml add test drone-ci 4 months ago
galaxy.yml 3.0.2 4 months ago

README.md

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 🚀

Features

Build Status

  • 🔑 lookup plugin for passwords app
  • 💾 file module to download, upload and delete files
  • 🗨 talk module to post messages in conversations

Usage

Install

https://galaxy.ansible.com/markuman/nextcloud

ansible-galaxy collection install markuman.nextcloud

Auth

You must authenticate with an app token. (Settings -> Security -> "Create new app password")

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

Ansible Parameter ENV Variable
host NEXTCLOUD_HOST
user NEXTCLOUD_USER
api_token NEXTCLOUD_TOKEN

lookup passwords

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

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
  markuman.nextcloud.file:
    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
  markuman.nextcloud.file:
    mode: delete
    src: bla.docx

mode: put

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

talk module

- name: send hello
  markuman.nextcloud.talk:
    message: Ho Hi from Ansible.
    channel: 8fyrb4ec

SCM

host category
https://git.osuv.de/m/nextcloud_collection origin
https://gitlab.com/markuman/nextcloud_collection pull mirror
https://github.com/markuman/nextcloud_collection push mirror