Giter VIP home page Giter VIP logo

vyos-ansible's Introduction

vyos-ansible

An Ansible role to idempotently configure a VyOS Appliance

Caution

You can lock yourself out of your VyOS install with this role. It will provision exactly what you define. I recommend testing and utilizing the dry-run tag before using this on any production systems.

Tip

To see a good example of how I use this, please reference my custom lab: specifically here

Motivations

The reason I created this is that the Ansible provider for VyOS hasn't been updated since VyOS 1 and lacks quite a few important modules. Also, it lacks any way to remove config entries, it just knows how to add them, and (sometimes) update them.

This role simply takes a jinja2 template and produces the relevant config section with it.

This role deletes the relevant config section before applying the configuration. This means that everytime you run the role, it will overwrite your config, but it also means that when it does this the output will be a 1 to 1 mapping of what you define in your Ansible variables. This is helpful because you know that the config you define via the variables is the config that will always be applied.

Tricks

Dry Runs

If you ever want to see how a config will look without actually applying it, simply run the role with the tags never,dry-run.

If you want the output even cleaner, just pipe using the following one liner:

| grep '"' | grep -v '"msg":' | awk -F'"' '{print $$2}'

This will result with a print out of the exact set commands used to configure.

See Also

If you need a VyOS image, see my other repository here which is a VyOS 1.4 Sagitta build with Tailscale and Netbird clients included along with a qcow2 image with cloud-init support for Proxmox.

Contributing

I have defined in this role what I need for my use case. If you find that you need more, feel free to add to it (just a jinja2 template of VyOS commands that create the relevant config section). Feel free to create a PR, I'd love to expand this!

Contributors

vyos-ansible's People

Contributors

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