Spec-Zone.ru › Ansible

Модуль cisco.nxos.nxos_prefix_lists – Модуль ресурса списков префиксов.

Примечание

Этот модуль является частью коллекции cisco.nxos (версия 8.1.0).

Эта коллекция может быть уже установлена, если вы используете пакет ansible. Она не включена в ansible-core. Чтобы проверить, установлена ли она, выполните ansible-galaxy collection list.

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

Для использования в playbook, укажите: cisco.nxos.nxos_prefix_lists.

Новое в cisco.nxos 2.4.0

  • Краткое описание
  • Параметры
  • Примечания
  • Примеры

Краткое описание

  • Этот модуль управляет конфигурацией списков префиксов на устройствах под управлением Cisco NX-OS.

Псевдонимы: prefix_lists

Параметры

Параметр

Комментарии

config

list / elements=dictionary

Список конфигурации списка префиксов.

afi

string

Идентификатор семейства адресов (AFI) для списков префиксов.

Варианты:

  • "ipv4"
  • "ipv6"

prefix_lists

list / elements=dictionary

Список конфигураций списка префиксов.

description

string

Описание списка префиксов

entries

list / elements=dictionary

Список конфигураций для указанного списка префиксов

action

string

Разрешить или запретить список префиксов.

Варианты:

  • "permit"
  • "deny"

eq

integer

Точная длина префикса для сопоставления.

ge

integer

Минимальная длина префикса для сопоставления.

le

integer

Максимальная длина префикса для сопоставления.

mask

string

Явная маска сопоставления.

prefix

string

IP или IPv6 префикс в формате A.B.C.D/LEN или A:B::C:D/LEN.

sequence

integer

Порядковый номер.

name

string

Имя списка префиксов.

running_config

string

Этот параметр используется только с состоянием parsed.

Значение этого параметра должно быть выводом, полученным от устройства NX-OS путем выполнения команды show running-config | section ‘^ip(.* prefix-list’).

Состояние parsed считывает конфигурацию из параметра running_config и преобразует её в структурированные данные Ansible в соответствии с argspec модуля ресурса, а затем возвращает значение в ключе parsed в результате.

state

string

Состояние, в котором должна остаться конфигурация.

См. примеры для получения дополнительной информации.

С состоянием replaced, для указанных списков префиксов, последовательности, которые находятся в running-config, но не в задаче, отменяются.

С состоянием overridden, все списки префиксов, которые находятся в running-config, но не в задаче, отменяются.

См. примеры для получения дополнительной информации.

Варианты:

  • "merged" ← (по умолчанию)
  • "replaced"
  • "overridden"
  • "deleted"
  • "parsed"
  • "gathered"
  • "rendered"

Примечания

Примечание

  • Тестировалось на NX-OS 9.3.6.
  • Не поддерживается для Cisco MDS
  • Этот модуль работает с подключением network_cli и httpapi.

Примеры

# Using merged

# Before state:
# -------------
# nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
# nxos-9k-rdo#

- name: Merge the provided configuration with the existing running configuration
  cisco.nxos.nxos_prefix_lists:
    config:
      - afi: ipv4
        prefix_lists:
          - name: AllowPrefix
            description: allows engineering IPv4 networks
            entries:
              - sequence: 10
                action: permit
                prefix: 192.0.2.0/23
                eq: 24
              - sequence: 20
                action: permit
                prefix: 198.51.100.128/26
          - name: DenyPrefix
            description: denies lab IPv4 networks
            entries:
              - sequence: 20
                action: deny
                prefix: 203.0.113.0/24
                le: 25

      - afi: ipv6
        prefix_lists:
          - name: AllowIPv6Prefix
            description: allows engineering IPv6 networks
            entries:
              - sequence: 8
                action: permit
                prefix: "2001:db8:400::/38"
              - sequence: 20
                action: permit
                prefix: "2001:db8:8000::/35"
                le: 37

# Task output
# -------------
# before: []
#
# commands:
#   - "ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks"
#   - "ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38"
#   - "ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37"
#   - "ip prefix-list AllowPrefix description allows engineering IPv4 networks"
#   - "ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24"
#   - "ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26"
#   - "ip prefix-list DenyPrefix description denies lab IPv4 networks"
#   - "ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25"
#
# after:
#   - afi: ipv4
#     prefix_lists:
#       - description: allows engineering IPv4 networks
#         entries:
#           - sequence: 10
#             action: permit
#             prefix: 192.0.2.0/23
#             eq: 24
#           - sequence: 20
#             action: permit
#             prefix: 198.51.100.128/26
#         name: AllowPrefix
#       - description: denies lab IPv4 networks
#         entries:
#           - sequence: 20
#             action: deny
#             prefix: 203.0.113.0/24
#             le: 25
#         name: DenyPrefix
#
#   - afi: ipv6
#     prefix_lists:
#       - description: allows engineering IPv6 networks
#         entries:
#           - sequence: 8
#             action: permit
#             prefix: "2001:db8:400::/38"
#           - sequence: 20
#             action: permit
#             prefix: "2001:db8:8000::/35"
#             le: 37
#         name: AllowIPv6Prefix

# After state:
# ------------
# nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
# ip prefix-list AllowPrefix description allows engineering IPv4 networks
# ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24
# ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26
# ip prefix-list DenyPrefix description denies lab IPv4 networks
# ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
# ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
# ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
# ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37

# Using replaced

# Before state:
# ------------
# nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
# ip prefix-list AllowPrefix description allows engineering IPv4 networks
# ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24
# ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26
# ip prefix-list DenyPrefix description denies lab IPv4 networks
# ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
# ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
# ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
# ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37

- name: Replace prefix-lists configurations of listed prefix-lists with provided configurations
  cisco.nxos.nxos_prefix_lists:
    config:
      - afi: ipv4
        prefix_lists:
          - name: AllowPrefix
            description: allows engineering IPv4 networks
            entries:
              - sequence: 10
                action: permit
                prefix: 203.0.113.64/27

              - sequence: 30
                action: permit
                prefix: 203.0.113.96/27
          - name: AllowPrefix2Stub
            description: allow other engineering IPv4 network
    state: replaced

# Task output
# -------------
# before:
#   - afi: ipv4
#     prefix_lists:
#       - description: allows engineering IPv4 networks
#         entries:
#           - sequence: 10
#             action: permit
#             prefix: 192.0.2.0/23
#             eq: 24
#           - sequence: 20
#             action: permit
#             prefix: 198.51.100.128/26
#         name: AllowPrefix
#       - description: denies lab IPv4 networks
#         entries:
#           - sequence: 20
#             action: deny
#             prefix: 203.0.113.0/24
#             le: 25
#         name: DenyPrefix
#
#   - afi: ipv6
#     prefix_lists:
#       - description: allows engineering IPv6 networks
#         entries:
#           - sequence: 8
#             action: permit
#             prefix: "2001:db8:400::/38"
#           - sequence: 20
#             action: permit
#             prefix: "2001:db8:8000::/35"
#             le: 37
#         name: AllowIPv6Prefix
#
# commands:
#   - "no ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24"
#   - "ip prefix-list AllowPrefix seq 10 permit 203.0.113.64/27"
#   - "ip prefix-list AllowPrefix seq 30 permit 203.0.113.96/27"
#   - "no ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26"
#   - "ip prefix-list AllowPrefix2Stub description allow other engineering IPv4 network"
#
# after:
#   - afi: ipv4
#     prefix_lists:
#       - description: allows engineering IPv4 networks
#         entries:
#           - sequence: 10
#             action: permit
#             prefix: 203.0.113.64/27
#           - sequence: 30
#             action: permit
#             prefix: 203.0.113.96/27
#          name: AllowPrefix
#       - description: allow other engineering IPv4 network
#         name: AllowPrefix2Stub
#       - description: denies lab IPv4 networks
#         entries:
#           - sequence: 20
#             action: deny
#             prefix: 203.0.113.0/24
#             le: 25
#         name: DenyPrefix
#
#   - afi: ipv6
#     prefix_lists:
#       - description: allows engineering IPv6 networks
#         entries:
#           - sequence: 8
#             action: permit
#             prefix: "2001:db8:400::/38"
#           - sequence: 20
#             action: permit
#             prefix: "2001:db8:8000::/35"
#             le: 37
#         name: AllowIPv6Prefix
#
# After state:
# ------------
# nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
# ip prefix-list AllowPrefix description allows engineering IPv4 networks
# ip prefix-list AllowPrefix seq 10 permit 203.0.113.64/27
# ip prefix-list AllowPrefix seq 30 permit 203.0.113.96/27
# ip prefix-list AllowPrefix2Stub description allow other engineering IPv4 network
# ip prefix-list DenyPrefix description denies lab IPv4 networks
# ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
# ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
# ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
# ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37

# Using overridden

# Before state:
# ------------
# nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
# ip prefix-list AllowPrefix description allows engineering IPv4 networks
# ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24
# ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26
# ip prefix-list DenyPrefix description denies lab IPv4 networks
# ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
# ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
# ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
# ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37

- name: Override all prefix-lists configuration with provided configuration
  cisco.nxos.nxos_prefix_lists: &id003
    config:
      - afi: ipv4
        prefix_lists:
          - name: AllowPrefix
            description: allows engineering IPv4 networks
            entries:
              - sequence: 10
                action: permit
                prefix: 203.0.113.64/27

              - sequence: 30
                action: permit
                prefix: 203.0.113.96/27
          - name: AllowPrefix2Stub
            description: allow other engineering IPv4 network
    state: overridden

# Task output
# -------------
# before:
#   - afi: ipv4
#     prefix_lists:
#       - description: allows engineering IPv4 networks
#         entries:
#           - sequence: 10
#             action: permit
#             prefix: 192.0.2.0/23
#             eq: 24
#           - sequence: 20
#             action: permit
#             prefix: 198.51.100.128/26
#         name: AllowPrefix
#       - description: denies lab IPv4 networks
#         entries:
#           - sequence: 20
#             action: deny
#             prefix: 203.0.113.0/24
#             le: 25
#         name: DenyPrefix
#
#   - afi: ipv6
#     prefix_lists:
#       - description: allows engineering IPv6 networks
#         entries:
#           - sequence: 8
#             action: permit
#             prefix: "2001:db8:400::/38"
#           - sequence: 20
#             action: permit
#             prefix: "2001:db8:8000::/35"
#             le: 37
#         name: AllowIPv6Prefix
#
# commands:
#   - "no ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24"
#   - "ip prefix-list AllowPrefix seq 10 permit 203.0.113.64/27"
#   - "ip prefix-list AllowPrefix seq 30 permit 203.0.113.96/27"
#   - "no ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26"
#   - "ip prefix-list AllowPrefix2Stub description allow other engineering IPv4 network"
#   - "no ip prefix-list DenyPrefix"
#   - "no ipv6 prefix-list AllowIPv6Prefix"
#
# after:
#   - afi: ipv4
#     prefix_lists:
#       - name: AllowPrefix
#         description: allows engineering IPv4 networks
#         entries:
#           - sequence: 10
#             action: permit
#             prefix: 203.0.113.64/27
#
#           - sequence: 30
#             action: permit
#             prefix: 203.0.113.96/27
#       - name: AllowPrefix2Stub
#         description: allow other engineering IPv4 network
#
# After state:
# ------------
# nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
# ip prefix-list AllowPrefix description allows engineering IPv4 networks
# ip prefix-list AllowPrefix seq 10 permit 203.0.113.64/27
# ip prefix-list AllowPrefix seq 30 permit 203.0.113.96/27
# ip prefix-list AllowPrefix2Stub description allow other engineering IPv4 network

# Using deleted to delete a all prefix lists for an AFI

# Before state:
# ------------
# nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
# ip prefix-list AllowPrefix description allows engineering IPv4 networks
# ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24
# ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26
# ip prefix-list DenyPrefix description denies lab IPv4 networks
# ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
# ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
# ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
# ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37

- name: Delete all prefix-lists for an AFI
  cisco.nxos.nxos_prefix_lists:
    config:
      - afi: ipv4
    state: deleted
  register: result

# Task output
# -------------
# before:
#   - afi: ipv4
#     prefix_lists:
#       - description: allows engineering IPv4 networks
#         entries:
#           - sequence: 10
#             action: permit
#             prefix: 192.0.2.0/23
#             eq: 24
#           - sequence: 20
#             action: permit
#             prefix: 198.51.100.128/26
#         name: AllowPrefix
#       - description: denies lab IPv4 networks
#         entries:
#           - sequence: 20
#             action: deny
#             prefix: 203.0.113.0/24
#             le: 25
#         name: DenyPrefix
#
#   - afi: ipv6
#     prefix_lists:
#       - description: allows engineering IPv6 networks
#         entries:
#           - sequence: 8
#             action: permit
#             prefix: "2001:db8:400::/38"
#           - sequence: 20
#             action: permit
#             prefix: "2001:db8:8000::/35"
#             le: 37
#         name: AllowIPv6Prefix
#
# commands:
#   - "no ip prefix-list AllowPrefix"
#   - "no ip prefix-list DenyPrefix"
#
# after:
#   - afi: ipv6
#     prefix_lists:
#       - description: allows engineering IPv6 networks
#         entries:
#           - sequence: 8
#             action: permit
#             prefix: "2001:db8:400::/38"
#           - sequence: 20
#             action: permit
#             prefix: "2001:db8:8000::/35"
#             le: 37
#         name: AllowIPv6Prefix
#
# After state:
# ------------
# nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
# ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
# ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
# ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37

# Using deleted to delete a single prefix-list

# Before state:
# ------------
# nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
# ip prefix-list AllowPrefix description allows engineering IPv4 networks
# ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24
# ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26
# ip prefix-list DenyPrefix description denies lab IPv4 networks
# ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
# ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
# ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
# ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37

- name: Delete a single prefix-list
  cisco.nxos.nxos_prefix_lists:
    config:
      - afi: ipv4
        prefix_lists:
          - name: AllowPrefix
    state: deleted

# Task output
# -------------
# before:
#   - afi: ipv4
#     prefix_lists:
#       - description: allows engineering IPv4 networks
#         entries:
#           - sequence: 10
#             action: permit
#             prefix: 192.0.2.0/23
#             eq: 24
#           - sequence: 20
#             action: permit
#             prefix: 198.51.100.128/26
#         name: AllowPrefix
#       - description: denies lab IPv4 networks
#         entries:
#           - sequence: 20
#             action: deny
#             prefix: 203.0.113.0/24
#             le: 25
#         name: DenyPrefix
#
#   - afi: ipv6
#     prefix_lists:
#       - description: allows engineering IPv6 networks
#         entries:
#           - sequence: 8
#             action: permit
#             prefix: "2001:db8:400::/38"
#           - sequence: 20
#             action: permit
#             prefix: "2001:db8:8000::/35"
#             le: 37
#         name: AllowIPv6Prefix
#
# commands:
#   - "no ip prefix-list AllowPrefix"
#
# after:
#   - afi: ipv4
#     prefix_lists:
#       - description: denies lab IPv4 networks
#         entries:
#           - sequence: 20
#             action: deny
#             prefix: 203.0.113.0/24
#             le: 25
#         name: DenyPrefix
#
#   - afi: ipv6
#     prefix_lists:
#       - description: allows engineering IPv6 networks
#         entries:
#           - sequence: 8
#             action: permit
#             prefix: "2001:db8:400::/38"
#           - sequence: 20
#             action: permit
#             prefix: "2001:db8:8000::/35"
#             le: 37
#         name: AllowIPv6Prefix
#
# After state:
# ------------
# nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
# ip prefix-list DenyPrefix description denies lab IPv4 networks
# ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
# ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
# ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
# ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37

# Using deleted to delete all prefix-lists from the device

# Before state:
# ------------
# nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
# ip prefix-list AllowPrefix description allows engineering IPv4 networks
# ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24
# ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26
# ip prefix-list DenyPrefix description denies lab IPv4 networks
# ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
# ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
# ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
# ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37

- name: Delete all prefix-lists
  cisco.nxos.nxos_prefix_lists:
    state: deleted

# Task output
# -------------
# before:
#   - afi: ipv4
#     prefix_lists:
#       - description: allows engineering IPv4 networks
#         entries:
#           - sequence: 10
#             action: permit
#             prefix: 192.0.2.0/23
#             eq: 24
#           - sequence: 20
#             action: permit
#             prefix: 198.51.100.128/26
#         name: AllowPrefix
#       - description: denies lab IPv4 networks
#         entries:
#           - sequence: 20
#             action: deny
#             prefix: 203.0.113.0/24
#             le: 25
#         name: DenyPrefix
#
#   - afi: ipv6
#     prefix_lists:
#       - description: allows engineering IPv6 networks
#         entries:
#           - sequence: 8
#             action: permit
#             prefix: "2001:db8:400::/38"
#           - sequence: 20
#             action: permit
#             prefix: "2001:db8:8000::/35"
#             le: 37
#         name: AllowIPv6Prefix
#
# commands:
#   - "no ip prefix-list AllowPrefix"
#   - "no ip prefix-list DenyPrefix"
#   - "no ipv6 prefix-list AllowIPv6Prefix"
#
# after: []
#
# After state:
# ------------
# nxos-9k-rdo# show running-config | section 'ip(.*) prefix-list'
# nxos-9k-rdo#

# Using rendered

- name: Render platform specific configuration lines with state rendered (without connecting to the device)
  cisco.nxos.nxos_prefix_lists: &id001
    config:
      - afi: ipv4
        prefix_lists:
          - name: AllowPrefix
            description: allows engineering IPv4 networks
            entries:
              - sequence: 10
                action: permit
                prefix: 192.0.2.0/23
                eq: 24
              - sequence: 20
                action: permit
                prefix: 198.51.100.128/26
          - name: DenyPrefix
            description: denies lab IPv4 networks
            entries:
              - sequence: 20
                action: deny
                prefix: 203.0.113.0/24
                le: 25

      - afi: ipv6
        prefix_lists:
          - name: AllowIPv6Prefix
            description: allows engineering IPv6 networks
            entries:
              - sequence: 8
                action: permit
                prefix: "2001:db8:400::/38"
              - sequence: 20
                action: permit
                prefix: "2001:db8:8000::/35"
                le: 37
    state: rendered

# Task Output (redacted)
# -----------------------
# rendered:
#   - afi: ipv4
#     prefix_lists:
#       - description: allows engineering IPv4 networks
#         entries:
#           - sequence: 10
#             action: permit
#             prefix: 192.0.2.0/23
#             eq: 24
#           - sequence: 20
#             action: permit
#             prefix: 198.51.100.128/26
#         name: AllowPrefix
#       - description: denies lab IPv4 networks
#         entries:
#           - sequence: 20
#             action: deny
#             prefix: 203.0.113.0/24
#             le: 25
#         name: DenyPrefix
#
#   - afi: ipv6
#     prefix_lists:
#       - description: allows engineering IPv6 networks
#         entries:
#           - sequence: 8
#             action: permit
#             prefix: "2001:db8:400::/38"
#           - sequence: 20
#             action: permit
#             prefix: "2001:db8:8000::/35"
#             le: 37
#         name: AllowIPv6Prefix

# Using parsed

# parsed.cfg
# ------------
# ip prefix-list AllowPrefix description allows engineering IPv4 networks
# ip prefix-list AllowPrefix seq 10 permit 192.0.2.0/23 eq 24
# ip prefix-list AllowPrefix seq 20 permit 198.51.100.128/26
# ip prefix-list DenyPrefix description denies lab IPv4 networks
# ip prefix-list DenyPrefix seq 20 deny 203.0.113.0/24 le 25
# ipv6 prefix-list AllowIPv6Prefix description allows engineering IPv6 networks
# ipv6 prefix-list AllowIPv6Prefix seq 8 permit 2001:db8:400::/38
# ipv6 prefix-list AllowIPv6Prefix seq 20 permit 2001:db8:8000::/35 le 37

- name: Parse externally provided prefix-lists configuration
  register: result
  cisco.nxos.nxos_prefix_lists:
    running_config: "{{ lookup('file', './parsed.cfg') }}"
    state: parsed

# Task output (redacted)
# -----------------------
# parsed:
#   - afi: ipv4
#     prefix_lists:
#       - description: allows engineering IPv4 networks
#         entries:
#           - sequence: 10
#             action: permit
#             prefix: 192.0.2.0/23
#             eq: 24
#           - sequence: 20
#             action: permit
#             prefix: 198.51.100.128/26
#         name: AllowPrefix
#       - description: denies lab IPv4 networks
#         entries:
#           - sequence: 20
#             action: deny
#             prefix: 203.0.113.0/24
#             le: 25
#         name: DenyPrefix
#
#   - afi: ipv6
#     prefix_lists:
#       - description: allows engineering IPv6 networks
#         entries:
#           - sequence: 8
#             action: permit
#             prefix: "2001:db8:400::/38"
#           - sequence: 20
#             action: permit
#             prefix: "2001:db8:8000::/35"
#             le: 37
#         name: AllowIPv6Prefix

Авторы

  • Nilashish Chakraborty (@NilashishC)

Ссылки на коллекцию

  • Система отслеживания ошибок
  • Репозиторий (источники)

© 2012–2018 Michael DeHaan
© 2018–2024 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/cisco/nxos/nxos_prefix_lists_module.html

Spec-Zone.ru

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