-
Notifications
You must be signed in to change notification settings - Fork 109
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
cisco.nxos.nxos_snmp_server - state overridden #803
Comments
@jorgenspange @NilashishC I already created #794 and addressed this issue in PR #795. Nevertheless there are still unresolved issues as you can read in this comment. The issue is not only about Due to the fact that I still got no answer from the developers this issue can not be resolved. |
@jorgenspange I'm not sure if I understand the expected results here.
Since the OS uses salted hashes to store passwords, I don't think we can compute that from plain-text passwords with Ansible and use the salted hash to compare if there's a diff or not. If we do not consider passwords when calculating diff, we will be missing out on cases where there's actually a diff and we need to send updates. Coming to the specific task you shared, the actual results are in line with how it should behave with For the 2nd run, it is important to understand that the user along with all it's properties are considered to be the "unique key", since the plain text password mentioned in your task doesn't match with the salted hash in running-config. The user in running-config is marked as superfluous and a negate command is sent to remove it. The In short, this is how overridden is meant to behave. You can either use Does that answer some of your questions? |
Yeah my question is answered, thing is that I would like to negate all config that is not in my ansible task, other than the user. user_override: false or something so that one could granulate this. |
@jorgenspange can you share a sample before config and after config based on what you're looking for? |
n9k-n93180yc-fx# show run snmp
!Command: show running-config snmp
!Running configuration last done at: Mon Jun 3 10:04:07 2024
!Time: Thu Jun 6 14:10:51 2024
version 9.3(12) Bios:version 05.47
snmp-server contact {{ snmp_contact }}
snmp-server location {{ snmp_location }}}
snmp-server user admin network-admin auth sha blabla priv aes-128 blabla localizedV2key
snmp-server user snmp_ro network-operator auth sha blabla priv aes-128 blabla localizedV2key
snmp-server user snmp_rw network-admin auth sha blabla priv aes-128 blabla localizedV2key
snmp-server user admin use-ipv4acl black_hole
snmp-server user snmp_ro use-ipv4acl snmp-acl
snmp-server user snmp_rw use-ipv4acl snmp-acl Unfortunately I dont have any before configuration as the snmp config across my nexuses has been cleaned up. If I need to change the password on my user I could then run user_override: true And it would change the users. |
@jorgenspange Understood! In that case, you'd have to follow the same We have higher-level solutions to help with this as well. For example, you can explore the network.base validated content. Out of the many operations it supports, one is persist, which provides an agnostic way to build brownfield inventory, either locally or in a remote SCM repo. Once the brownfield inventory is ready, it can be modified and the updates can be pushed with the I'd highly encourage you to give it a try and share your feedback. |
I'll be closing this ticket with the above explanation. But, I'll be more than happy to continue this conversation with you. Please feel free to reach out over ansiblenetwork.slack.com or https://matrix.to/#/#network:ansible.com. Thank you! |
SUMMARY
Idemptoncy breaks when you apply password in clear text.
ISSUE TYPE
COMPONENT NAME
cisco.nxos.nxos_snmp_server
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Macbook Pro 2021 M1
STEPS TO REPRODUCE
EXPECTED RESULTS
Should define users if they are not there, should not delete them if password mismatches, because password is salted hash.
ACTUAL RESULTS
When you apply multiple times it deletes the user when you have password specified as clear text and not the salted hash which is in the running config on the switch.
1th run
2nd run
It also tries to delete the default admin user which is not possible to delete:
The text was updated successfully, but these errors were encountered: