Open tin-ot opened 2 years ago
@tin-ot
Hi @roverflow - I am seeing the same issues as described by tin-ot.
- name: "Add user"
cisco.ios.ios_user:
aggregate:
- name: "{{ new_username }}"
hashed_password:
type: 9
value: "{{ new_user_secret }}"
privilege: 15
state: present
update_password: on_create
Task output:
fatal: [device-hostname]: FAILED! => changed=false
module_stderr: '''update_password'''
module_stdout: ''
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
I also see the same issue with hashes not being hidden in output, and agree with tin-ot's enhancement suggestions.
This is with ansible 2.15 and cisco.ios 5.1.0.
SUMMARY
I noticed 3 different issues with this module:
1) module breaks when the update_password is used in the aggregate dictionary.
(this breaks)
works as expected is defined like this :
(this works)
2) some hashes are not blurred in the output with no log
expected result : "username dummy secret **** ****" actual result: "username dummy secret **** $****$human_readable_hash****",
This behaviour depends on the hash. Some are blurred others are clear.
3) ( more of an enhancement ) There is no choice regarding encryption. The only algorithm available through the module is md5 which considered broken. The only recommanded encryption algorithm, as of today, is scrypt. Even if it is possible to configure the device with a hashed password ... it will set the same hash on all configuration files which is not desirable neither.
Proposition: add a new key word in the module to choose the encryption algorithm with clear password as input. the command to be :
username <username> privilege 15 algorithm-type scrypt secret <secret>
Work around:
Use the module "naked" with purge key set to true; Configure desired users and passwords with config module in another task.
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
module failure with aggregate