Added device_default #2

Merged
PeterSurda merged 1 commits from swapnil/ansible-modules-syncthing:master into master 2024-05-06 07:05:03 +02:00
Member
No description provided.
swapnil force-pushed master from 46448fab1d to 8d6e24c460 2024-05-02 09:13:28 +02:00 Compare
swapnil force-pushed master from 78def8612f to 71f3168dfd 2024-05-02 10:21:32 +02:00 Compare
PeterSurda requested changes 2024-05-03 05:56:44 +02:00
Dismissed
@ -0,0 +182,4 @@
current_config = module.get_call()
# Check for changes
changes = {key: module.params[key] for key in module.params if module.params.get(key) != current_config.get(key)}
Owner

does this work correctly on lists? e.g. allowedNetworks, igoredFolders?

does this work correctly on lists? e.g. `allowedNetworks`, `igoredFolders`?
@ -0,0 +184,4 @@
# Check for changes
changes = {key: module.params[key] for key in module.params if module.params.get(key) != current_config.get(key)}
if len(changes.keys()) > 0:
Owner

how about

if module.check_mode or changes.keys() == 0:
   module.result['device_default'] = current_config
   module_exit_json()

module.patch_call(data=module.params)
module.result['device_default'] = module.get_call()
module.result['changed'] = True
module.result['changes'] = changes
how about ``` if module.check_mode or changes.keys() == 0: module.result['device_default'] = current_config module_exit_json() module.patch_call(data=module.params) module.result['device_default'] = module.get_call() module.result['changed'] = True module.result['changes'] = changes ```
Owner

Also I would rather use device_defaults, not device_default.

Also I would rather use `device_defaults`, not `device_default`.
swapnil force-pushed master from a7909a00bf to 59a8f35db6 2024-05-03 12:39:00 +02:00 Compare
swapnil force-pushed master from 46ba0e7057 to 31c955c5b9 2024-05-06 06:51:02 +02:00 Compare
PeterSurda approved these changes 2024-05-06 07:04:50 +02:00
PeterSurda merged commit 31c955c5b9 into master 2024-05-06 07:05:03 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Sysdeploy/ansible-modules-syncthing#2
No description provided.