mirror of
https://github.com/zahodi/ansible-mikrotik.git
synced 2025-08-02 00:54:42 +02:00
add check mode to radius
This commit is contained in:
parent
5b2dcf38d8
commit
ad07458649
1 changed files with 6 additions and 3 deletions
|
@ -207,7 +207,8 @@ def main():
|
|||
#######################################################
|
||||
if state == "present":
|
||||
if mikrotik_radius == {}:
|
||||
mk.api_add(base_path=radius_path, params=radius_params)
|
||||
if not check_mode:
|
||||
mk.api_add(base_path=radius_path, params=radius_params)
|
||||
module.exit_json(
|
||||
failed=False,
|
||||
changed=True,
|
||||
|
@ -224,7 +225,8 @@ def main():
|
|||
radius_diff_keys[key] = radius_params[key]
|
||||
if radius_diff_keys != {}:
|
||||
radius_diff_keys['numbers'] = radius_id
|
||||
mk.api_edit(base_path=radius_path, params=radius_diff_keys)
|
||||
if not check_mode:
|
||||
mk.api_edit(base_path=radius_path, params=radius_diff_keys)
|
||||
module.exit_json(
|
||||
failed=False,
|
||||
changed=True,
|
||||
|
@ -239,7 +241,8 @@ def main():
|
|||
)
|
||||
elif state == "absent":
|
||||
if radius_id:
|
||||
mk.api_remove(base_path=radius_path, remove_id=radius_id)
|
||||
if not check_mode:
|
||||
mk.api_remove(base_path=radius_path, remove_id=radius_id)
|
||||
module.exit_json(
|
||||
failed=False,
|
||||
changed=True,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue