Coder Social home page Coder Social logo

cldemo-dynamic-ansible-inventory's Introduction

DEPRECATED

This repo is no longer maintained.
For a list of current demos, please visit:
https://gitlab.com/cumulus-consulting/goldenturtle/


cldemo-dynamic-ansible-inventory

This demo shows how an external datasource can be used to populate all variable and host information at runtime.

There are two examples within this demo, one utilizes a redis datastore as the external source, the other utilizes SQLite as an external SQL database.

This demo is built using the Cumulus Networks reference topology

Cumulus Reference Topology

Quickstart

Details

Once this repo has been cloned to the out of band management server you can build one or both of the databases.

Once either database is installed and populated with data (which is done as part of the install playbook),

##Demo Redis First, install the redis database with ansible-playbook redis_setup.yml. This step will also populate the redis database with the network variables. Next, you can test without a provided inventory and see that Ansible fails. This command is ansible all -m ping To test by pulling the host information out of Redis use ansible all -m ping -i get_redis_inventory.py. Once the ping is successful, you can configure the network with ansible-playbook provision_network.yml -i get_redis_inventory.py

Note: If the Redis demo was previously run, please reset the lab with ansible-playbook reset.yml -i get_redis_inventory.py

You can verify that the network was provisioned correctly with ansible spine01 -a 'vtysh -c "show ip bgp sum"' -i get_redis_inventory.py --become. 2 BGP peers should appear.

##Demo SQL First, install the SQLite database with ansible-playbook sql_setup.yml. This step will also populate the SQL database with the network variables. When the database is created, SQLite will create a file in the current directory called "ansible_db.sqlite".

Note: This demo will fail if ansible_db.sqlite is not in the same directory that the ansible commands are being executed from.

Next, we can test a ping without a provided inventory file with ansible all -m ping.

Now, providing an inventory, we can test the ping again using ansible all -m ping -i get_sql_inventory.py, which will work.

Finally, the network can be configured with ansible-playbook provision_network.yml -i get_sql_inventory.py.

Note: If the Redis demo was previously run, please reset the lab with ansible-playbook reset.yml -i get_sql_inventory.py

You can verify that the network was provisioned correctly with ansible spine01 -a 'vtysh -c "show ip bgp sum"' -i get_sql_inventory.py --become. 2 BGP peers should appear.

cldemo-dynamic-ansible-inventory's People

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.