Coder Social home page Coder Social logo

ciphernaut / ansible-filter-cisco-hash Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mjuenema/ansible-filter-cisco-hash

0.0 1.0 0.0 24 KB

Ansible Jinja2 filters for Cisco type 5 and type 7 password hashes

License: BSD 2-Clause "Simplified" License

Python 100.00%

ansible-filter-cisco-hash's Introduction

Travis master branch Travis develop branch GitHub release

ansible-filter-cisco-hash

Ansible Jinja2 filters for Cisco type 5 and type 7 password hashes. This requires the Passlib Python library.

  • {{password|ciscohash5}} (see Note)
  • {{password|ciscohash7}}
  • {{password|ciscohashpix}}
  • {{password|ciscohashpix(user)}}
  • {{password|ciscohashpasa}} (only with Passlib 1.7 or later)
  • {{password|ciscohashasa(user)}} (only with Passlib 1.7 or later)

Note: Because the hash will be different at each invocation one has to add a when condition to the task as shown in the example below.

The filter plugin works with Ansible 2.0+ and Passlib 1.6+.

Usage

The filters are wrapped into an Ansible role which can be installed directly from Github.

pip install passlib
ansible-galaxy install -f git+https://github.com/mjuenema/ansible-filter-cisco-hash.git

The role does not contain any playbooks but once you reference in your own playbook the filters become available.

Example

- name: Configure Cisco IOS
  hosts: routers

  vars:
    enable_password: my_enable_password

  roles:
    - ansible-filter-cisco-hash

  tasks:
    - name: Configure enable secret
      ios_config:
        lines:
        - "enable secret 5 {{enable_password|ciscohash5}}"
      when: 'enable secret 5' not in ansible_net_config

A big thanks goes to Jon Langemak for the Creating your own Ansible filter plugins page.

Markus Jünemann, May 2017

ansible-filter-cisco-hash's People

Contributors

ciphernaut avatar mjuenema avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.