The comp_type5 filter plugin.
Version added: 1.0.0
- The filter confirms configuration idempotency on use of type5_pw.
Note
- The filter confirms configuration idempotency on use of type5_pw.
- Can be used to validate password post hashing username cisco secret 5 {{ ansible_ssh_pass | ansible.netcommon.comp_type5(encrypted, True) }}
# Using comp_type5
# playbook
- name: Set the facts
ansible.builtin.set_fact:
unencrypted_password: "cisco@123"
encrypted_password: "$1$avs$uSTOEMh65ADDBREAKqzvpb9yBMpzd/"
- name: Invoke comp_type5
ansible.builtin.debug:
msg: "{{ unencrypted_password | ansible.netcommon.comp_type5(encrypted_password, False) }}"
# Task Output
# -----------
#
# TASK [Set the facts]
# ok: [35.155.113.92] => changed=false
# ansible_facts:
# encrypted_password: $1$avs$uSTOEMh65ADDBREAKqzvpb9yBMpzd/
# unencrypted_password: cisco@123
# TASK [Invoke comp_type5]
# ok: [35.155.113.92] =>
# msg: true
- Ken Celenza (@itdependsnetworks)
Hint
Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.