summaryrefslogtreecommitdiff
path: root/plugins/modules
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/modules')
-rw-r--r--plugins/modules/vyos_ntp_global.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/plugins/modules/vyos_ntp_global.py b/plugins/modules/vyos_ntp_global.py
index 185dc02..88073e1 100644
--- a/plugins/modules/vyos_ntp_global.py
+++ b/plugins/modules/vyos_ntp_global.py
@@ -218,13 +218,12 @@ def build_commands(desired, existing, state):
cmds = []
if state == "overridden":
- if existing["allow_clients"]:
- cmds.append(("delete", ["service", "ntp", "allow-client"]))
- if existing["listen_addresses"]:
- cmds.append(("delete", ["service", "ntp", "listen-address"]))
- if existing["servers"]:
- cmds.append(("delete", ["service", "ntp", "server"]))
- state = "merged"
+ state = "replaced"
+
+ if state == "deleted":
+ if existing["servers"] or existing["allow_clients"] or existing["listen_addresses"]:
+ cmds.append(("delete", ["service", "ntp"]))
+ return cmds
cmds += diff_list(
"allow-client",