# Problem removing a static route of a vhf in NXOS

**URL:** <https://forum.ansible.com/t/problem-removing-a-static-route-of-a-vhf-in-nxos/30859>\
**Category:** Ansible Project\
**Created:** [July 24, 2019, 1:25pm UTC](https://forum.ansible.com/t/problem-removing-a-static-route-of-a-vhf-in-nxos/30859 "2019-07-24T13:25:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fernando\_Garcia\_Fern](https://avatars.discourse-cdn.com/v4/letter/f/9e8a1a/32.png) [@Fernando\_Garcia\_Fern](https://forum.ansible.com/u/Fernando_Garcia_Fern)\
**Post date:** [July 24, 2019, 1:25pm UTC](https://forum.ansible.com/t/problem-removing-a-static-route-of-a-vhf-in-nxos/30859/1 "2019-07-24T13:25:22Z")

</div>

Hi

We’re using Ansible 2.8 and we’re trying to remove a static route defined in a vrf, but even following documentation directives (setting state to absent), it doesn’t work.

From “show run” I see:

vrf context MIDDLE  
description MIDDLE VRF  
…  
ip route 10.236.250.39/32 10.230.135.81 name xxxx 24

When I execute my code in dry run it says no change and:

ok: [[nex4010.oob.mad.novumproject.com](http://nex4010.oob.mad.novumproject.com)] =\> {  
“changed”: false,  
“commands”: ,  
“invocation”: {  
…  
{  
“next\_hop”: “10.230.135.81”,  
“pref”: “default”,  
“prefix”: “10.236.250.39/32”,  
“route\_name”: “cirte\_li\_prod”,  
“state”: “absent”,  
“tag”: “default”,  
“track”: null,  
“vrf”: “default”  
},

And of course when I execute it in not dry-run mode, it simply doesn’t execute it.

The Ansible task is:

- name: “Ensure VRF {{ item.key }} routes”  
connection: network\_cli  
nxos\_static\_route:  
aggregate: “{{ item.value.routes | dict2items | routes\_params(item.key) }}”  
tags:
- vrf
- routing

And the routes\_params task generates a list of routes that in this case is what I put before.

Is a bug or something that I’m doing incorrectly?
