This repository illustrates how to configure services on different vendors using the Inmanta language.
- The
OS
of choice for demonstrating these examples isUbuntu
but any Linux version should be fine. - Install the Inmanta software using this guide.
- Make sure to setup a project using this guide before running the examples.
- You need to have an
access token
in order to pull down the modules that are provided in the examples. If you already have a license to these modules, you should have received this token. Otherwise, contact sales.
-
All these examples should be placed into
main.cf
file at the root of your project directory. -
Not all the modules that are shown in the examples are free. Those modules require an
access token
to get downloaded. Thisaccess token
, alongside theGIT
repository URL will have to be added to theproject.yml
file under each project to successfully get the modules. For instance:name: Cisco Examples description: Provides examples for the Cisco module author: Inmanta author_email: [email protected] license: ASL 2.0 copyright: 2022 Inmanta modulepath: libs downloadpath: libs repo: - https://github.com/inmanta/ - https://USERNAME:[email protected]/ciscoxr/{}.git install_mode: release requires:
Notice how we added the
username
,access token
andCisco IOS-XR
module under the repo section.
Having Inmanta
installed, a project set up, and adding the required module repositories to the project.yml
file, you can use any of the available examples under each vendor's specific directory.
For instance, let's see how we can shutdown an interface and set an IP address for a Cisco IOS-XR
device.
-
Head to the directory in which you have created your project, open the
main.cf
file and add the following lines which are taken from Cisco XR interface example:import ciscoxr router=ciscoxr::Device( name="router101", mgmt_ip="10.10.10.1", port=830, username=USERNAME, password=PASSWORD, ) ge2=ciscoxr::Interface( device=router, interface_name="GigabitEthernet0/0/0/2", shutdown=true, ) c::Primary( interface=ge2, address="172.16.10.50", netmask="255.255.255.0" )
Note: Modules will get downloaded when you save the file. If not, please make sure your
project.yml
file is correctly configured. -
Deploy the configuration:
Configuration deployment is possible via
deploy
andexport
switches. The main difference is,export
option will send your configuration model to theService Orchestrator
from where, you can view the deployment steps in the GUI. If you have followed the installation guide the dashboard should be at your disposal. Additionally, we also provide a Docker container forService Orchestrator
which is publicly available but it needs a license to function which you can contact us to that end.Let's deploy this example using the
deploy
switch:inmanta -vvv deploy -f main.cf
inmanta
will be the name of the executable after successful installation.-vvv
determines the verbosity level.deploy
is the intended action. You can usecompile
to sanity check your configuration without applying any configuration on the device.-f main.cf
specifies the location of the main configuration file.
In case of deployment using the
export
switch, the model does not need to be namedmain.cf
:inmanta -vvv export -e d3b2e897-0121-4124-863e-47b6c78ebc35 -f ip_address.cf
export
pushes the model to theService Orchestrator
.-e
provides theenvironment
ID. This can be derived from theService Orchestrator
Web Console.
When the deployment is successfully done, you can SSH
to the device and verify its configuration.
- Hostname
- Interface
- Set primary address
- Set secondary address
- MTU
- Bandwidth
- Admin state
- Description
- Sub-interface
- Interface VRF
- Timezone/clock
- NTP
- VRF
- Static route
- Static route
- L2VPN-EVPN
- BGP
- Neighbor
- Address families
- VRF
- L2VPN
- Policy-map
- VRF
-
Interface
- Set primary address
- Set primary address
- MTU
- Bandwidth
-
VLAN
-
VXLAN
-
Link aggregation
- LACP
-
Ethernet switching
-
IRB
-
Interface RPF policies
-
Policer
-
Policy options/statements
- Bridge domains
- Firewall
- L2 Circuit
- Protocols EVPN
- Routing instances
- EVPN
- VPWS
- TACACS configuration
- configure an authorization server with a key
- configure accounting
- set servers timeout
- SNMP configuration
- configure snmp group, comminity, view
- BGP configuration
- Set a bgp group with families
- Set a neighbor with a group
- Change description for a neighbor
- Set backup path
- Set rapid update
- Client configuration
- Set a name and an id of a client
- Ethernet segment
- set single-active ethernet-segment
- set all-active ethernet-segment
- Service EPIPE
- set epipe
- set epipe and eth-cfm
- set epipe and bgp
- eth-cfm
- set eth-cfm
- Policy option
- Set policy options with community
- Set policy option with allow/deny statement
- Service VPRN
- set service VPRN
- set service VPRN with VRRP
- set service VPRN with static router
- All the aforementioned features in Nokia and more
- Hostname
- Interface
- Set primary address
- Set secondary address
- MTU
- Bandwidth
- Admin state
- Description
- Sub-interface
- Interface VRF
- Timezone/clock
- NTP
- VRF
- Static route
- Static route
- Bridge domains
- Policy options/statements
- Firewall