add check mode to hotpot module

This commit is contained in:
Valentin Gurmeza 2017-06-01 16:43:57 -07:00
parent a2b454cd8c
commit 7ce1cae7ad
2 changed files with 33 additions and 7 deletions

View file

@ -72,7 +72,8 @@ def main():
choices = ['present', 'absent'], choices = ['present', 'absent'],
type = 'str' type = 'str'
), ),
) ),
supports_check_mode=True
) )
idempotent_parameter = None idempotent_parameter = None
@ -94,6 +95,7 @@ def main():
desired_params = params['settings'], desired_params = params['settings'],
idempotent_param = idempotent_parameter, idempotent_param = idempotent_parameter,
api_path = '/ip/' + str(params['parameter']), api_path = '/ip/' + str(params['parameter']),
check_mode = module.check_mode,
) )

View file

@ -1679,7 +1679,11 @@
radius-interim-update: 3m radius-interim-update: 3m
use-radius: "yes" use-radius: "yes"
register: profile_add register: profile_add
failed_when: ( profile_add | changed ) failed_when: (
not ansible_check_mode
) and (
( profile_add | changed )
)
- name: ALWAYS_CHANGES edit a hotspot profile, check changes - name: ALWAYS_CHANGES edit a hotspot profile, check changes
mt_hotspot: mt_hotspot:
@ -1727,7 +1731,11 @@
profile: Hotspot1 profile: Hotspot1
idle-timeout: 3s idle-timeout: 3s
register: hotspot_add register: hotspot_add
failed_when: ( hotspot_add | changed ) failed_when: (
not ansible_check_mode
) and (
( hotspot_add | changed )
)
- name: ALWAYS_CHANGES edit a hotspot, check changes - name: ALWAYS_CHANGES edit a hotspot, check changes
mt_hotspot: mt_hotspot:
@ -1772,7 +1780,11 @@
server: NETACCESS1 server: NETACCESS1
method: PUT method: PUT
register: walled_garden_add register: walled_garden_add
failed_when: ( walled_garden_add | changed ) failed_when: (
not ansible_check_mode
) and (
( walled_garden_add | changed )
)
- name: ALWAYS_CHANGES edit walled-garden settings, check changes - name: ALWAYS_CHANGES edit walled-garden settings, check changes
mt_hotspot: mt_hotspot:
@ -1799,7 +1811,11 @@
settings: settings:
comment: "Allow Personal Web Portal" comment: "Allow Personal Web Portal"
register: walled_garden_rem register: walled_garden_rem
failed_when: not ( walled_garden_rem | changed ) failed_when: (
not ansible_check_mode
) and (
not ( walled_garden_rem | changed )
)
- name: ALWAYS_CHANGES remove a hotspot - name: ALWAYS_CHANGES remove a hotspot
mt_hotspot: mt_hotspot:
@ -1811,7 +1827,11 @@
settings: settings:
name: NETACCESS1 name: NETACCESS1
register: hotspot_rem register: hotspot_rem
failed_when: not ( hotspot_rem | changed ) failed_when: (
not ansible_check_mode
) and (
not ( hotspot_rem | changed )
)
- name: ALWAYS_CHANGES remove a hotspot profile - name: ALWAYS_CHANGES remove a hotspot profile
mt_hotspot: mt_hotspot:
@ -1823,7 +1843,11 @@
settings: settings:
name: Hotspot1 name: Hotspot1
register: profile_rem register: profile_rem
failed_when: not ( profile_rem | changed ) failed_when: (
not ansible_check_mode
) and (
not ( profile_rem | changed )
)
tags: hotspot tags: hotspot
################### ###################