cisco.mso.mso_schema_template_anp_epg_contract 模块 – 管理模式模板中的 EPG 合约
注意
此模块是 cisco.mso 集合(版本 2.9.0)的一部分。
如果您正在使用 ansible
包,您可能已经安装了此集合。 它不包含在 ansible-core
中。 要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install cisco.mso
。 您需要进一步的要求才能使用此模块,有关详细信息,请参阅 要求。
要在剧本中使用它,请指定:cisco.mso.mso_schema_template_anp_epg_contract
。
概要
在 Cisco ACI Multi-Site 上管理模式模板中的 EPG 合约。
要求
执行此模块的主机上需要以下要求。
Multi Site Orchestrator v2.1 或更高版本
参数
参数 |
注释 |
---|---|
ANP 的名称。 |
|
与此 EPG 关联的合约。 此选项不能与 contracts 选项结合使用。 |
|
合约的名称。 |
|
定义所引用合约的模式的名称。 如果未指定此参数,则默认为当前模式。 |
|
定义所引用合约的模板的名称。 如果未指定此参数,则默认为当前模式。 |
|
合约的类型。 选择
|
|
与此 EPG 关联的合约列表。 此选项不能与 当与 当与 与 |
|
合约的名称。 |
|
定义所引用合约的模式的名称。 如果未指定此参数,则默认为当前模式。 |
|
定义所引用合约的模板的名称。 如果未指定此参数,则默认为当前模式。 |
|
合约的类型。 选择
|
|
EPG 的名称。 |
|
将所有配置的合约替换为提供的合约。 此选项只能与 与 选择
|
|
ACI Multi Site Orchestrator 主机的 IP 地址或主机名。 如果未在任务中指定该值,则将改用环境变量 |
|
用于身份验证的登录域名。 默认值为 Local。 如果未在任务中指定该值,则将改用环境变量 当使用 HTTPAPI 连接插件时,如果未指定此属性,将使用清单变量 |
|
影响此 MSO 模块的输出。
如果任务中未指定该值,则将使用环境变量 选择
|
|
用于身份验证的密码。 如果任务中未指定该值,则将使用环境变量 |
|
用于 REST 连接的端口号。 默认值取决于参数 `use_ssl`。 如果任务中未指定该值,则将使用环境变量 |
|
Schema 的名称。 |
|
使用 使用 选择
|
|
Template 的名称。 |
|
套接字级别的超时时间,以秒为单位。 默认值为 30 秒。 如果任务中未指定该值,则将使用环境变量 |
|
如果为 如果任务中未指定该值,则将使用环境变量 默认值为 选择
|
|
如果为 如果任务中未指定该值,则将使用环境变量 当使用 HTTPAPI 连接插件时,如果未指定此属性,则将使用 inventory 变量 当使用 HTTPAPI 连接插件(mso 或 nd)时,默认值为 选择
|
|
用于身份验证的用户名。 如果任务中未指定该值,则将使用环境变量 |
|
如果为 仅当在个人控制的站点上使用自签名证书时,才应将其设置为 如果任务中未指定该值,则将使用环境变量 默认值为 选择
|
注释
注意
此模块旨在支持 Multi Site Orchestrator v2.1 或更高版本。某些或全部功能可能无法在早期版本上工作。
另请参阅
另请参阅
- cisco.mso.mso_schema_template_anp_epg
管理 schema 模板中的端点组 (EPG)。
- cisco.mso.mso_schema_template_contract_filter
管理 schema 模板中的合同过滤器。
示例
- name: Add a contract to an EPG
cisco.mso.mso_schema_template_anp_epg_contract:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
template: Template 1
anp: ANP 1
epg: EPG 1
contract:
name: Contract 1
type: consumer
state: present
- name: Add 2 contracts to an EPG
cisco.mso.mso_schema_template_anp_epg_contract:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
template: Template 1
anp: ANP 1
epg: EPG 1
contracts:
- name: Contract 1
type: provider
- name: Contract 1
type: consumer
state: present
- name: Replace all existing contracts on an EPG with 2 new contracts
cisco.mso.mso_schema_template_anp_epg_contract:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
template: Template 1
anp: ANP 1
epg: EPG 1
force_replace: true
contracts:
- name: Contract 2
type: provider
- name: Contract 2
type: consumer
state: present
- name: Query a specific Contract
cisco.mso.mso_schema_template_anp_epg_contract:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
template: Template 1
anp: ANP 1
epg: EPG 1
contract:
name: Contract 1
type: consumer
state: query
register: query_result
- name: Query a list of Contracts
cisco.mso.mso_schema_template_anp_epg_contract:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
template: Template 1
anp: ANP 1
epg: EPG 1
contracts:
- name: Contract 2
type: provider
- name: Contract 2
type: consumer
state: query
register: query_result
- name: Query all Contracts
cisco.mso.mso_schema_template_anp_epg_contract:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
template: Template 1
anp: ANP 1
state: query
register: query_result
- name: Remove a Contract
cisco.mso.mso_schema_template_anp_epg_contract:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
template: Template 1
anp: ANP 1
epg: EPG 1
contract:
name: Contract 1
state: absent
- name: Remove 2 contracts to an EPG
cisco.mso.mso_schema_template_anp_epg_contract:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
template: Template 1
anp: ANP 1
epg: EPG 1
contracts:
- name: Contract 1
type: provider
- name: Contract 1
type: consumer
state: absent
- name: Remove all existing contracts from an EPG
cisco.mso.mso_schema_template_anp_epg_contract:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
template: Template 1
anp: ANP 1
epg: EPG 1
force_replace: true
state: absent