|
|
@ -61,7 +61,6 @@ options:
|
|
|
|
admin_distance:
|
|
|
|
admin_distance:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Admin distance of the static route.
|
|
|
|
- Admin distance of the static route.
|
|
|
|
default: 1
|
|
|
|
|
|
|
|
tag:
|
|
|
|
tag:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Set tag of the static route.
|
|
|
|
- Set tag of the static route.
|
|
|
@ -149,6 +148,9 @@ def map_obj_to_commands(want, have):
|
|
|
|
del w['state']
|
|
|
|
del w['state']
|
|
|
|
# Try to match an existing config with the desired config
|
|
|
|
# Try to match an existing config with the desired config
|
|
|
|
for h in have:
|
|
|
|
for h in have:
|
|
|
|
|
|
|
|
# To delete admin_distance param from have if not it want before comparing both fields
|
|
|
|
|
|
|
|
if not w.get('admin_distance') and h.get('admin_distance'):
|
|
|
|
|
|
|
|
del h['admin_distance']
|
|
|
|
diff = list(set(w.items()) ^ set(h.items()))
|
|
|
|
diff = list(set(w.items()) ^ set(h.items()))
|
|
|
|
if not diff:
|
|
|
|
if not diff:
|
|
|
|
break
|
|
|
|
break
|
|
|
@ -259,7 +261,7 @@ def main():
|
|
|
|
vrf=dict(type='str'),
|
|
|
|
vrf=dict(type='str'),
|
|
|
|
interface=dict(type='str'),
|
|
|
|
interface=dict(type='str'),
|
|
|
|
name=dict(type='str', aliases=['description']),
|
|
|
|
name=dict(type='str', aliases=['description']),
|
|
|
|
admin_distance=dict(type='str', default='1'),
|
|
|
|
admin_distance=dict(type='str'),
|
|
|
|
track=dict(type='str'),
|
|
|
|
track=dict(type='str'),
|
|
|
|
tag=dict(tag='str'),
|
|
|
|
tag=dict(tag='str'),
|
|
|
|
state=dict(default='present', choices=['present', 'absent'])
|
|
|
|
state=dict(default='present', choices=['present', 'absent'])
|
|
|
|