Skip to content

Latest commit

 

History

History
152 lines (116 loc) · 4.11 KB

ansible.netcommon.comp_type5_filter.rst

File metadata and controls

152 lines (116 loc) · 4.11 KB

ansible.netcommon.comp_type5

The comp_type5 filter plugin.

Version added: 1.0.0

  • The filter confirms configuration idempotency on use of type5_pw.
Parameter Choices/Defaults Configuration Comments
encrypted_password
string / required
The encrypted text.
return_original
boolean
    Choices:
  • no
  • yes
Return the original text.
unencrypted_password
string / required
The unencrypted text.

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

Authors

  • 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.