Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/iosxr/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/iosxr/iosxr_bgp.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
dd
lmZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatustnetworktsupported_bys�
---
module: iosxr_bgp
version_added: "2.8"
author: "Nilashish Chakraborty (@NilashishC)"
short_description: Configure global BGP protocol settings on Cisco IOS-XR
description:
  - This module provides configuration management of global BGP parameters
    on devices running Cisco IOS-XR
notes:
  - Tested against Cisco IOS XR Software Version 6.1.3
  - This module works with connection C(network_cli). See L(the IOS-XR Platform Options,../network/user_guide/platform_iosxr.html).
options:
  config:
    description:
      - Specifies the BGP related configuration.
    suboptions:
      bgp_as:
        description:
          - Specifies the BGP Autonomous System (AS) number to configure on the device.
        type: int
        required: true
      router_id:
        description:
          - Configures the BGP routing process router-id value.
        default: null
      log_neighbor_changes:
        description:
          - Enable/disable logging neighbor up/down and reset reason.
        type: bool
      neighbors:
        description:
          - Specifies BGP neighbor related configurations.
        suboptions:
          neighbor:
            description:
              - Neighbor router address.
            required: True
          remote_as:
            description:
              - Remote AS of the BGP neighbor to configure.
            type: int
            required: True
          update_source:
            description:
              - Source of the routing updates.
          password:
            description:
              - Password to authenticate the BGP peer connection.
          enabled:
            description:
              - Administratively shutdown or enable a neighbor.
            type: bool
          description:
            description:
              - Neighbor specific description.
          advertisement_interval:
            description:
              - Specifies the minimum interval (in seconds) between sending BGP routing updates.
              - The range is from 0 to 600.
            type: int
          tcp_mss:
            description:
              - Specifies the TCP initial maximum segment size to use.
              - The range is from 68 to 10000.
            type: int
          ebgp_multihop:
            description:
              - Specifies the maximum hop count for EBGP neighbors not on directly connected networks.
              - The range is from 0 to 255.
            type: int
          timers:
            description:
              - Specifies BGP neighbor timer related configurations.
            suboptions:
              keepalive:
                description:
                  - Frequency with which the Cisco IOS-XR software sends keepalive messages to its peer.
                  - The range is from 0 to 65535.
                type: int
                required: True
              holdtime:
                description:
                  - Interval after not receiving a keepalive message that the software declares a peer dead.
                  - The range is from 3 to 65535.
                type: int
                required: True
              min_neighbor_holdtime:
                description:
                  - Interval specifying the minimum acceptable hold-time from a BGP neighbor.
                  - The minimum acceptable hold-time must be less than, or equal to, the interval specified in the holdtime argument.
                  - The range is from 3 to 65535.
                type: int
      address_family:
        description:
          - Specifies BGP address family related configurations.
        suboptions:
          afi:
            description:
              - Type of address family to configure.
            choices:
              - ipv4
              - ipv6
            required: True
          safi:
            description:
              - Specifies the type of cast for the address family.
            choices:
              - flowspec
              - unicast
              - multicast
              - labeled-unicast
            default: unicast
          redistribute:
            description:
              - Specifies the redistribute information from another routing protocol.
            suboptions:
              protocol:
                description:
                  - Specifies the protocol for configuring redistribute information.
                choices: ['ospf', 'ospfv3', 'eigrp', 'isis', 'static', 'connected', 'lisp', 'mobile', 'rip', 'subscriber']
                required: True
              id:
                description:
                  - Identifier for the routing protocol for configuring redistribute information.
                  - Valid for protocols 'ospf', 'eigrp', 'isis' and 'ospfv3'.
              metric:
                description:
                  - Specifies the metric for redistributed routes.
              route_map:
                description:
                  - Specifies the route map reference.
          networks:
            description:
              - Specify networks to announce via BGP.
              - For operation replace, this option is mutually exclusive with root level networks option.
            suboptions:
              network:
                description:
                  - Network ID to announce via BGP.
                required: True
              masklen:
                description:
                  - Subnet mask length for the network to announce(e.g, 8, 16, 24, etc.).
              route_map:
                description:
                  - Route map to modify the attributes.
  operation:
    description:
      - Specifies the operation to be performed on the BGP process configured on the device.
      - In case of merge, the input configuration will be merged with the existing BGP configuration on the device.
      - In case of replace, if there is a diff between the existing configuration and the input configuration, the
        existing configuration will be replaced by the input configuration for every option that has the diff.
      - In case of override, all the existing BGP configuration will be removed from the device and replaced with
        the input configuration.
      - In case of delete the existing BGP configuration will be removed from the device.
    default: merge
    choices: ['merge', 'replace', 'override', 'delete']
sk
- name: configure global bgp as 65000
  iosxr_bgp:
    bgp_as: 65000
    router_id: 1.1.1.1
    neighbors:
      - neighbor: 182.168.10.1
        remote_as: 500
        description: PEER_1
      - neighbor: 192.168.20.1
        remote_as: 500
        update_source: GigabitEthernet 0/0/0/0
    address_family:
      - name: ipv4
        cast: unicast
        networks:
          - network: 192.168.2.0/23
          - network: 10.0.0.0/8
        redistribute:
          - protocol: ospf
            id: 400
            metric: 110

- name: remove bgp as 65000 from config
  ios_bgp:
    bgp_as: 65000
    state: absent
s
commands:
  description: The list of configuration mode commands to send to the device
  returned: always
  type: list
  sample:
    - router bgp 65000
    - bgp router-id 1.1.1.1
    - neighbor 182.168.10.1 remote-as 500
    - neighbor 182.168.10.1 description PEER_1
    - neighbor 192.168.20.1 remote-as 500
    - neighbor 192.168.20.1 update-source GigabitEthernet0/0/0/0
    - address-family ipv4 unicast
    - redistribute ospf 400 metric 110
    - network 192.168.2.0/23
    - network 10.0.0.0/8
    - exit
(tto_text(t
NetworkModule(tREDISTRIBUTE_PROTOCOLSc
	C`s�itdt�d6tdddt�d6t�d6}itdtdt�d6t�d	6tdd�d
6t�d6}itdd�d6tdd�d6tdd�d
6}i
tdt�d6tdddt�d6t�d6tdt�d6tdd�d6t�d6tdd�d6tdd�d6tdd�d6tddd|�d6}itdddgdt�d6tddd d!d"gd#d"�d$6tdd%d&dd|�d'6tdd%d&dd|�d(6}itdddt�d)6t�d*6tdd�d+6tdd%d&dd|�d,6tdd%d&dd|�d-6}itddd|�d.6td#d/dd/d0d1d2g�d36}td4|d5t�}y|jd6d7�}Wn)tk
r�}	|jd8t|	��nX|j|�d9S(:s+ main entry point for module execution
    trequiredtprefixttypetinttmasklent	route_maptchoicestprotocoltidtmetrict	keepalivetholdtimetmin_neighbor_holdtimetneighbort	remote_ast
update_sourcetno_logtpasswordtbooltenabledtdescriptiontadvertisement_intervalt
ebgp_multihopttcp_msstdicttoptionsttimerstipv4tipv6tafitflowspecslabeled-unicastt	multicasttunicasttdefaulttsafitlisttelementstnetworkstredistributetbgp_ast	router_idtlog_neighbor_changest	neighborstaddress_familytconfigtmergetreplacetoverridetdeletet	operationt
argument_spectsupports_check_modet
config_filters
router bgptmsgN(	R#tTrueR
R	tedit_configt	Exceptiont	fail_jsonRt	exit_json(
tnetwork_spectredistribute_spect
timer_spect
neighbor_spectaddress_family_spectconfig_specR=tmoduletresulttexc((sK/usr/lib/python2.7/site-packages/ansible/modules/network/iosxr/iosxr_bgp.pytmain�sZ




"
%	t__main__N(t
__future__RRRR
t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils._textRt3ansible.module_utils.network.iosxr.providers.moduleR	tCansible.module_utils.network.iosxr.providers.cli.config.bgp.processR
ROt__name__(((sK/usr/lib/python2.7/site-packages/ansible/modules/network/iosxr/iosxr_bgp.pyt<module>s


�	B

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]