HuaweiSwitch / CloudEngine-Ansible

Ansible modules to automate HUAWEI CloudEngine switches
GNU General Public License v3.0
144 stars 51 forks source link

ce_static_route state:absent does not work #58

Open lonelyword opened 5 years ago

lonelyword commented 5 years ago

ce_static_route state:present works but state:absent does not work

playbook:

after run: PLAY [static route] ****

TASK [config static route] ***** [DEPRECATION WARNING]: Param 'transport' is deprecated. See the module docs for more information. This feature will be removed in version 2.9. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. changed: [1.1.1.1]

PLAY RECAP ***** 1.1.1.1 : ok=1 changed=1 unreachable=0 failed=0

in switch, display:

disp curr | in 2.2.2.2 ip route-static 2.2.2.2 255.255.255.255 5.5.5.5 -------------------------------------------------------------------------------------- After change present to absent, playbook: playbook: - name: config static route ce_static_route: prefix: 2.2.2.2 mask: 32 next_hop: 5.5.5.5 aftype: v4 #description: "Ansible" state: absent after run: PLAY [static route] **************************************************************************************************************************************************** TASK [config static route] ********************************************************************************************************************************************* [DEPRECATION WARNING]: Param 'transport' is deprecated. See the module docs for more information. This feature will be removed in version 2.9. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. ok: [1.1.1.1] PLAY RECAP ************************************************************************************************************************************************************* 1.1.1.1 : ok=1 changed=0 unreachable=0 failed=0 in switch, display: disp curr | in 2.2.2.2 ip route-static 2.2.2.2 255.255.255.255 5.5.5.5
yuandongx commented 5 years ago

"invocation": { "module_args": { "aftype": "v4", "description": null, "destvrf": null, "host": "10.190.121.125", "mask": "32", "next_hop": "5.5.5.5", "nhp_interface": null, "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "port": 10099, "pref": null, "prefix": "2.2.2.2", "provider": { "host": "10.190.121.125", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "port": 10099, "ssh_keyfile": null, "timeout": null, "transport": "cli", "use_ssl": null, "username": "huawei", "validate_certs": null }, "ssh_keyfile": null, "state": "absent", "tag": null, "timeout": null, "transport": "cli", "use_ssl": null, "username": "huawei", "validate_certs": null, "vrf": null } }, [~6880-110.214]dis cu | in 2.2.2.2 ip route-static 2.2.2.2 255.255.255.255 5.5.5.5 [~6880-110.214]dis cu | in 2.2.2.2 [~6880-110.214]

I verified on anisble-2.7.0 that there is no problem deleting(state:absent) static routes. Can you provide your version number or more detailed information?

lonelyword commented 5 years ago

Ansible Version:2.7.5 Switch Version:V200R003C00SPC810

more details shows below

"changed": false, "end_state": { "sroute": [] }, "existing": { "sroute": [] }, "invocation": { "module_args": { "aftype": "v4", "description": null, "destvrf": null, "host": "1.1.1.1", "mask": "32", "next_hop": "5.5.5.5", "nhp_interface": null, "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "port": 22, "pref": null, "prefix": "2.2.2.2", "provider": { "host": "1.1.1.1", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "port": 22, "ssh_keyfile": null, "timeout": null, "transport": "cli", "use_ssl": null, "username": "admin", "validate_certs": null }, "ssh_keyfile": null, "state": "absent", "tag": null, "timeout": null, "transport": "cli", "use_ssl": null, "username": "admin", "validate_certs": null, "vrf": null } }, "proposed": { "afType": "v4", "destVrfName": "public", "ifName": "Invalid0", "mask": "32", "next_hop": "5.5.5.5", "preference": 60, "prefix": "2.2.2.2", "state": "absent", "vrfName": "public" }, "updates": [] } META: ran handlers META: ran handlers

PLAY RECAP ***** 1.1.1.1 : ok=1 changed=0 unreachable=0 failed=0