Spec-Zone.ru › Ansible

Модуль arista.eos.eos_acl_interfaces — модуль ресурсов интерфейсов ACL

Примечание

Этот модуль входит в коллекцию arista.eos (версия 12.1.2).

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

Чтобы установить её, используйте: ansible-galaxy collection install arista.eos.

Чтобы использовать её в плейбуке, укажите: arista.eos.eos_acl_interfaces.

Добавлено в arista.eos 1.0.0

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

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

  • Этот модуль управляет добавлением списков управления доступом (ACL) к интерфейсам устройств под управлением ПО EOS и их удалением.

Примечание

Для этого модуля существует соответствующий плагин действий.

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

Параметры

Параметр

Комментарии

config

list / elements=dictionary

Словарь параметров ACL для интерфейсов.

access_groups

list / elements=dictionary

Указывает ACL, применяемые к интерфейсам.

acls

list / elements=dictionary

Указывает ACL для заданного AFI.

direction

string / обязательный

Указывает направление передачи пакетов, к которым будет применяться ACL.

Варианты:

  • "in"
  • "out"

name

string / обязательный

Указывает имя ACL IPv4/IPv4 для интерфейса.

afi

string / обязательный

Указывает AFI для ACL, которые нужно настроить на этом интерфейсе.

Варианты:

  • "ipv4"
  • "ipv6"

name

string / обязательный

Имя/идентификатор интерфейса.

running_config

string

По умолчанию модуль подключается к удалённому устройству и получает текущую running-config, используемую в качестве основы для сравнения с содержимым source. Иногда нежелательно, чтобы задача получала текущую running-config при выполнении каждой задачи в плейбуке. Аргумент running_config позволяет передать конфигурацию, которая будет использоваться в качестве базовой при сравнении. Значением этого параметра должен быть вывод, полученный с устройства при выполнении команды

state

string

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

Варианты:

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

Примеры

# Using Merged

# Before state:
# -------------
#
# eos#sh running-config | include interface|access-group
# interface Ethernet1
# interface Ethernet2
# interface Ethernet3

- name: Merge module attributes of given access-groups
  arista.eos.eos_acl_interfaces:
    config:
      - name: Ethernet2
        access_groups:
          - afi: ipv4
            acls:
              name: acl01
              direction: in
          - afi: ipv6
            acls:
              name: acl03
              direction: out
    state: merged

# Commands Fired:
# ---------------
#
# interface Ethernet2
# ip access-group acl01 in
# ipv6 access-group acl03 out

# After state:
# -------------
#
# eos#sh running-config | include interface| access-group
# interface Loopback888
# interface Ethernet1
# interface Ethernet2
#  ip access-group acl01 in
#  ipv6 access-group acl03 out
# interface Ethernet3


# Using Replaced

# Before state:
# -------------
#
# eos#sh running-config | include interface|access-group
# interface Ethernet1
# interface Ethernet2
#  ip access-group acl01 in
#  ipv6 access-group acl03 out
# interface Ethernet3
#  ip access-group acl01 in

- name: Replace module attributes of given access-groups
  arista.eos.eos_acl_interfaces:
    config:
      - name: Ethernet2
        access_groups:
          - afi: ipv4
            acls:
              name: acl01
              direction: out
    state: replaced

# Commands Fired:
# ---------------
#
# interface Ethernet2
# no ip access-group acl01 in
# no ipv6 access-group acl03 out
# ip access-group acl01 out

# After state:
# -------------
#
# eos#sh running-config | include interface| access-group
# interface Loopback888
# interface Ethernet1
# interface Ethernet2
#  ip access-group acl01 out
# interface Ethernet3
#  ip access-group acl01 in


# Using Overridden

# Before state:
# -------------
#
# eos#sh running-config | include interface|access-group
# interface Ethernet1
# interface Ethernet2
#  ip access-group acl01 in
#  ipv6 access-group acl03 out
# interface Ethernet3
#  ip access-group acl01 in

- name: Override module attributes of given access-groups
  arista.eos.eos_acl_interfaces:
    config:
      - name: Ethernet2
        access_groups:
          - afi: ipv4
            acls:
              name: acl01
              direction: out
    state: overridden

# Commands Fired:
# ---------------
#
# interface Ethernet2
# no ip access-group acl01 in
# no ipv6 access-group acl03 out
# ip access-group acl01 out
# interface Ethernet3
# no ip access-group acl01 in

# After state:
# -------------
#
# eos#sh running-config | include interface| access-group
# interface Loopback888
# interface Ethernet1
# interface Ethernet2
#  ip access-group acl01 out
# interface Ethernet3


# Using Deleted

# Before state:
# -------------
#
# eos#sh running-config | include interface|access-group
# interface Ethernet1
# interface Ethernet2
#  ip access-group acl01 in
#  ipv6 access-group acl03 out
# interface Ethernet3
#  ip access-group acl01 out

- name: Delete module attributes of given access-groups
  arista.eos.eos_acl_interfaces:
    config:
      - name: Ethernet2
        access_groups:
          - afi: ipv4
            acls:
              name: acl01
              direction: in
          - afi: ipv6
            acls:
              name: acl03
              direction: out
    state: deleted

# Commands Fired:
# ---------------
#
# interface Ethernet2
# no ip access-group acl01 in
# no ipv6 access-group acl03 out

# After state:
# -------------
#
# eos#sh running-config | include interface| access-group
# interface Loopback888
# interface Ethernet1
# interface Ethernet2
# interface Ethernet3
#  ip access-group acl01 out


# Before state:
# -------------
#
# eos#sh running-config | include interface| access-group
# interface Ethernet1
# interface Ethernet2
#  ip access-group acl01 in
#  ipv6 access-group acl03 out
# interface Ethernet3
#  ip access-group acl01 out

- name: Delete module attributes of given access-groups from ALL Interfaces
  arista.eos.eos_acl_interfaces:
    config:
    state: deleted

# Commands Fired:
# ---------------
#
# interface Ethernet2
# no ip access-group acl01 in
# no ipv6 access-group acl03 out
# interface Ethernet3
# no ip access-group acl01 out

# After state:
# -------------
#
# eos#sh running-config | include interface| access-group
# interface Loopback888
# interface Ethernet1
# interface Ethernet2
# interface Ethernet3

# Before state:
# -------------
#
# eos#sh running-config | include interface| access-group
# interface Ethernet1
# interface Ethernet2
#  ip access-group acl01 in
#  ipv6 access-group acl03 out
# interface Ethernet3
#  ip access-group acl01 out

- name: Delete acls under afi
  arista.eos.eos_acl_interfaces:
    config:
      - name: Ethernet3
        access_groups:
          - afi: ipv4
      - name: Ethernet2
        access_groups:
          - afi: ipv6
    state: deleted

# Commands Fired:
# ---------------
#
# interface Ethernet2
# no ipv6 access-group acl03 out
# interface Ethernet3
# no ip access-group acl01 out

# After state:
# -------------
#
# eos#sh running-config | include interface| access-group
# interface Loopback888
# interface Ethernet1
# interface Ethernet2
#   ip access-group acl01 in
# interface Ethernet3

Возвращаемые значения

Общие возвращаемые значения описаны здесь; ниже перечислены поля, уникальные для этого модуля:

Ключ

Описание

after

list / elements=string

Результирующая конфигурация после выполнения модели.

Возвращается: при наличии изменений

Пример: ["The configuration returned will always be in the same format\n of the parameters above.\n"]

before

list / elements=string

Конфигурация до выполнения модели.

Возвращается: всегда

Пример: ["The configuration returned will always be in the same format\n of the parameters above.\n"]

commands

list / elements=string

Список команд, отправленных на удалённое устройство.

Возвращается: всегда

Пример: ["interface Ethernet2", "ip access-group acl01 in", "ipv6 access-group acl03 out", "interface Ethernet3", "ip access-group acl01 out"]

Авторы

  • GomathiSelvi S (@GomathiselviS)

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

  • Отслеживание проблем
  • Репозиторий (исходный код)

© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/arista/eos/eos_acl_interfaces_module.html

Spec-Zone.ru

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