cnos_bgp – Manage BGP resources and attributes on devices running CNOS¶
Synopsis¶
This module allows you to work with Border Gateway Protocol (BGP) related configurations. The operators used are overloaded to ensure control over switch BGP configurations. This module is invoked using method with asNumber as one of its arguments. The first level of the BGP configuration allows to set up an AS number, with the following attributes going into various configuration operations under the context of BGP. After passing this level, there are eight BGP arguments that will perform further configurations. They are bgpArg1, bgpArg2, bgpArg3, bgpArg4, bgpArg5, bgpArg6, bgpArg7, and bgpArg8. For more details on how to use these arguments, see [Overloaded Variables]. This module uses SSH to manage network device configuration. The results of the operation will be placed in a directory named ‘results’ that must be created by the user in their local directory to where the playbook is run.
Parameters¶
Notes¶
Note
For more information on using Ansible to manage Lenovo Network devices see https://www.ansible.com/ansible-lenovo.
Examples¶
Tasks: The following are examples of using the module cnos_bgp. These are
written in the main.yml file of the tasks directory.
---
- name: Test BGP - neighbor
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "neighbor"
bgpArg2: "10.241.107.40"
bgpArg3: 13
bgpArg4: "address-family"
bgpArg5: "ipv4"
bgpArg6: "next-hop-self"
- name: Test BGP - BFD
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "neighbor"
bgpArg2: "10.241.107.40"
bgpArg3: 13
bgpArg4: "bfd"
- name: Test BGP - address-family - dampening
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "address-family"
bgpArg2: "ipv4"
bgpArg3: "dampening"
bgpArg4: 13
bgpArg5: 233
bgpArg6: 333
bgpArg7: 15
bgpArg8: 33
- name: Test BGP - address-family - network
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "address-family"
bgpArg2: "ipv4"
bgpArg3: "network"
bgpArg4: "1.2.3.4/5"
bgpArg5: "backdoor"
- name: Test BGP - bestpath - always-compare-med
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "bestpath"
bgpArg2: "always-compare-med"
- name: Test BGP - bestpath-compare-confed-aspat
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "bestpath"
bgpArg2: "compare-confed-aspath"
- name: Test BGP - bgp
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "bgp"
bgpArg2: 33
- name: Test BGP - cluster-id
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "cluster-id"
bgpArg2: "1.2.3.4"
- name: Test BGP - confederation-identifier
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "confederation"
bgpArg2: "identifier"
bgpArg3: 333
- name: Test BGP - enforce-first-as
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "enforce-first-as"
- name: Test BGP - fast-external-failover
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "fast-external-failover"
- name: Test BGP - graceful-restart
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "graceful-restart"
bgpArg2: 333
- name: Test BGP - graceful-restart-helper
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "graceful-restart-helper"
- name: Test BGP - maxas-limit
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "maxas-limit"
bgpArg2: 333
- name: Test BGP - neighbor
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "neighbor"
bgpArg2: "10.241.107.40"
bgpArg3: 13
bgpArg4: "address-family"
bgpArg5: "ipv4"
bgpArg6: "next-hop-self"
- name: Test BGP - router-id
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "router-id"
bgpArg2: "1.2.3.4"
- name: Test BGP - synchronization
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "synchronization"
- name: Test BGP - timers
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "timers"
bgpArg2: 333
bgpArg3: 3333
- name: Test BGP - vrf
cnos_bgp:
deviceType: "{{ hostvars[inventory_hostname]['deviceType'] }}"
outputfile: "./results/test_bgp_{{ inventory_hostname }}_output.txt"
asNum: 33
bgpArg1: "vrf"
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
msg
string
|
always |
Success or failure message. Upon any failure, the method returns an error display string.
|
Status¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]
Authors¶
Anil Kumar Muraleedharan (@amuraleedhar)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.