mirror of
https://github.com/zahodi/ansible-mikrotik.git
synced 2025-07-10 10:14:24 +02:00
add check mode to system module
This commit is contained in:
parent
fcd02f6384
commit
1326fad5c1
2 changed files with 76 additions and 62 deletions
|
@ -73,7 +73,8 @@ def main():
|
|||
choices = ['present', 'absent'],
|
||||
type = 'str'
|
||||
),
|
||||
)
|
||||
),
|
||||
supports_check_mode=True
|
||||
)
|
||||
|
||||
params = module.params
|
||||
|
@ -93,6 +94,7 @@ def main():
|
|||
desired_params = params['settings'],
|
||||
idempotent_param= None,
|
||||
api_path = '/system/' + params['parameter'],
|
||||
check_mode = module.check_mode
|
||||
)
|
||||
|
||||
mt_obj.sync_state()
|
||||
|
|
|
@ -1432,7 +1432,11 @@
|
|||
settings:
|
||||
time-zone-name: GMT
|
||||
register: mt_clock
|
||||
failed_when: not ( mt_clock | changed )
|
||||
failed_when: (
|
||||
not ansible_check_mode
|
||||
) and (
|
||||
not ( mt_clock | changed )
|
||||
)
|
||||
|
||||
- name: set ntp client
|
||||
mt_system:
|
||||
|
@ -1456,7 +1460,11 @@
|
|||
primary-ntp: 199.182.221.11
|
||||
secondary-ntp: 67.215.197.149
|
||||
register: mt_ntp_client
|
||||
failed_when: ( mt_ntp_client | changed )
|
||||
failed_when: (
|
||||
not ansible_check_mode
|
||||
) and (
|
||||
( mt_ntp_client | changed )
|
||||
)
|
||||
|
||||
- name: ALWAYS_CHANGES modify ntp client
|
||||
mt_system:
|
||||
|
@ -1469,7 +1477,11 @@
|
|||
primary-ntp: 199.182.221.11
|
||||
secondary-ntp: 67.215.197.149
|
||||
register: mt_ntp_client_change
|
||||
failed_when: not ( mt_ntp_client_change | changed )
|
||||
failed_when: (
|
||||
not ansible_check_mode
|
||||
) and (
|
||||
not ( mt_ntp_client_change | changed )
|
||||
)
|
||||
|
||||
##############################################
|
||||
# WIP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue