Giter VIP home page Giter VIP logo

ansible-role-nw-test-existence-by-regex's Introduction

ssato.nw_test_existence_by_regex

[Test Status] [Ansible Galaxy]

An ansible role to test existence of target objects in network nodes.

This role has the following three modes depends on the value of the variable, rntebr_mode (default: normal).

'normal' is a mode to run command on target network nodes to test existence of target objects by regex patterns or test these are not found if the value of variable rntebr_targets_should_be_found is false.

'dump' is a mode to run command on target network nodes and dump its result as a JSON file in the pre-defined format.

'dryrun' is a mode to run this role w/o running command on target network nodes actually. This should be useful to test given patterns match as expected.

Requirements

  • Python modules required by each ansible network modules you use

Role Variables

Variables should be customized for your use cases.

  • rntebr_mode: 'dump' or 'dryrun' or other string including 'normal'
    • Set to 'dump' if you want dump the output of results of command run
    • Set to 'dryrun' if you just want to test regex pattern matches w/ reference data was given. (You need to prepare the reference data by yourself.)
    • Set to other string including 'normal' if you want to run command and test existence of target objects by finding regex matches given
  • rntebr_targets_patterns: Regex patterns to search for target objects from outputs as a result of command run
  • rntebr_res: Set to some results on 'dryrun' mode
  • rntebr_dump_path: output file path on 'dump' mode
  • rntebr_command: command to run on target network nodes on !'dryrun' mode

Other variables should not needed to be customized for most cases.

see also defaults/main.yml for default definitions of each variables and tests/files/*_evars_*.yml for .

Example Playbook

see tests/playbook.yml

License

MIT

Author

Satoru SATOH ssato@Github

ansible-role-nw-test-existence-by-regex's People

Contributors

ssato avatar

Watchers

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