Spec-Zone.ru › Ansible 2.11

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

Примечание

Этот плагин входит в состав коллекции arista.eos (версия 1.3.0).

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

Для использования в книге задач укажите: arista.eos.eos_acl_interfaces.

Добавлена в версии 1.0.0: модуля arista.eos

  • Обзор
  • Параметры
  • Примеры
  • Возвращаемые значения

Обзор

  • Этот модуль управляет добавлением и удалением списков управления доступом (ACL) из интерфейсов на устройствах, работающих на программном обеспечении EOS.

Примечание

Этот модуль имеет соответствующий плагин действий.

Параметры

Параметр Варианты/Значения по умолчанию Комментарии
config
список / элементы=словарь
Словарь параметров ACL для интерфейсов.
access_groups
список / элементы=словарь
Указывает ACL, присоединенные к интерфейсам.
acls
список / элементы=словарь
Указывает ACL для предоставленного AFI.
direction
строка / обязательно
    Варианты:
  • in
  • out
Указывает направление пакетов, к которым будет применяться ACL.
name
строка / обязательно
Указывает имя IPv4/IPv4 ACL для интерфейса.
afi
строка / обязательно
    Варианты:
  • ipv4
  • ipv6
Указывает AFI для ACL(ов), которые будут настроены на этом интерфейсе.
name
строка / обязательно
Имя/Идентификатор интерфейса.
running_config
строка
Модуль по умолчанию подключается к удаленному устройству и извлекает текущую конфигурацию для сравнения с содержимым источника. Иногда нежелательно, чтобы задача получала текущую конфигурацию для каждой задачи в книге задач. Аргумент running_config позволяет разработчику передать конфигурацию в качестве базовой конфигурации для сравнения. Это значение должно быть результатом выполнения команды на устройстве.
state
строка
    Варианты:
  • 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
список / элементы=строка
при изменении
Результат вызова модели конфигурации.

Пример:
Возвращаемая конфигурация всегда будет в том же формате, что и параметры выше.
before
список / элементы=строка
всегда
Конфигурация до вызова модели.

Пример:
Возвращаемая конфигурация всегда будет в том же формате, что и параметры выше.
commands
список / элементы=строка
всегда
Набор команд, отправленных на удаленное устройство.

Пример:
['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–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/arista/eos/eos_acl_interfaces_module.html

Spec-Zone.ru

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