Skip to content

ManfredWisniewskiGoogle/markuman.nextcloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

37 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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

About

bring up your nextcloud usage to the next level ๐Ÿš€

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 94.8%
  • Jinja 2.7%
  • Makefile 2.5%