Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The ios_config module does not delete the username from the router #29807

Closed
ansibot opened this issue Sep 12, 2017 · 13 comments
Closed

The ios_config module does not delete the username from the router #29807

ansibot opened this issue Sep 12, 2017 · 13 comments
Labels
affects_2.0 This issue/PR affects Ansible v2.0 bug This issue/PR relates to a bug. cisco Cisco technologies ios Cisco IOS community module This issue/PR relates to a module. needs_info This issue requires further information. Please answer any outstanding questions. networking Network category support:network This issue/PR relates to code supported by the Ansible Network Team.

Comments

@ansibot
Copy link
Contributor

ansibot commented Sep 12, 2017

From @ubajze on 2016-05-03T18:19:03Z

ISSUE TYPE
  • Bug Report
COMPONENT NAME

networking/ios_config

ANSIBLE VERSION
$ ansible --version
ansible 2.0.1.0
CONFIGURATION

No configuration.

OS / ENVIRONMENT

Working on Ubuntu, release trusty. The issue is not platform dependent.

SUMMARY

When using command "no username" with ios_config module, the task timeouts.

STEPS TO REPRODUCE

I am using the following task configuration in the playbook.

    - name: Delete users
      ios_config:
        host: "{{ ansible_ssh_host }}"
        username: "{{ username }}"
        password: "{{ password }}"
        lines:
          - no username admin

The result of the task is:

TASK [Delete users] ************************************************************
fatal: [hub]: FAILED! => {"changed": false, "commands": ["configure terminal", "no username admin"], "failed": true, "msg": "timeout trying to send command"}

The reason for this is that Cisco ask for confirmation when deleting the username from the configuration.

R2(config)#no username admin
This operation will remove all username related configurations with same name.Do you want to continue? [confirm]
R2(config)#
EXPECTED RESULTS

It is expected that command should be deleted from the configuration.

ACTUAL RESULTS
fatal: [wan1]: FAILED! => {"changed": false, "commands": ["configure terminal", "no username admin"], "failed": true, "invocation": {"module_args": {"after": null, "auth_pass": null, "authorize": false, "before": null, "config": null, "force": false, "host": "192.168.35.152", "lines": ["no username admin"], "match": "line", "parents": null, "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "port": 22, "provider": null, "replace": "line", "username": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER"}, "module_name": "ios_config"}, "msg": "timeout trying to send command"}

Copied from original issue: ansible/ansible-modules-core#3591

@ansibot
Copy link
Contributor Author

ansibot commented Sep 12, 2017

From @nitzmahone on 2016-05-03T18:19:03Z

cc @Qalthos @privateip

@ansibot
Copy link
Contributor Author

ansibot commented Sep 12, 2017

From @dabruzzo on 2016-05-03T18:19:03Z

Same problem for ios_command module.

@ansibot ansibot added the affects_2.0 This issue/PR affects Ansible v2.0 label Sep 12, 2017
@ansibot
Copy link
Contributor Author

ansibot commented Sep 12, 2017

From @gundalow on 2016-05-03T18:19:03Z

@privateip and I reviewed this today. If we get time for 2.2 we would like to do this, however it is a low priority.

@ansibot
Copy link
Contributor Author

ansibot commented Sep 12, 2017

From @gundalow on 2016-05-03T18:19:03Z

We will fix this in 2.3, this will not be backported to 2.2.

@ansibot
Copy link
Contributor Author

ansibot commented Sep 12, 2017

@ansibot ansibot added bug_report module This issue/PR relates to a module. networking Network category support:network This issue/PR relates to code supported by the Ansible Network Team. labels Sep 12, 2017
@ansible ansible deleted a comment from biomassives Sep 12, 2017
@trishnaguha
Copy link
Member

Hi, can you please retest this on 2.4.0 RC3, we believe it should be fixed.

https://groups.google.com/forum/#!topic/ansible-devel/PjBtOkwbt5I

Thanks
needs_info

@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label Sep 15, 2017
@gundalow
Copy link
Contributor

This bug was originally raised on 2.0 therefore not a blocker for 2.4.0

@ansibot
Copy link
Contributor Author

ansibot commented Oct 17, 2017

cc @kedarX
click here for bot help

@ansibot ansibot removed the needs_info This issue requires further information. Please answer any outstanding questions. label Oct 17, 2017
@trishnaguha trishnaguha added the needs_info This issue requires further information. Please answer any outstanding questions. label Jan 30, 2018
@maddog-nn
Copy link

Hi guys. I have the same problem:
# ansible --version
ansible 2.4.3.0

error:
fatal: [hq-edge-01]: FAILED! => {"changed": false, "command": "no username test", "msg": "timeout trying to send command: no username test", "rc": 1}

what I try to do:
- name: Remove test user from device
ios_config:
lines:
- no username test
provider: "{{ cli }}"
when: "'test' in ios_output.stdout[0]"

@trishnaguha
Copy link
Member

trishnaguha commented Feb 22, 2018

This is because of the ios prompt when deleting user: This operation will remove all username related configurations with same name -> Y/N. This is handled in ios_user module. Please use ios_user module instead for 2.4 or 2.5. We do not have support to handle prompt in config mode currently.

@maddog-nn
Copy link

Thank you a lot!

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 1, 2018
@ansibot
Copy link
Contributor Author

ansibot commented Mar 9, 2018

@ubajze This issue is waiting for your response. Please respond or the issue will be closed.

click here for bot help

@ansibot
Copy link
Contributor Author

ansibot commented Apr 14, 2018

@ubajze You have not responded to information requests in this issue so we will assume it no longer affects you. If you are still interested in this, please create a new issue with the requested information.

click here for bot help

@ansibot ansibot closed this as completed Apr 14, 2018
@dagwieers dagwieers added ios Cisco IOS community cisco Cisco technologies labels Feb 23, 2019
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.0 This issue/PR affects Ansible v2.0 bug This issue/PR relates to a bug. cisco Cisco technologies ios Cisco IOS community module This issue/PR relates to a module. needs_info This issue requires further information. Please answer any outstanding questions. networking Network category support:network This issue/PR relates to code supported by the Ansible Network Team.
Projects
None yet
Development

No branches or pull requests

5 participants