netapp.ontap.na_ontap_security_ipsec_policy 模块 – 用于创建、修改或删除安全 IPsec 策略的 NetApp ONTAP 模块。
注意
此模块是 netapp.ontap 集合(版本 22.13.0)的一部分。
如果您正在使用 ansible 包,您可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install netapp.ontap。您需要其他要求才能使用此模块,请参阅 要求 了解详细信息。
要在 playbook 中使用它,请指定:netapp.ontap.na_ontap_security_ipsec_policy。
netapp.ontap 22.1.0 中的新增功能
概要
- 创建、修改或删除安全 IPsec 策略。 
要求
执行此模块的主机需要以下要求。
- Ansible 2.9 或更高版本 - 建议使用 2.12 或更高版本。 
- Python3 - 建议使用 3.9 或更高版本。 
- 当使用 ZAPI 时,建议使用 netapp-lib 2018.11.13 或更高版本(使用 'pip install netapp-lib' 安装),强烈建议使用 netapp-lib 2020.3.12,因为它为连接问题提供了更好的错误报告。 
- 物理或虚拟集群 Data ONTAP 系统,该模块支持 Data ONTAP 9.1 及更高版本,REST 支持需要 ONTAP 9.6 或更高版本。 
参数
| 参数 | 注释 | 
|---|---|
| IPsec 策略的操作。 创建后无法修改。 选择 
 | |
| IPsec 策略的身份验证方法。 从 9.10.1 或更高版本支持。 创建后无法修改。 选择 
 | |
| SSL 客户端证书文件 (.pem) 的路径。 不支持 python 2.6。 | |
| IPsec 策略的证书。 从 9.10.1 或更高版本支持。 当在创建中  | |
| 指示是否启用策略。 选择 
 | |
| 启用或禁用新功能。 这可以用来启用实验性功能或禁用破坏向后兼容性的新功能。 支持的键和值可能会更改,恕不另行通知。未知的键将被忽略。 | |
| 当使用 REST 时覆盖集群 ONTAP 版本。 如果版本与目标集群不匹配,则行为是未定义的。 当由于权限问题而无法读取集群版本时,它作为一种解决方法提供。请参阅 https://github.com/ansible-collections/netapp.ontap/wiki/Known-issues。 这应该采用 9.10 或 9.10.1 的形式,每个元素都是整数。 | |
| ONTAP 实例的主机名或 IP 地址。 | |
| 使用此端口覆盖默认端口(80 或 443) | |
| 启用和禁用 https。 当使用 REST 时,将被忽略,因为仅支持 https。 当使用 SSL 证书身份验证时将被忽略,因为它需要 SSL。 选择 
 | |
| 
 | |
| SSL 客户端密钥文件的路径。 | |
| IPsec 策略的本地端点。 | |
| IPv4 或 IPv6 地址。 | |
| 输入为网络掩码长度 (16) 或 IPv4 掩码 (255.255.0.0)。 对于 IPv6,默认值为 64,有效范围为 1 到 127。 | |
| IPsec 策略涵盖的应用程序端口,例如 23。 | |
| 本地 IKE 端点的身份,用于身份验证目的。 | |
| 安全 IPsec 策略的名称 | |
| 指定用户的密码。 | |
| 此策略要保护的协议。 例如 ‘any’ 或 ‘0’、‘tcp’、‘udp’ 或协议号。 | |
| IPsec 策略的远程端点。 | |
| IPv4 或 IPv6 地址。 | |
| 输入为网络掩码长度 (16) 或 IPv4 掩码 (255.255.0.0)。 对于 IPv6,默认值为 64,有效范围为 1 到 127。 | |
| IPsec 策略涵盖的应用程序端口,例如 23 或 23-23。 | |
| 远程 IKE 端点的身份,用于身份验证目的。 | |
| 用于 IKE 协商的预共享密钥。 当在创建中  创建后无法修改。 | |
| 创建或删除安全 IPsec 策略。 选择 
 | |
| SVM 的名称。 创建安全 IPsec 策略时是必需的。 | |
| 此模块仅支持 REST。 always – 将始终使用 REST API。如果该模块不支持 REST,则会发出警告。 默认:  | |
| 这可以是集群范围或 SVM 范围的帐户,具体取决于是否需要集群级或 SVM 级 API。 有关更多信息,请阅读文档 https://mysupport.netapp.com/NOW/download/software/nmsdk/9.4/。 支持两种身份验证方法 
 要使用证书,必须在 ONTAP 集群中安装该证书,并且必须启用证书身份验证。 | |
| 如果设置为  这应仅设置为  选择 
 | 
备注
注意
- 支持 check_mode。 
- 仅支持 REST,且需要 ONTAP 9.8 或更高版本。 
- 以 na_ontap 为前缀的模块旨在支持 ONTAP 存储平台。 
- 默认启用 https,建议使用。要在集群上启用 http,您必须运行以下命令“set -privilege advanced;” “system services web modify -http-enabled true;” 
示例
- name: Create security IPsec policy with pre-shared Keys.
  netapp.ontap.na_ontap_security_ipsec_policy:
    name: ipsec_policy_psk
    ipspace: Default
    svm: ansibleSVM
    authentication_method: psk
    secret_key: "{{ secret_key }}"
    action: esp_transport
    local_endpoint:
      address: 10.23.43.23
      netmask: 24
      port: 201
    remote_endpoint:
      address: 10.23.43.30
      netmask: 24
      port: 205
    protocol: tcp
    enabled: true
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"
    https: true
    validate_certs: "{{ validate_certs }}"
- name: Create security IPsec policy with certificates.
  netapp.ontap.na_ontap_security_ipsec_policy:
    name: ipsec_policy_pki
    ipspace: Default
    svm: ansibleSVM
    authentication_method: pki
    certificate: "{{ cert_name }}"
    action: esp_transport
    local_endpoint:
      address: 10.23.43.23
      netmask: 24
      port: 201
    remote_endpoint:
      address: 10.23.43.30
      netmask: 24
      port: 205
    protocol: tcp
    enabled: true
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"
    https: true
    validate_certs: "{{ validate_certs }}"
- name: Create security IPsec policy without psk or certificates.
  netapp.ontap.na_ontap_security_ipsec_policy:
    name: ipsec_policy_none
    ipspace: Default
    svm: ansibleSVM
    action: bypass
    local_endpoint:
      address: 10.23.43.23
      netmask: 24
      port: 201
    remote_endpoint:
      address: 10.23.43.30
      netmask: 24
      port: 205
    protocol: tcp
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"
    https: true
    validate_certs: "{{ validate_certs }}"
- name: Modify security IPsec policy local, remote end_point.
  netapp.ontap.na_ontap_security_ipsec_policy:
    name: ipsec_policy_pki
    ipspace: Default
    svm: ansibleSVM
    authentication_method: pki
    certificate: "{{ cert_name }}"
    action: esp_transport
    local_endpoint:
      address: 10.23.43.50
      netmask: 24
      port: 201
    remote_endpoint:
      address: 10.23.43.60
      netmask: 24
      port: 205
    protocol: tcp
    enabled: true
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"
    https: true
    validate_certs: "{{ validate_certs }}"
- name: Modify security IPsec protocol, enable options.
  netapp.ontap.na_ontap_security_ipsec_policy:
    name: ipsec_policy_pki
    ipspace: Default
    svm: ansibleSVM
    authentication_method: pki
    certificate: "{{ cert_name }}"
    action: esp_transport
    local_endpoint:
      address: 10.23.43.50
      netmask: 24
      port: 201
    remote_endpoint:
      address: 10.23.43.60
      netmask: 24
      port: 205
    protocol: udp
    enabled: false
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"
    https: true
    validate_certs: "{{ validate_certs }}"
- name: Delete security IPsec policy.
  netapp.ontap.na_ontap_security_ipsec_policy:
    name: ipsec_policy_pki
    svm: ansibleSVM
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"
    https: true
    validate_certs: "{{ validate_certs }}"
