Spec-Zone.ru › Ansible

dellemc.enterprise_sonic.sonic_pki модуль — Управление атрибутами PKI Enterprise Sonic

Примечание

Этот модуль является частью коллекции dellemc.enterprise_sonic (версия 2.5.1).

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

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

Чтобы использовать её в книге задач, укажите: dellemc.enterprise_sonic.sonic_pki.

Новая функция в dellemc.enterprise_sonic 2.3.0

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

Описание

  • Управление атрибутами PKI Enterprise Sonic

Примечание

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

Параметры

Параметр

Комментарии

config

словарь

Предоставленная конфигурация

security_profiles

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

Профили безопасности приложения

cdp_list

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

Глобальный список CDP

certificate_name

строка

Имя сертификата хоста

key_usage_check

логическое значение

Требуется проверка правильности использования ключа

Варианты:

  • false
  • true

ocsp_responder_list

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

Глобальный список ответчиков OCSP

peer_name_check

логическое значение

Требуется проверка имени peer

Варианты:

  • false
  • true

profile_name

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

Имя профиля

revocation_check

логическое значение

Требуется успешная проверка отзыва сертификата

Варианты:

  • false
  • true

trust_store

строка

Имя связанного хранилища trust_store

trust_stores

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

Хранилище сертификатов CA

ca_name

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

Список сертификатов CA в хранилище trust store.

name

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

Имя хранилища Trust Store

state

строка

Состояние конфигурации после завершения модуля.

Варианты:

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

Примечания

Примечание

  • Проверено на Dell Enterprise SONiC 4.1.0

Примеры

# Using "merged" state for initial config
#
# Before state:
# -------------
#
# sonic# show running-configuration | grep crypto
# sonic#
#
- name: PKI Config Test
  hosts: datacenter
  gather_facts: false
  connection: httpapi
  collections:
    - dellemc.enterprise_sonic
  tasks:
    - name: "Initial Config"
      sonic_pki:
        config:
          security_profiles:
            - profile_name: rest
              ocsp_responder_list:
                - http://example.com/ocspa
                - http://example.com/ocspb
              certificate_name: host
              trust_store: default-ts
          trust_stores:
            - name: default-ts
              ca_name:
                - CA2
        state: merged

# After state:
# ------------
#
# sonic# show running-configuration | grep crypto
# crypto trust_store default-ts ca-cert CA2
# crypto security-profile rest
# crypto security-profile trust_store rest default-ts
# crypto security-profile certificate rest host
# crypto security-profile ocsp-list rest http://example.com/ocspa,http://example.com/ocspb

# Using "deleted" state to remove configuration
#
# Before state:
# ------------
#
# sonic# show running-configuration | grep crypto
# crypto trust_store default-ts ca-cert CA2
# crypto security-profile rest
# crypto security-profile trust_store rest default-ts
# crypto security-profile certificate rest host
# crypto security-profile ocsp-list rest http://example.com/ocsp
#
- name: PKI Delete Test
  hosts: datacenter
  gather_facts: true
  connection: httpapi
  collections:
    - dellemc.enterprise_sonic
  tasks:
    - name: Remove trust_store from security-profile
      sonic_pki:
        config:
          security_profiles:
            - profile_name: rest
              trust_store: default-ts
        state: deleted
# After state:
# ------------
#
# sonic# show running-configuration | grep crypto
# crypto trust_store default-ts ca-cert CA2
# crypto security-profile rest
# crypto security-profile certificate rest host
# crypto security-profile ocsp-list rest http://example.com/ocsp

# Using "overridden" state

# Before state:
# ------------
#
# sonic# show running-configuration | grep crypto
# crypto trust_store default-ts ca-cert CA2
# crypto security-profile rest
# crypto security-profile trust_store rest default-ts
# crypto security-profile certificate rest host
# crypto security-profile ocsp-list rest http://example.com/ocspa,http://example.com/ocspb
#
- name: PKI Overridden Test
  hosts: datacenter
  gather_facts: false
  connection: httpapi
  collections:
    - dellemc.enterprise_sonic
  tasks:
    - name: "Overridden Config"
      sonic_pki:
        config:
          security_profiles:
            - profile_name: telemetry
              ocsp_responder_list:
                - http://example.com/ocspb
              revocation_check: true
              trust_store: telemetry-ts
              certificate_name: host
          trust_stores:
            - name: telemetry-ts
              ca_name: CA
        state: overridden
# After state:
# -----------
#
# sonic# show running-configuration | grep crypto
# crypto trust_store telemetry-ts ca-cert CA
# crypto security-profile telemetry revocation_check true
# crypto security-profile trust_store telemetry telemetry-ts
# crypto security-profile certificate telemetry host
# crypto security-profile ocsp-list telemetry http://example.com/ocspb

# Using "replaced" state to update config

# Before state:
# ------------
#
# sonic# show running-configuration | grep crypto
# crypto trust_store default-ts ca-cert CA2
# crypto security-profile rest
# crypto security-profile trust_store rest default-ts
# crypto security-profile certificate rest host
# crypto security-profile ocsp-list rest http://example.com/ocspa,http://example.com/ocspb
#
- name: PKI Replace Test
  hosts: datacenter
  gather_facts: false
  connection: httpapi
  collections:
    - dellemc.enterprise_sonic
  tasks:
    - name: "Replace Config"
      sonic_pki:
        config:
          security_profiles:
            - profile_name: rest
              ocsp_responder_list:
                - http://example.com/ocsp
              revocation_check: false
              trust_store: default-ts
              certificate_name: host
        state: replaced
# After state:
# -----------
#
# sonic# show running-configuration | grep crypto
# crypto trust_store default-ts ca-cert CA2
# crypto security-profile rest
# crypto security-profile trust_store rest default-ts
# crypto security-profile certificate rest host
# crypto security-profile ocsp-list rest http://example.com/ocsp

Значения возврата

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

Ключ

Описание

after

словарь

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

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

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

before

словарь

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

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

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

commands

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

Набор команд, отправленных на удаленное устройство.

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

Пример: ["command 1", "command 2", "command 3"]

Авторы

  • Эрик Сейферт (@seiferteric)

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

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

© 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/dellemc/enterprise_sonic/sonic_pki_module.html

Spec-Zone.ru

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