|
|
@ -185,14 +185,14 @@ def map_obj_to_commands(updates, module):
|
|
|
|
|
|
|
|
|
|
|
|
elif state == 'present':
|
|
|
|
elif state == 'present':
|
|
|
|
if ipv4:
|
|
|
|
if ipv4:
|
|
|
|
if obj_in_have is None or ipv4 != obj_in_have['ipv4']:
|
|
|
|
if obj_in_have is None or obj_in_have.get('ipv4') is None or ipv4 != obj_in_have['ipv4']:
|
|
|
|
address = ipv4.split('/')
|
|
|
|
address = ipv4.split('/')
|
|
|
|
if len(address) == 2:
|
|
|
|
if len(address) == 2:
|
|
|
|
ipv4 = '{0} {1}'.format(address[0], to_netmask(address[1]))
|
|
|
|
ipv4 = '{0} {1}'.format(address[0], to_netmask(address[1]))
|
|
|
|
commands.append('ip address {}'.format(ipv4))
|
|
|
|
commands.append('ip address {}'.format(ipv4))
|
|
|
|
|
|
|
|
|
|
|
|
if ipv6:
|
|
|
|
if ipv6:
|
|
|
|
if obj_in_have is None or obj_in_have['ipv6'] is None or ipv6.lower() != obj_in_have['ipv6'].lower():
|
|
|
|
if obj_in_have is None or obj_in_have.get('ipv6') is None or ipv6.lower() != obj_in_have['ipv6'].lower():
|
|
|
|
commands.append('ipv6 address {}'.format(ipv6))
|
|
|
|
commands.append('ipv6 address {}'.format(ipv6))
|
|
|
|
|
|
|
|
|
|
|
|
if commands[-1] == interface:
|
|
|
|
if commands[-1] == interface:
|
|
|
|