Модуль dellemc.enterprise_sonic.sonic_pki — управление атрибутами PKI Enterprise Sonic
Примечание
Этот модуль входит в коллекцию dellemc.enterprise_sonic (версия 3.2.0).
Возможно, эта коллекция уже установлена, если вы используете пакет 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 логическое значение |
Требовать соблюдения правил использования ключа Варианты:
|
|
ocsp_responder_list список / элементы=строка |
Глобальный список ответчиков OCSP |
|
peer_name_check логическое значение |
Требовать проверки имени узла-партнёра Варианты:
|
|
profile_name строка / обязательный |
Имя профиля |
|
revocation_check логическое значение |
Требовать успешной проверки отзыва сертификата Варианты:
|
|
trust_store строка |
Имя связанного хранилища доверия |
|
trust_stores список / элементы=словарь |
Хранилище сертификатов CA |
|
ca_name список / элементы=строка |
Список сертификатов CA в хранилище доверия. |
|
name строка / обязательный |
Имя хранилища доверия |
state строка | Состояние конфигурации после выполнения модуля. Варианты:
|
Примечания
Примечание
- Проверено на Dell Enterprise SONiC 4.1.0
Примеры
# Using "merged" state for initial config
#
# Before state:
# -------------
#
# sonic# show running-configuration | grep crypto
# sonic#
#
- name: "Initial Config"
dellemc.enterprise_sonic.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
tasks:
- name: Remove trust_store from security-profile
dellemc.enterprise_sonic.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: "Overridden Config"
dellemc.enterprise_sonic.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: "Replace Config"
dellemc.enterprise_sonic.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 словарь | Итоговая конфигурация после вызова модуля. Возвращается: при изменении Пример: |
before словарь | Конфигурация до вызова модуля. Возвращается: всегда Пример: |
commands список / элементы=строка | Набор команд, отправленных на удалённое устройство. Возвращается: всегда Пример: |
Ссылки на коллекцию
© 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/dellemc/enterprise_sonic/sonic_pki_module.html