|
|
@ -189,16 +189,17 @@ def main():
|
|
|
|
supports_check_mode=True)
|
|
|
|
supports_check_mode=True)
|
|
|
|
|
|
|
|
|
|
|
|
address = module.params['address']
|
|
|
|
address = module.params['address']
|
|
|
|
prefix = address.split('/')[-1]
|
|
|
|
if address is not None:
|
|
|
|
warnings = list()
|
|
|
|
prefix = address.split('/')[-1]
|
|
|
|
check_args(module, warnings)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if '/' not in address or not validate_ip_address(address.split('/')[0]):
|
|
|
|
if address and prefix:
|
|
|
|
module.fail_json(msg='{} is not a valid IP address'.format(address))
|
|
|
|
if '/' not in address or not validate_ip_address(address.split('/')[0]):
|
|
|
|
|
|
|
|
module.fail_json(msg='{} is not a valid IP address'.format(address))
|
|
|
|
|
|
|
|
|
|
|
|
if not validate_prefix(prefix):
|
|
|
|
if not validate_prefix(prefix):
|
|
|
|
module.fail_json(msg='Length of prefix should be between 0 and 32 bits')
|
|
|
|
module.fail_json(msg='Length of prefix should be between 0 and 32 bits')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
warnings = list()
|
|
|
|
result = {'changed': False}
|
|
|
|
result = {'changed': False}
|
|
|
|
if warnings:
|
|
|
|
if warnings:
|
|
|
|
result['warnings'] = warnings
|
|
|
|
result['warnings'] = warnings
|
|
|
|