Spec-Zone.ru › Ansible

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

Примечание

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

У вас, возможно, уже установлена эта коллекция, если вы используете пакет 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

список / элементы=словарь

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

access_groups

список / элементы=словарь

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

acls

список / элементы=словарь

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

direction

строка / обязательно

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

Варианты:

  • "in"
  • "out"

name

строка / обязательно

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

afi

строка / обязательно

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

Варианты:

  • "ipv4"
  • "ipv6"

name

строка / обязательно

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

running_config

строка

Модуль по умолчанию подключается к удалённому устройству и извлекает текущую running-конфигурацию, чтобы использовать её как базу для сравнения с содержимым источника. Иногда нежелательно, чтобы задача получала текущую running-конфигурацию для каждой задачи в книге задач. Аргумент 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

список / элементы=строка

Вызов результирующей модели конфигурации.

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

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

before

список / элементы=строка

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

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

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

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–2024 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/arista/eos/eos_acl_interfaces_module.html

Spec-Zone.ru

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