ansible.netcommon.type5_pw filter – The type5_pw filter plugin.
Note
This filter plugin is part of the ansible.netcommon collection (version 8.5.2).
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)This plugin uses do_encrypt if used with ansible-core 2.20+ and passlib_or_crypt for versions before 2.20
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 |
|---|---|
The password to be hashed. |
|
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/