From 866f329f47ac5d6ebb6982b1bd372d52730d3693 Mon Sep 17 00:00:00 2001 From: Borjan Tchakaloff Date: Fri, 1 Jan 2021 15:09:44 +0100 Subject: [PATCH] syncthing_folder: Accept folder type Accept the `type` value matching the `folder.type` attribute. --- library/storage/syncthing/syncthing_folder.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/library/storage/syncthing/syncthing_folder.py b/library/storage/syncthing/syncthing_folder.py index 7379a05..0796324 100644 --- a/library/storage/syncthing/syncthing_folder.py +++ b/library/storage/syncthing/syncthing_folder.py @@ -43,6 +43,12 @@ options: description: - Whether to ignore permissions when looking for changes. default: false + type: + description: + - The folder type: sending local chances, and/or receiving + remote changes. + default: sendreceive + choices: ['sendreceive', 'sendonly', 'receiveonly'] host: description: - Host to connect to, including port @@ -186,7 +192,7 @@ def create_folder(params): 'pullerPauseS': 0, 'rescanIntervalS': 3600, 'scanProgressIntervalS': 0, - 'type': 'sendreceive', + 'type': params['type'], 'useLargeBlocks': False, 'versioning': { 'params': {}, @@ -213,6 +219,8 @@ def run_module(): path=dict(type='path', required=False), devices=dict(type='list', required=False, default=False), ignore_perms=dict(type='bool', required=False, default=False), + type=dict(type='str', default='sendreceive', + choices=['sendreceive', 'sendonly', 'receiveonly']), host=dict(type='str', default='http://127.0.0.1:8384'), api_key=dict(type='str', required=False, no_log=True), timeout=dict(type='int', default=30),