Skip to content

Instantly share code, notes, and snippets.

View rohitthakur2590's full-sized avatar

Rohit Thakur rohitthakur2590

View GitHub Profile
2019-04-29 18:06:44,681 p=11359 u=rothakur | ansible 2.9.0.dev0
config file = /home/rothakur/dev-workspace/ansible.cfg
configured module search path = [u'/home/rothakur/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /home/rothakur/dev-workspace/ansible/lib/ansible
executable location = /home/rothakur/dev-workspace/ansible/bin/ansible
python version = 2.7.15 (default, Oct 15 2018, 15:26:09) [GCC 8.2.1 20180801 (Red Hat 8.2.1-2)]
2019-04-29 18:06:44,681 p=11359 u=rothakur | Using /home/rothakur/dev-workspace/ansible.cfg as config file
2019-04-29 18:06:44,681 p=11359 u=rothakur | setting up inventory plugins
2019-04-29 18:06:44,705 p=11359 u=rothakur | host_list declined parsing /home/rothakur/dev-workspace/inventory as it did not pass it's verify_file() method
2019-04-29 18:06:44,705 p=11359 u=rothakur | script declined parsing /home/rothakur/dev-workspace/inventory as it did not pass it's verify_file() method
@rohitthakur2590
rohitthakur2590 / Gathered
Created November 14, 2019 05:42
rendered output
ok: [192.168.56.101] => {
"before": [
{
"address_families": [
{
"afi": "ipv4",
"routes": [
{
"blackhole_config": {
"type": "blackhole"
++++++++++++++++++++++++++++++++++
Directory structure
/home/rothakur/ansible-collections/collections/ansible_collections
|__ansible
| |__netcommon
|__ansible-base
|__vyos
|__vyos
|__plugins
|__tests
+++++++++++++++++++++++++ Playbook +++++++++++++++++++++++++++++++++++++
- hosts: vyos
gather_facts: false
connection: network_cli
collections:
- vyos.vyos
tasks:
- name: ospf_global
vyos.vyos.vyos_ospf_global: &id001
config:
The full traceback is:
Traceback (most recent call last):
File "/home/rothakur/.ansible/tmp/ansible-local-64828czkbooqz/ansible-tmp-1589874600.4459674-121109569081204/AnsiballZ_iosxr_facts.py", line 102, in <module>
_ansiballz_main()
File "/home/rothakur/.ansible/tmp/ansible-local-64828czkbooqz/ansible-tmp-1589874600.4459674-121109569081204/AnsiballZ_iosxr_facts.py", line 94, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/rothakur/.ansible/tmp/ansible-local-64828czkbooqz/ansible-tmp-1589874600.4459674-121109569081204/AnsiballZ_iosxr_facts.py", line 40, in invoke_module
runpy.run_module(mod_name='ansible_collections.cisco.iosxr.plugins.modules.iosxr_facts', init_globals=None, run_name='__main__', alter_sys=True)
File "/usr/lib64/python3.8/runpy.py", line 206, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
sample Input config :
so for a config like
router ospf 2
router-id 2.2.2.2
summary-in enable
external-out enable
bfd minimum-interval 55
bfd fast-detect strict-mode
bfd multiplier 4
cost 2
Before Device Config:
=====================
vyos@vyos:~$ show configuration commands | grep ospf
set protocols ospf area 2 area-type 'normal'
set protocols ospf area 2 authentication 'plaintext-password'
set protocols ospf area 2 shortcut 'enable'
set protocols ospf area 4 area-type stub default-cost '20'
set protocols ospf area 4 network '192.0.2.0/24'
set protocols ospf area 4 range 192.0.3.0/24 cost '10'
set protocols ospf area 4 range 192.0.4.0/24 cost '12'
Before Device Config:
=====================
vyos@vyos:~$ show configuration commands | grep ospf
set protocols ospf area 2 area-type 'normal'
set protocols ospf area 2 authentication 'plaintext-password'
set protocols ospf area 2 shortcut 'enable'
set protocols ospf area 3 area-type 'nssa'
set protocols ospf area 4 area-type stub default-cost '20'
set protocols ospf area 4 network '192.0.2.0/24'
set protocols ospf area 4 range 192.0.3.0/24 cost '10'
Before Device Config:
=====================
vyos@vyos:~$ show configuration commands | grep ospf
set protocols ospf area 2 area-type 'normal'
set protocols ospf area 2 authentication 'plaintext-password'
set protocols ospf area 2 shortcut 'enable'
set protocols ospf area 4 area-type stub default-cost '20'
set protocols ospf area 4 network '192.0.2.0/24'
set protocols ospf area 4 network '192.0.12.0/24'
set protocols ospf area 4 network '192.0.22.0/24'
- name: Render the provided configuration.
vyos.vyos.vyos_ospfv2:
config:
log_adjacency_changes: 'detail'
max_metric:
router_lsa:
administrative: true
on_shutdown: 10
on_startup: 10
default_information: