From 7ce1cae7adbcad2d1d9ea9b0cb7db45e09cced03 Mon Sep 17 00:00:00 2001 From: Valentin Gurmeza Date: Thu, 1 Jun 2017 16:43:57 -0700 Subject: [PATCH] add check mode to hotpot module --- library/mt_hotspot.py | 4 +++- tests/integration/tests.yml | 36 ++++++++++++++++++++++++++++++------ 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/library/mt_hotspot.py b/library/mt_hotspot.py index cfbc1be..da1a65b 100644 --- a/library/mt_hotspot.py +++ b/library/mt_hotspot.py @@ -72,7 +72,8 @@ def main(): choices = ['present', 'absent'], type = 'str' ), - ) + ), + supports_check_mode=True ) idempotent_parameter = None @@ -94,6 +95,7 @@ def main(): desired_params = params['settings'], idempotent_param = idempotent_parameter, api_path = '/ip/' + str(params['parameter']), + check_mode = module.check_mode, ) diff --git a/tests/integration/tests.yml b/tests/integration/tests.yml index 0199160..481753a 100644 --- a/tests/integration/tests.yml +++ b/tests/integration/tests.yml @@ -1679,7 +1679,11 @@ radius-interim-update: 3m use-radius: "yes" 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 mt_hotspot: @@ -1727,7 +1731,11 @@ profile: Hotspot1 idle-timeout: 3s 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 mt_hotspot: @@ -1772,7 +1780,11 @@ server: NETACCESS1 method: PUT 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 mt_hotspot: @@ -1799,7 +1811,11 @@ settings: comment: "Allow Personal Web Portal" 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 mt_hotspot: @@ -1811,7 +1827,11 @@ settings: name: NETACCESS1 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 mt_hotspot: @@ -1823,7 +1843,11 @@ settings: name: Hotspot1 register: profile_rem - failed_when: not ( profile_rem | changed ) + failed_when: ( + not ansible_check_mode + ) and ( + not ( profile_rem | changed ) + ) tags: hotspot ###################