ansible.netcommon.type5_pw filter – The type5_pw filter plugin.

Note

This filter plugin is part of the ansible.netcommon collection (version 7.1.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install ansible.netcommon.

To use it in a playbook, specify: ansible.netcommon.type5_pw.

New in ansible.netcommon 1.0.0

Synopsis

  • Filter plugin to produce cisco type5 hashed password.

  • Using the parameters below - xml_data | ansible.netcommon.type5_pw(template.yml)

Keyword parameters

This describes keyword parameters of the filter. These are the values key1=value1, key2=value2 and so on in the following example: input | ansible.netcommon.type5_pw(key1=value1, key2=value2, ...)

Parameter

Comments

password

string / required

The password to be hashed.

salt

string

Mention the salt to hash the password.

Notes

Note

  • The filter plugin generates cisco type5 hashed password.

Examples

# Using type5_pw

- name: Set some facts
  ansible.builtin.set_fact:
    password: "cisco@123"

- name: Filter type5_pw invocation
  ansible.builtin.debug:
    msg: "{{ password | ansible.netcommon.type5_pw(salt='avs') }}"


# Task Output
# -----------
#
# TASK [Set some facts]
# ok: [host] => changed=false
#   ansible_facts:
#     password: cisco@123

# TASK [Filter type5_pw invocation]
# ok: [host] =>
#   msg: $1$avs$uSTOEMh65qzvpb9yBMpzd/

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.