Updated module documentation

This commit is contained in:
Swapnil 2024-05-02 12:41:57 +05:30
parent c923701972
commit 46448fab1d
Signed by: swapnil
GPG Key ID: 58029C48BB100574
1 changed files with 104 additions and 32 deletions

View File

@ -13,66 +13,138 @@ ANSIBLE_METADATA = {
DOCUMENTATION = '''
---
module: syncthing_device
module: device_default
short_description: Manage Syncthing devices
short_description: Manage Syncthing device default configurations
version_added: "2.7"
description:
- "This is my longer description explaining my sample module"
- "This module allows you to manage Syncthing device default configurations.
You can update the default configurations using this module.
It uses the Syncthing REST API to perform these operations."
options:
id:
addresses:
description:
- This is the unique id of this new device
required: true
- List of addresses for the device.
type: list
required: false
allowedNetworks:
description:
- List of allowed networks for the device.
type: list
required: false
autoAcceptFolders:
description:
- Whether the device should automatically accept shared folders.
type: bool
required: false
certName:
description:
- The certificate name for the device.
type: str
required: false
compression:
description:
- The compression setting for the device.
type: str
required: false
deviceID:
description:
- The ID of the device.
type: str
required: false
ignoredFolders:
description:
- List of ignored folders for the device.
type: list
required: false
introducedBy:
description:
- The device that introduced this device.
type: str
required: false
introducer:
description:
- Whether this device is an introducer.
type: bool
required: false
maxRecvKbps:
description:
- The maximum receive rate for the device in Kbps.
type: int
required: false
maxRequestKiB:
description:
- The maximum request size for the device in KiB.
type: int
required: false
maxSendKbps:
description:
- The maximum send rate for the device in Kbps.
type: int
required: false
name:
description:
- The name for this new device
- The name of the device.
type: str
required: false
host:
numConnections:
description:
- Host to connect to, including port
default: http://127.0.0.1:8384
unix_socket:
description:
- Use this unix socket instead of TCP
- The number of connections for the device.
type: int
required: false
api_key:
paused:
description:
- API key to use for authentication with host.
If not provided, will try to auto-configure from filesystem.
- Whether the device is paused.
type: bool
required: false
config_file:
remoteGUIPort:
description:
- Path to the Syncthing configuration file for automatic
discovery (`api_key`). Note that the running user needs read
access to the file.
- The remote GUI port for the device.
type: int
required: false
timeout:
skipIntroductionRemovals:
description:
- The socket level timeout in seconds
default: 30
state:
- Whether to skip introduction removals for the device.
type: bool
required: false
untrusted:
description:
- Use present/absent to ensure device is added, or not.
default: present
choices: ['absent', 'present', 'paused']
- Whether the device is untrusted.
type: bool
required: false
author:
- Rafael Bodill (@rafi)
'''
EXAMPLES = '''
# Add a device to share with
- name: Add syncthing device
syncthing_device:
id: 1234-1234-1234-1234
name: my-server-name
# Get/Update device_default
- name: Get device_default
become: yes
become_user: syncthing
community.syncthing.device_default:
host: http://localhost
unix_socket: /run/syncthing/syncthing.sock
config_file: /var/lib/syncthing/.config/syncthing/config.xml
addresses: ["dynamic"]
autoAcceptFolders: false
compression: "metadata"
deviceID: "device-id"
name: "device-name"
paused: false
register: device_default
'''
RETURN = '''
device_default:
description: The default configuration of the device after the operation.
type: dict
changed:
description: Whether any changes were made.
type: bool
response:
description: The API response, in-case of an error.
type: dict