add check mode to radius

remove ovpn_client module
This commit is contained in:
Valentin Gurmeza 2017-06-05 16:10:27 -07:00
parent 928c795f4a
commit 2db5b6ee10
4 changed files with 47 additions and 479 deletions

View file

@ -94,30 +94,31 @@ from ansible.module_utils.basic import AnsibleModule
def main():
module = AnsibleModule(
argument_spec=dict(
hostname= dict(required=True),
username= dict(required=True),
password= dict(required=True),
address = dict(required=False, type='str'),
comment = dict(required=True, type='str'),
secret = dict(required=False, type='str'),
service = dict(required=False, type='list'),
timeout = dict(required=False, type='str'),
incoming= dict(required=False, type='dict'),
state = dict(
required = True,
choices = ['present', 'absent'],
type = 'str'
),
)
argument_spec=dict(
hostname= dict(required=True),
username= dict(required=True),
password= dict(required=True),
address = dict(required=False, type='str'),
comment = dict(required=True, type='str'),
secret = dict(required=False, type='str'),
service = dict(required=False, type='list'),
timeout = dict(required=False, type='str'),
incoming= dict(required=False, type='dict'),
state = dict(
required = True,
choices = ['present', 'absent'],
type = 'str'
),
),
supports_check_mode=True
)
hostname = module.params['hostname']
username = module.params['username']
password = module.params['password']
state = module.params['state']
check_mode = module.check_mode
changed = False
msg = ""
@ -147,10 +148,12 @@ def main():
pass
else:
# edit port
mk.api_edit(base_path=incoming_path, params=incoming)
if not check_mode:
mk.api_edit(base_path=incoming_path, params=incoming)
else:
# edit the accept and the port
mk.api_edit(base_path=incoming_path, params=incoming)
if not check_mode:
mk.api_edit(base_path=incoming_path, params=incoming)
#######################################
# Since we are grabbing all the parameters passed by the module
# We need to remove the one that won't be used