Spec-Zone.ru › Ansible 2.11

dellemc.os10.bgp_validate – Проверить состояние соседа BGP, выдать ошибку, если оно не установлено

Примечание

Этот плагин входит в коллекцию dellemc.os10 (версия 1.1.1).

Для установки используйте: ansible-galaxy collection install dellemc.os10

Для использования в playbook укажите: dellemc.os10.bgp_validate

  • Описание
  • Параметры
  • Примеры

Описание

  • Диагностика состояния соседа BGP с помощью команд show ip bgp summary и show ip interface brief.

Параметры

Параметр Варианты/Значения по умолчанию Комментарии
bgp_neighbors
список / элементы=строка / обязательно
планируемые соседи, введенные из group_var для сравнения с фактическими
show_ip_bgp
список / элементы=строка / обязательно
вывод команды show ip bgp summary
show_ip_intf_brief
список / элементы=строка / обязательно
вывод команды show ip interface brief

Примеры

Copy below YAML into a playbook (e.g. play.yml) and run as follows:

#$ ansible-playbook -i inv play.yml
name: Validate BGP configuration
hosts: localhost
connection: local
gather_facts: False
tasks:
  - name: "Get Dell EMC OS10 Show ip bgp summary"
    os10_command:
      commands:
        - command: "show ip bgp summary | display-xml"
        - command: "show ip interface brief | display-xml"
      provider: "{{ hostvars[item].cli }}"
    with_items: "{{ groups['all'] }}"
    register: show_bgp
  - set_fact:
       output_bgp:  "{{ output_bgp|default([])+ [{'host': item.invocation.module_args.provider.host, 'inv_name': item.item,
                                                  'stdout_show_bgp': item.stdout.0, 'stdout_show_ip': item.stdout.1}] }}"
    loop: "{{ show_bgp.results }}"
  - debug: var=output_bgp
  - local_action: copy content={{ output_bgp }} dest=show
  - name: call lib to convert bgp info from xml to dict format
    base_xml_to_dict:
       cli_responses: "{{ item.stdout_show_bgp }}"
    with_items:
      - "{{ output_bgp }}"
    register: show_bgp_list
  - name: call lib to convert ip interface info from xml to dict format
    base_xml_to_dict:
       cli_responses: "{{ item.stdout_show_ip }}"
    with_items:
      - "{{ output_bgp }}"
    register: show_ip_intf_list
  - name: call lib for bgp validation
    bgp_validate:
      show_ip_bgp: "{{ show_bgp_list.results  }}"
      show_ip_intf_brief: "{{ show_ip_intf_list.results  }}"
      bgp_neighbors: "{{ intended_bgp_neighbors }}"

Авторы

  • Senthil Kumar Ganesan (@skg-net)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/dellemc/os10/bgp_validate_module.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API