cisco.aci.aci_epg_useg_attribute_simple_statement 模块 – 管理 EPG useg 属性简单语句 (fv:DnsAttr, fv:IdGroupAttr, fv:IpAttr, fv:MacAttr 和 fv:VmAttr)

注意

此模块是 cisco.aci 集合(版本 2.10.1)的一部分。

如果您正在使用 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install cisco.aci

要在 Playbook 中使用它,请指定:cisco.aci.aci_epg_useg_attribute_simple_statement

概要

  • 管理 EPG useg 属性简单语句

参数

参数

注释

annotation

字符串

用于注释对象的用户定义字符串。

如果任务中未指定该值,则将使用环境变量 ACI_ANNOTATION 的值代替。

如果任务中未指定该值,且环境变量 ACI_ANNOTATION 也未指定,则将使用默认值。

默认值: "orchestrator:ansible"

ap

别名:app_profile, app_profile_name

字符串

现有应用程序网络配置文件的名称。

category

别名:custom_attribute

字符串

vmware 标签类别或 vmware 自定义属性的名称。

certificate_name

别名:cert_name

字符串

附加到用于基于签名的身份验证的 APIC AAA 用户的 X.509 证书名称。

如果提供了 private_key 文件名,则此默认值是 private_key 的基本名称,不带扩展名。

如果为 private_key 提供了 PEM 格式的内容,则此默认值为 username 值。

如果任务中未指定该值,则将使用环境变量 ACI_CERTIFICATE_NAME 的值代替。

epg

别名:epg_name

字符串

现有端点组的名称。

host

别名:hostname

字符串

可由 Ansible 控制主机解析的 APIC 的 IP 地址或主机名。

如果任务中未指定该值,则将使用环境变量 ACI_HOST 的值代替。

name

别名:useg_attribute_name

字符串

EPG useg 属性的名称。

operator

字符串

EPG useg 属性的运算符。

选项

  • "equals"

  • "contains"

  • "starts_with"

  • "ends_with"

output_level

字符串

影响此 ACI 模块的输出。

normal 表示标准输出,包括 current 字典

info 添加信息性输出,包括 previousproposedsent 字典

debug 添加调试输出,包括 filter_stringmethodresponsestatusurl 信息

如果任务中未指定该值,则将使用环境变量 ACI_OUTPUT_LEVEL 的值代替。

选项

  • "debug"

  • "info"

  • "normal" ← (默认)

output_path

字符串

将用于转储模块生成的 ACI JSON 配置对象的文件路径。

如果任务中未指定该值,则将使用环境变量 ACI_OUTPUT_PATH 的值代替。

parent_block_statements

别名:blocks, parent_blocks

列表 / 元素=字符串

父块语句的列表。

提供的列表的顺序很重要,假设列表为 [“A”, “B”, “C”]。

块语句 “A” 将是 “B” 的父级

块语句 “A” 将是默认块语句的子级。

父块语句的最大数量为 3。

password

字符串

用于身份验证的密码。

此选项与 private_key 互斥。如果也提供了 private_key,则将使用它代替。

如果任务中未指定该值,则会使用环境变量 ACI_PASSWORDANSIBLE_NET_PASSWORD 的值。

端口

整数

用于 REST 连接的端口号。

默认值取决于参数 use_ssl

如果任务中未指定该值,则会使用环境变量 ACI_PORT 的值。

private_key

别名: cert_key

字符串

PEM 格式的私钥文件或用于基于签名的身份验证的私钥内容。

此值还会影响使用的默认 certificate_name

此选项与 password 互斥。如果也提供了 password,它将被忽略。

如果任务中未指定该值,则会使用环境变量 ACI_PRIVATE_KEYANSIBLE_NET_SSH_KEYFILE 的值。

状态

字符串

使用 presentabsent 来添加或删除。

使用 query 列出一个对象或多个对象。

选项

  • "absent"

  • "present" ← (默认)

  • "query"

suppress_previous

别名: no_previous, ignore_previous

布尔值

如果为 true,则在向 APIC 发送 POST 更新之前,不会发送 GET 请求来检查之前的状态。

如果任务中未指定该值,则会使用环境变量 ACI_SUPPRESS_PREVIOUS 的值。

默认值为 false

警告 - 这会导致之前的返回值为空。

将不会检查对象的先前状态,并且 POST 更新将包含所有属性。

选项

  • false

  • true

suppress_verification

别名: no_verification, no_verify, suppress_verify, ignore_verify, ignore_verification

布尔值

如果为 true,则在向 APIC 发送 POST 更新后,不会发送验证 GET 请求。

如果任务中未指定该值,则会使用环境变量 ACI_SUPPRESS_VERIFICATION 的值。

默认值为 false

警告 - 这会导致当前返回值设置为建议的值。

在单个任务中,包括默认值的当前对象将无法验证。

选项

  • false

  • true

tenant

别名: tenant_name

字符串

现有租户的名称。

超时

整数

套接字级别的超时时间(以秒为单位)。

如果任务中未指定该值,则会使用环境变量 ACI_TIMEOUT 的值。

默认值为 30。

type

别名: useg_attribute_type

字符串 / 必需

EPG useg 属性的类型

选项

  • "ip"

  • "mac"

  • "dns"

  • "ad_group"

  • "vm_custom_attr"

  • "vm_vmm_domain"

  • "vm_operating_system"

  • "vm_hypervisor_id"

  • "vm_datacenter"

  • "vm_id"

  • "vm_name"

  • "vm_folder"

  • "vm_folder_path"

  • "vm_vnic"

  • "vm_tag"

use_proxy

布尔值

如果为 false,即使在目标主机上的环境变量中定义了代理,也不会使用代理。

如果任务中未指定该值,则会使用环境变量 ACI_USE_PROXY 的值。

默认值为 true。

选项

  • false

  • true

use_ssl

布尔值

如果为 false,则将使用 HTTP 连接而不是默认的 HTTPS 连接。

如果任务中未指定该值,则会使用环境变量 ACI_USE_SSL 的值。

当连接是本地连接时,默认值为 true。

选项

  • false

  • true

use_subnet

布尔值

是否对 ip 使用 EPG 子网定义。

选项

  • false

  • true

username

别名: user

字符串

用于身份验证的用户名。

如果任务中未指定该值,则会使用环境变量 ACI_USERNAMEANSIBLE_NET_USERNAME 的值。

默认值为 admin。

validate_certs

布尔值

如果为 false,则不会验证 SSL 证书。

仅当在个人控制的站点上使用自签名证书时,才应将其设置为 false

如果任务中未指定该值,则会使用环境变量 ACI_VALIDATE_CERTS 的值。

默认值为 true。

选项

  • false

  • true

value

字符串

EPG useg 属性的值。

注意

注意

另请参阅

另请参阅

cisco.aci.aci_tenant

管理租户 (fv:Tenant)。

cisco.aci.aci_ap

管理顶级应用程序配置文件 (AP) 对象 (fv:Ap)。

cisco.aci.aci_epg

管理终端节点组 (EPG) 对象 (fv:AEPg)。

APIC 管理信息模型参考

有关内部 APIC 类 fv:DnsAttrfv:IdGroupAttrfv:IpAttrfv:MacAttrfv:VmAttr 的更多信息。

Cisco ACI 指南

有关如何使用 Ansible 管理 ACI 基础架构的详细信息。

开发 Cisco ACI 模块

有关如何编写自己的 Cisco ACI 模块以进行贡献的详细指南。

示例

- name: Add a new vmtag useg attribute in default block statement
  cisco.aci.aci_epg_useg_attribute_simple_statement:
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: anstest
    ap: anstest
    epg: anstest
    name: vmtagprod
    type: vmtag
    category: Environment
    operator: equals
    value: Production
    state: present
  delegate_to: localhost

- name: Add a new vmtag useg attribute in nested block statement
  cisco.aci.aci_epg_useg_attribute_simple_statement:
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: anstest
    ap: anstest
    epg: anstest
    name: vmtagprod
    parent_block_statements:
      - block_a
      - block_b
    type: vmtag
    category: Environment
    operator: equals
    value: Production
    state: present
  delegate_to: localhost

- name: Query a specific vmtag useg attribute in default block statement
  cisco.aci.aci_epg_useg_attribute_simple_statement:
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: anstest
    ap: anstest
    epg: anstest
    name: vmtagprod
    type: vmtag
    state: query
  delegate_to: localhost
  register: query_result

- name: Query all vmtag useg attributes
  cisco.aci.aci_epg_useg_attribute_simple_statement:
    host: apic
    username: admin
    password: SomeSecretPassword
    state: query
    type: vmtag
  delegate_to: localhost
  register: query_result

- name: Remove an existing vmtag useg attribute from default block statement
  cisco.aci.aci_epg_useg_attribute_simple_statement:
    host: apic
    username: admin
    password: SomeSecretPassword
    tenant: anstest
    ap: anstest
    epg: anstest
    name: vmtagprod
    type: vmtag
    state: absent
  delegate_to: localhost

返回值

常见返回值记录在这里,以下是此模块特有的字段

描述

current

列表 / 元素=字符串

模块完成后来自 APIC 的现有配置

返回: 成功

示例: [{"fvTenant": {"attributes": {"descr": "生产环境", "dn": "uni/tn-production", "name": "production", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]

error

字典

从 APIC 返回的错误信息

返回: 失败

示例: {"code": "122", "text": "未知受管对象类 foo"}

filter_string

字符串

用于请求的筛选字符串

返回: 失败或调试

示例: "?rsp-prop-include=config-only"

method

字符串

用于向 APIC 发出请求的 HTTP 方法

返回: 失败或调试

示例: "POST"

previous

列表 / 元素=字符串

模块启动之前来自 APIC 的原始配置

返回: 信息

示例: [{"fvTenant": {"attributes": {"descr": "生产", "dn": "uni/tn-production", "name": "production", "nameAlias": "", "ownerKey": "", "ownerTag": ""}}}]

proposed

字典

来自用户提供的参数的已组装配置

返回: 信息

示例: {"fvTenant": {"attributes": {"descr": "生产环境", "name": "production"}}}

raw

字符串

APIC REST API 返回的原始输出(xml 或 json)

返回: 解析错误

示例: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><imdata totalCount=\"1\"><error code=\"122\" text=\"未知受管对象类 foo\"/></imdata>"

response

字符串

来自 APIC 的 HTTP 响应

返回: 失败或调试

示例: "OK (30 字节)"

sent

列表 / 元素=字符串

推送给 APIC 的实际/最小配置

返回: 信息

示例: {"fvTenant": {"attributes": {"descr": "生产环境"}}}

状态

整数

来自 APIC 的 HTTP 状态码

返回: 失败或调试

示例: 200

url

字符串

用于向 APIC 发出请求的 HTTP url

返回: 失败或调试

示例: "https://10.11.12.13/api/mo/uni/tn-production.json"

作者

  • Christian Kolrep (@Christian-Kolrep)

  • Akini Ross (@akinross)