Commit Graph

35 Commits

Author SHA1 Message Date
Swapnil 76bf2cd2bb
Updated folder 2024-05-11 01:54:34 +05:30
Swapnil 31c955c5b9
Added device_defaults 2024-05-06 10:20:43 +05:30
Peter Šurda e61ad55945
Add 'devices'
- will return a dict of devices in format id: name
2024-04-23 21:33:09 +08:00
Peter Šurda 2c26c3a53e
Fixes 2024-04-23 12:12:40 +08:00
Peter Šurda 29d43b9ef0
Refactoring
- improve modularity
2024-04-23 11:51:43 +08:00
Peter Šurda 34b7f2ccc1
Typos 2024-04-22 22:54:40 +08:00
Peter Šurda b7e3210631
Handle non-JSON return values 2024-04-22 16:20:30 +08:00
Peter Šurda 0b5fd3a2cf
Additional handling for 404
- sometimes 404 is acceptable
2024-04-22 16:11:17 +08:00
Peter Šurda 00ca2d2133
URL fixes if using unix_socket
- according to https://github.com/ansible/ansible/pull/43560 where
  unix_socket was implemented, you're supposed to use http://localhost/
  as hostname when using unix_socket
2024-04-22 15:32:36 +08:00
Peter Šurda fb178b36cd
Refactoring
- unix_socket still wasn't used correctly
2024-04-22 15:26:49 +08:00
Peter Šurda b6ec505285
Refactoring
- unix_socket wasn't used correctly
2024-04-22 15:23:03 +08:00
Peter Šurda 89a69e6e38
Typo 2024-04-22 15:16:59 +08:00
Peter Šurda 8b94a3b06a
Missing argument 2024-04-22 15:15:34 +08:00
Peter Šurda f9a895e8e1
Update call parameters 2024-04-22 15:11:11 +08:00
Peter Šurda fe8f9be567
Unix socket workaround 2024-04-22 15:07:48 +08:00
Peter Šurda 6bd9731844
Typo 2024-04-22 14:52:45 +08:00
Peter Šurda 537a7b3365
Add unix socket support 2024-04-22 14:51:36 +08:00
Peter Šurda c40784f6ca
Fix version 2024-04-22 14:39:36 +08:00
Peter Šurda 591c3f5a67
Convert into galaxy collection 2024-04-22 14:16:29 +08:00
Peter Šurda ea36487819
Update to new API and refactor
- the previous API calls (/rest/sysutem/config) are deprecated, so it's
  been adjusted to use the new ones (/rest/config/devices and
  /rest/config/devices/*id*)
- the code is simplified to operate just on one devices rather than
  the list of devices, the new API has sufficient functionality to do
  this
2024-04-21 21:55:15 +08:00
Borjan Tchakaloff 3a49d17dfd syncthing_folder: Always share a folder with the current device
There is no need to require that the device being configured is
explictly mentioned in its configuration. We can get it through
the status endpoint and automatically add it to the set of devices
the folder is shared with.
2021-02-19 17:40:28 +01:00
Borjan Tchakaloff c3cd1e450d Extract fetching data from the REST API 2021-02-18 17:35:43 +01:00
Borjan Tchakaloff c7aa08f97a syncthing_folder: Do not duplicate the `msg` key 2021-02-18 17:18:30 +01:00
Borjan Tchakaloff 38ff2db9ca syncthing_folder: Accept names of known devices 2021-02-18 17:03:55 +01:00
Borjan Tchakaloff aa0bab7c0b Update notice 2021-02-17 18:16:47 +01:00
Borjan Tchakaloff 6777a9ab6a syncthing_folder: Default to empty device list
When defining a new shared folder, the configuration is missing and
thus there are no current devices configured.
2021-02-17 18:05:08 +01:00
Borjan Tchakaloff 1b2952c1a6 syncthing_folder: Keep existing device ordering
Keep the existing list of devices if it contains the expected
devices.  This change fixes the current/expected configurations
comparison on devices ordering.
2021-01-01 17:17:39 +01:00
Borjan Tchakaloff 11282b098e syncthing_device: Accept path to the configuration file
Specifying `config_file` overrides the default path relative to
the current user.

This is handy when the executing user is a different user.
2021-01-01 16:01:13 +01:00
Borjan Tchakaloff e336ebde13 syncthing_folder: Accept path to the configuration file
Specifying `config_file` overrides the default path relative to
the current user.

This is handy when the executing user is a different user.
2021-01-01 15:57:21 +01:00
Borjan Tchakaloff 8fee0cb114 syncthing_folder: Accept file-system watcher flag
Accept the `fs_watcher` flag matching the `folder.fsWatcherEnabled`
attribute.
2021-01-01 15:57:21 +01:00
Borjan Tchakaloff 866f329f47 syncthing_folder: Accept folder type
Accept the `type` value matching the `folder.type` attribute.
2021-01-01 15:57:21 +01:00
Borjan Tchakaloff 7532f87638 syncthing_folder: Accept permission ignoring flag
Accept the `ignore_perms` flag matching the `folder.ignorePerms`
attribute.
2021-01-01 15:57:21 +01:00
Borjan Tchakaloff 1136e9b06b syncthing_folder: Factor folder configuration
The folder configuration is parametrized in one place, no need for
duplicates.
2021-01-01 15:57:21 +01:00
Borjan Tchakaloff 83e9add60c syncthing_folder: Always update the devices the folder is shared with
Ensure all devices the folder should be shared with is part of the
folder configuration.

Previously, only at folder creation would the devices be set.
2021-01-01 15:28:15 +01:00
Rafael Bodill 8b7b85b8f1 Initial commit 2018-11-28 21:22:58 +02:00