code
stringlengths 2.5k
150k
| kind
stringclasses 1
value |
---|---|
ansible cisco.aci.aci_cloud_cidr β Manage CIDR under Cloud Context Profile (cloud:Cidr) cisco.aci.aci\_cloud\_cidr β Manage CIDR under Cloud Context Profile (cloud:Cidr)
=================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_cloud_cidr`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Cloud CIDR on Cisco Cloud ACI.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **address** string | | CIDR ip and its netmask.
aliases: cidr |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **cloud\_context\_profile** string / required | | The name of the Cloud Context Profile. |
| **description** string | | Description of the Cloud CIDR. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name\_alias** string | | An alias for the name of the current object. This relates to the nameAlias field in ACI and is used to rename object without changing the DN. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string / required | | The name of the Tenant. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* This module is only used to manage non\_primary Cloud CIDR, see [cisco.aci.aci\_cloud\_ctx\_profile](aci_cloud_ctx_profile_module#ansible-collections-cisco-aci-aci-cloud-ctx-profile-module) to create the primary CIDR.
* More information about the internal APIC class **cloud:Cidr** from [the APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/).
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create non_primary CIDR
cisco.aci.aci_cloud_cidr:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
address: 10.10.0.0/16
cloud_context_profile: ctxProfileName
state: present
delegate_to: localhost
- name: Remove non_primary CIDR
cisco.aci.aci_cloud_cidr:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
address: 10.10.0.0/16
cloud_context_profile: ctxProfileName
state: absent
delegate_to: localhost
- name: Query all CIDRs under given cloud context profile
cisco.aci.aci_cloud_cidr:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
cloud_context_profile: ctxProfileName
state: query
delegate_to: localhost
- name: Query specific CIDR under given cloud context profile
cisco.aci.aci_cloud_cidr:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
cloud_context_profile: ctxProfileName
address: 10.10.0.0/16
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Nirav (@nirav)
* Cindy Zhao (@cizhao)
ansible cisco.aci.aci_firmware_source β Manage firmware image sources (firmware:OSource) cisco.aci.aci\_firmware\_source β Manage firmware image sources (firmware:OSource)
==================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_firmware_source`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage firmware image sources on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **polling\_interval** integer | | Polling interval in minutes. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **source** string | | The identifying name for the outside source of images, such as an HTTP or SCP server.
aliases: name, source\_name |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **url** string | | The firmware URL for the image(s) on the source. |
| **url\_password** string | | The Firmware password or key string. |
| **url\_protocol** string | **Choices:*** http
* local
* **scp** β
* usbkey
| The Firmware download protocol.
aliases: url\_proto |
| **url\_username** string | | The username for the source. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **firmware:OSource**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add firmware source
cisco.aci.aci_firmware_source:
host: apic
username: admin
password: SomeSecretPassword
source: aci-msft-pkg-3.1.1i.zip
url: foo.bar.cisco.com/download/cisco/aci/aci-msft-pkg-3.1.1i.zip
url_protocol: http
state: present
delegate_to: localhost
- name: Remove firmware source
cisco.aci.aci_firmware_source:
host: apic
username: admin
password: SomeSecretPassword
source: aci-msft-pkg-3.1.1i.zip
state: absent
delegate_to: localhost
- name: Query a specific firmware source
cisco.aci.aci_firmware_source:
host: apic
username: admin
password: SomeSecretPassword
source: aci-msft-pkg-3.1.1i.zip
state: query
delegate_to: localhost
register: query_result
- name: Query all firmware sources
cisco.aci.aci_firmware_source:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Dag Wieers (@dagwieers)
| programming_docs |
ansible cisco.aci.aci_switch_leaf_selector β Bind leaf selectors to switch policy leaf profiles (infra:LeafS, infra:NodeBlk, infra:RsAccNodePGrep) cisco.aci.aci\_switch\_leaf\_selector β Bind leaf selectors to switch policy leaf profiles (infra:LeafS, infra:NodeBlk, infra:RsAccNodePGrep)
=============================================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_switch_leaf_selector`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Bind leaf selectors (with node block range and policy group) to switch policy leaf profiles on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | The description to assign to the `leaf`. |
| **from** integer | | Start of Node Block range.
aliases: node\_blk\_range\_from, from\_range, range\_from |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **leaf** string | | Name of Leaf Selector.
aliases: name, leaf\_name, leaf\_profile\_leaf\_name, leaf\_selector\_name |
| **leaf\_node\_blk** string | | Name of Node Block range to be added to Leaf Selector of given Leaf Profile.
aliases: leaf\_node\_blk\_name, node\_blk\_name |
| **leaf\_node\_blk\_description** string | | The description to assign to the `leaf_node_blk`
|
| **leaf\_profile** string | | Name of the Leaf Profile to which we add a Selector.
aliases: leaf\_profile\_name |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **policy\_group** string | | Name of the Policy Group to be added to Leaf Selector of given Leaf Profile.
aliases: name, policy\_group\_name |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **to** integer | | Start of Node Block range.
aliases: node\_blk\_range\_to, to\_range, range\_to |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* This module is to be used with [cisco.aci.aci\_switch\_policy\_leaf\_profile](aci_switch_policy_leaf_profile_module#ansible-collections-cisco-aci-aci-switch-policy-leaf-profile-module). One first creates a leaf profile (infra:NodeP) and then creates an associated selector (infra:LeafS),
See Also
--------
See also
[cisco.aci.aci\_switch\_policy\_leaf\_profile](aci_switch_policy_leaf_profile_module#ansible-collections-cisco-aci-aci-switch-policy-leaf-profile-module)
The official documentation on the **cisco.aci.aci\_switch\_policy\_leaf\_profile** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes **infra:LeafS**, **infra:NodeBlk** and **infra:RsAccNodePGrp**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: adding a switch policy leaf profile selector associated Node Block range (w/ policy group)
cisco.aci.aci_switch_leaf_selector:
host: apic
username: admin
password: SomeSecretPassword
leaf_profile: sw_name
leaf: leaf_selector_name
leaf_node_blk: node_blk_name
from: 1011
to: 1011
policy_group: somepolicygroupname
state: present
delegate_to: localhost
- name: adding a switch policy leaf profile selector associated Node Block range (w/o policy group)
cisco.aci.aci_switch_leaf_selector:
host: apic
username: admin
password: SomeSecretPassword
leaf_profile: sw_name
leaf: leaf_selector_name
leaf_node_blk: node_blk_name
from: 1011
to: 1011
state: present
delegate_to: localhost
- name: Removing a switch policy leaf profile selector
cisco.aci.aci_switch_leaf_selector:
host: apic
username: admin
password: SomeSecretPassword
leaf_profile: sw_name
leaf: leaf_selector_name
state: absent
delegate_to: localhost
- name: Querying a switch policy leaf profile selector
cisco.aci.aci_switch_leaf_selector:
host: apic
username: admin
password: SomeSecretPassword
leaf_profile: sw_name
leaf: leaf_selector_name
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Bruno Calogero (@brunocalogero)
ansible cisco.aci.aci_l2out_logical_node_profile β Manage Layer 2 Outside (L2Out) logical node profiles (l2ext:LNodeP) cisco.aci.aci\_l2out\_logical\_node\_profile β Manage Layer 2 Outside (L2Out) logical node profiles (l2ext:LNodeP)
==================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_l2out_logical_node_profile`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage node profiles of L2 outside (BD extension) on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **l2out** string | | Name of an existing L2Out.
aliases: l2out\_name |
| **node\_profile** string | | Name of the node profile.
aliases: node\_profile\_name, logical\_node |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | Name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
M(aci\_l2out)
The official documentation on the **aci\_l2out** module.
M(aci\_l2out\_logical\_interface\_profile)
The official documentation on the **aci\_l2out\_logical\_interface\_profile** module.
M(aci\_l2out\_logical\_interface\_path)
The official documentation on the **aci\_l2out\_logical\_interface\_path** module.
M(aci\_l2out\_extepg)
The official documentation on the **aci\_l2out\_extepg** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
See module aci_l2out_logical_interface_path.
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Oleksandr Kreshchenko (@alexkross)
| programming_docs |
ansible cisco.aci.aci_access_port_block_to_access_port β Manage port blocks of Fabric interface policy leaf profile interface selectors (infra:HPortS, infra:PortBlk) cisco.aci.aci\_access\_port\_block\_to\_access\_port β Manage port blocks of Fabric interface policy leaf profile interface selectors (infra:HPortS, infra:PortBlk)
===================================================================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_access_port_block_to_access_port`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage port blocks of Fabric interface policy leaf profile interface selectors on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_port\_selector** string | | The name of the Fabric access policy leaf interface profile access port selector.
aliases: name, access\_port\_selector\_name |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **from\_card** string | | The beginning (from-range) of the card range block for the leaf access port block.
aliases: from\_card\_range |
| **from\_port** string | | The beginning (from-range) of the port range block for the leaf access port block.
aliases: from, fromPort, from\_port\_range |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **interface\_profile** string | | The name of the Fabric access policy leaf interface profile.
aliases: leaf\_interface\_profile\_name, leaf\_interface\_profile, interface\_profile\_name |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **port\_blk** string | | The name of the Fabric access policy leaf interface profile access port block.
aliases: leaf\_port\_blk\_name, leaf\_port\_blk |
| **port\_blk\_description** string | | The description to assign to the `leaf_port_blk`.
aliases: leaf\_port\_blk\_description |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **to\_card** string | | The end (to-range) of the card range block for the leaf access port block.
aliases: to\_card\_range |
| **to\_port** string | | The end (to-range) of the port range block for the leaf access port block.
aliases: to, toPort, to\_port\_range |
| **type** string | **Choices:*** fex
* **leaf** β
| The type of access port block to be created under respective access port. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `interface_profile` and `access_port_selector` must exist before using this module in your playbook. The [cisco.aci.aci\_interface\_policy\_leaf\_profile](aci_interface_policy_leaf_profile_module#ansible-collections-cisco-aci-aci-interface-policy-leaf-profile-module) and [cisco.aci.aci\_access\_port\_to\_interface\_policy\_leaf\_profile](aci_access_port_to_interface_policy_leaf_profile_module#ansible-collections-cisco-aci-aci-access-port-to-interface-policy-leaf-profile-module) modules can be used for this.
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes **infra:HPortS** and **infra:PortBlk**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Associate an access port block (single port) to an interface selector
cisco.aci.aci_access_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname
access_port_selector: accessportselectorname
port_blk: leafportblkname
from_port: 13
to_port: 13
state: present
delegate_to: localhost
- name: Associate an access port block (port range) to an interface selector
cisco.aci.aci_access_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname
access_port_selector: accessportselectorname
port_blk: leafportblkname
from_port: 13
to_port: 16
state: present
delegate_to: localhost
- name: Associate an access port block (single port) to an interface selector of type fex
cisco.aci.aci_access_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
type: fex
interface_profile: leafintprfname_fex
access_port_selector: accessportselectorname_fex
port_blk: leafportblkname_fex
from_port: 13
to_port: 13
state: present
delegate_to: localhost
- name: Associate an access port block (port range) to an interface selector of type fex
cisco.aci.aci_access_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
type: fex
interface_profile: leafintprfname_fex
access_port_selector: accessportselectorname_fex
port_blk: leafportblkname_fex
from_port: 13
to_port: 16
state: present
delegate_to: localhost
- name: Remove an access port block from an interface selector
cisco.aci.aci_access_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname
access_port_selector: accessportselectorname
port_blk: leafportblkname
from_port: 13
to_port: 13
state: absent
delegate_to: localhost
- name: Remove an access port block from an interface selector of type fex
cisco.aci.aci_access_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
type: fex
interface_profile: leafintprfname_fex
access_port_selector: accessportselectorname_fex
port_blk: leafportblkname_fex
from_port: 13
to_port: 13
state: absent
delegate_to: localhost
- name: Query Specific access port block under given access port selector
cisco.aci.aci_access_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname
access_port_selector: accessportselectorname
port_blk: leafportblkname
state: query
delegate_to: localhost
register: query_result
- name: Query Specific access port block under given access port selector of type fex
cisco.aci.aci_access_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
type: fex
interface_profile: leafintprfname_fex
access_port_selector: accessportselectorname_fex
port_blk: leafportblkname_fex
state: query
delegate_to: localhost
register: query_result
- name: Query all access port blocks under given leaf interface profile
cisco.aci.aci_access_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname
state: query
delegate_to: localhost
register: query_result
- name: Query all access port blocks under given leaf interface profile of type fex
cisco.aci.aci_access_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
type: fex
interface_profile: leafintprfname_fex
state: query
delegate_to: localhost
register: query_result
- name: Query all access port blocks in the fabric
cisco.aci.aci_access_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
- name: Query all access port blocks in the fabric of type fex
cisco.aci.aci_access_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
type: fex
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Simon Metzger (@smnmtzgr)
ansible cisco.aci.aci_fabric_spine_switch_assoc β Manage spine switch bindings to profiles and policy groups (fabric:SpineS and fabric:RsSpNodePGrp). cisco.aci.aci\_fabric\_spine\_switch\_assoc β Manage spine switch bindings to profiles and policy groups (fabric:SpineS and fabric:RsSpNodePGrp).
=================================================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_fabric_spine_switch_assoc`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage fabric spine switch associations (fabric:SpineS) to an existing fabric spine profile (fabric:SpineP) in an ACI fabric, and bind them to a policy group (fabric:RsSpNodePGrp)
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name** string | | Name of the switch association
aliases: association\_name, switch\_association |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **policy\_group** string | | Name of an existing spine switch policy group |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **profile** string | | Name of an existing fabric spine switch profile
aliases: spine\_profile, spine\_switch\_profile |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `profile` must exist before using this module in your playbook. The [cisco.aci.aci\_fabric\_spine\_profile](aci_fabric_spine_profile_module#ansible-collections-cisco-aci-aci-fabric-spine-profile-module) module can be used for this.
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes **fabricSpineS** and **fabricRsSpNodePGrp**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create a spine switch profile association
cisco.aci.aci_fabric_spine_switch_assoc:
host: apic
username: admin
password: SomeSecretPassword
profile: my_spine_profile
name: my_spine_switch_assoc
policy_group: my_spine_pol_grp
state: present
delegate_to: localhost
- name: Remove a spine switch profile association
cisco.aci.aci_fabric_spine_switch_assoc:
host: apic
username: admin
password: SomeSecretPassword
profile: my_spine_profile
name: my_spine_switch_assoc
state: absent
delegate_to: localhost
- name: Query a spine profile association
cisco.aci.aci_fabric_spine_switch_assoc:
host: apic
username: admin
password: SomeSecretPassword
profile: my_spine_profile
name: my_spine_switch_assoc
state: query
delegate_to: localhost
register: query_result
- name: Query all spine profiles
cisco.aci.aci_fabric_spine_switch_assoc:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Tim Cragg (@timcragg)
| programming_docs |
ansible cisco.aci.aci_cloud_ctx_profile β Manage Cloud Context Profile (cloud:CtxProfile) cisco.aci.aci\_cloud\_ctx\_profile β Manage Cloud Context Profile (cloud:CtxProfile)
====================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_cloud_ctx_profile`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage the Cloud Context Profile objects on Cisco Cloud ACI.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **cloud** string | **Choices:*** aws
* azure
| The cloud vendor in which the controller runs. |
| **description** string | | Description of the Cloud Context Profile |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name** string | | The name of the Cloud Context Profile
aliases: cloud\_context\_profile |
| **name\_alias** string | | An alias for the name of the current object. This relates to the nameAlias field in ACI and is used to rename object without changing the DN |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **primary\_cidr** string | | The subnet with netmask to use as primary CIDR block for the Cloud Context Profile. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **region** string | | The name of the cloud region in which to deploy the network construct. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | The name of the Tenant. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
| **vrf** string | | The name of the VRF. |
Notes
-----
Note
* More information about the internal APIC class **cloud:CtxProfile** from [the APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/).
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new aci cloud ctx profile
cisco.aci.aci_cloud_ctx_profile:
host: apic_host
username: admin
password: SomeSecretPassword
tenant: tenant_1
name: cloud_ctx_profile
vrf: VRF1
region: us-west-1
cloud: aws
primary_cidr: '10.0.10.1/16'
state: present
delegate_to: localhost
- name: Remove an aci cloud ctx profile
cisco.aci.aci_cloud_ctx_profile:
host: apic_host
username: admin
password: SomeSecretPassword
tenant: tenant_1
name: cloud_ctx_profile
state: absent
delegate_to: localhost
- name: Query a specific aci cloud ctx profile
cisco.aci.aci_cloud_ctx_profile:
host: apic_host
username: admin
password: SomeSecretPassword
tenant: anstest
name: ctx_profile_1
state: query
delegate_to: localhost
- name: Query all aci cloud ctx profile
cisco.aci.aci_cloud_ctx_profile:
host: apic_host
username: admin
password: SomeSecretPassword
tenant: anstest
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Nirav (@crestdatasys)
* Cindy Zhao (@cizhao)
ansible cisco.aci.aci_contract β Manage contract resources (vz:BrCP) cisco.aci.aci\_contract β Manage contract resources (vz:BrCP)
=============================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_contract`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Contract resources on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **contract** string | | The name of the contract.
aliases: contract\_name, name |
| **description** string | | Description for the contract.
aliases: descr |
| **dscp** string | **Choices:*** AF11
* AF12
* AF13
* AF21
* AF22
* AF23
* AF31
* AF32
* AF33
* AF41
* AF42
* AF43
* CS0
* CS1
* CS2
* CS3
* CS4
* CS5
* CS6
* CS7
* EF
* VA
* unspecified
| The target Differentiated Service (DSCP) value. The APIC defaults to `unspecified` when unset during creation.
aliases: target |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **priority** string | **Choices:*** level1
* level2
* level3
* unspecified
| The desired QoS class to be used. The APIC defaults to `unspecified` when unset during creation. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **scope** string | **Choices:*** application-profile
* context
* global
* tenant
| The scope of a service contract. The APIC defaults to `context` when unset during creation. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | The name of the tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* This module does not manage Contract Subjects, see [cisco.aci.aci\_contract\_subject](aci_contract_subject_module#ansible-collections-cisco-aci-aci-contract-subject-module) to do this. Contract Subjects can still be removed using this module.
* The `tenant` used must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module) module can be used for this.
See Also
--------
See also
[cisco.aci.aci\_contract\_subject](aci_contract_subject_module#ansible-collections-cisco-aci-aci-contract-subject-module)
The official documentation on the **cisco.aci.aci\_contract\_subject** module.
[cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module)
The official documentation on the **cisco.aci.aci\_tenant** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **vz:BrCP**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new contract
cisco.aci.aci_contract:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
description: Communication between web-servers and database
scope: application-profile
state: present
delegate_to: localhost
- name: Remove an existing contract
cisco.aci.aci_contract:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
state: absent
delegate_to: localhost
- name: Query a specific contract
cisco.aci.aci_contract:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
state: query
delegate_to: localhost
register: query_result
- name: Query all contracts
cisco.aci.aci_contract:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Dag Wieers (@dagwieers)
| programming_docs |
ansible cisco.aci.aci_config_snapshot β Manage Config Snapshots (config:Snapshot, config:ExportP) cisco.aci.aci\_config\_snapshot β Manage Config Snapshots (config:Snapshot, config:ExportP)
===========================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_config_snapshot`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Config Snapshots on Cisco ACI fabrics.
* Creating new Snapshots is done using the configExportP class.
* Removing Snapshots is done using the configSnapshot class.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | The description for the Config Export Policy.
aliases: descr |
| **export\_policy** string | | The name of the Export Policy to use for Config Snapshots.
aliases: name |
| **format** string | **Choices:*** json
* xml
| Sets the config backup to be formatted in JSON or XML. The APIC defaults to `json` when unset. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **include\_secure** boolean | **Choices:*** no
* yes
| Determines if secure information should be included in the backup. The APIC defaults to `yes` when unset. |
| **max\_count** integer | | Determines how many snapshots can exist for the Export Policy before the APIC starts to rollover. Accepted values range between `1` and `10`. The APIC defaults to `3` when unset. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **snapshot** string | | The name of the snapshot to delete. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The APIC does not provide a mechanism for naming the snapshots.
* Snapshot files use the following naming structure: ce\_<config export policy name>-<yyyy>-<mm>-<dd>T<hh>:<mm>:<ss>.<mss>+<hh>:<mm>.
* Snapshot objects use the following naming structure: run-<yyyy>-<mm>-<dd>T<hh>-<mm>-<ss>.
See Also
--------
See also
[cisco.aci.aci\_config\_rollback](aci_config_rollback_module#ansible-collections-cisco-aci-aci-config-rollback-module)
The official documentation on the **cisco.aci.aci\_config\_rollback** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes **config:Snapshot** and **config:ExportP**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create a Snapshot
cisco.aci.aci_config_snapshot:
host: apic
username: admin
password: SomeSecretPassword
state: present
export_policy: config_backup
max_count: 10
description: Backups taken before new configs are applied.
delegate_to: localhost
- name: Query all Snapshots
cisco.aci.aci_config_snapshot:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
- name: Query Snapshots associated with a particular Export Policy
cisco.aci.aci_config_snapshot:
host: apic
username: admin
password: SomeSecretPassword
export_policy: config_backup
state: query
delegate_to: localhost
register: query_result
- name: Delete a Snapshot
cisco.aci.aci_config_snapshot:
host: apic
username: admin
password: SomeSecretPassword
export_policy: config_backup
snapshot: run-2017-08-24T17-20-05
state: absent
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Jacob McGill (@jmcgill298)
ansible cisco.aci.aci_firmware_group β This module creates a firmware group cisco.aci.aci\_firmware\_group β This module creates a firmware group
=====================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_firmware_group`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module creates a firmware group, so that you can apply firmware policy to nodes.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **firmwarepol** string | | This is the name of the firmware policy, which was create by aci\_firmware\_policy. It is important that you use the same name as the policy created with aci\_firmware\_policy |
| **group** string | | This the name of the firmware group |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: firmware group
cisco.aci.aci_firmware_group:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: no
group: testingfwgrp1
firmwarepol: test2FrmPol
state: present
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Steven Gerhart (@sgerhart)
| programming_docs |
ansible cisco.aci.aci_epg_to_contract_master β Manage End Point Group (EPG) contract master relationships (fv:RsSecInherited) cisco.aci.aci\_epg\_to\_contract\_master β Manage End Point Group (EPG) contract master relationships (fv:RsSecInherited)
=========================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_epg_to_contract_master`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage End Point Groups (EPG) contract master relationships on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **ap** string / required | | Name of an existing application network profile, that will contain the EPGs.
aliases: app\_profile, app\_profile\_name |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **contract\_master\_ap** string | | Name of the application profile where the contract master EPG is. |
| **contract\_master\_epg** string | | Name of the end point group which serves as contract master. |
| **epg** string / required | | Name of the end point group.
aliases: epg\_name, name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string / required | | Name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `tenant` and `app_profile` used must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module) and [cisco.aci.aci\_ap](aci_ap_module#ansible-collections-cisco-aci-aci-ap-module) modules can be used for this.
See Also
--------
See also
[cisco.aci.aci\_epg](aci_epg_module#ansible-collections-cisco-aci-aci-epg-module)
The official documentation on the **cisco.aci.aci\_epg** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **fv:AEPg**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add contract master
cisco.aci.aci_epg_to_contract_master:
host: apic_host
username: admin
password: SomeSecretPassword
tenant: anstest
ap: apName
epg: epgName
contract_master_ap: ap
contract_master_epg: epg
state: present
delegate_to: localhost
- name: Remove contract master
cisco.aci.aci_epg_to_contract_master:
host: apic_host
username: admin
password: SomeSecretPassword
tenant: anstest
ap: apName
epg: epgName
contract_master_ap: ap
contract_master_epg: epg
state: absent
delegate_to: localhost
- name: Query contract master
cisco.aci.aci_epg_to_contract_master:
host: apic_host
username: admin
password: SomeSecretPassword
tenant: anstest
ap: apName
epg: epgName
contract_master_ap: ap
contract_master_epg: epg
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Cindy Zhao (@cizhao)
ansible cisco.aci.aci_l3out_extepg_to_contract β Bind Contracts to External End Point Groups (EPGs) cisco.aci.aci\_l3out\_extepg\_to\_contract β Bind Contracts to External End Point Groups (EPGs)
===============================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_l3out_extepg_to_contract`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Bind Contracts to External End Point Groups (EPGs) on ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **contract** string | | Name of the contract. |
| **contract\_type** string / required | **Choices:*** consumer
* provider
| The type of contract. |
| **extepg** string | | Name of the external end point group.
aliases: extepg\_name, external\_epg |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **l3out** string | | Name of the l3out.
aliases: l3out\_name |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **priority** string | **Choices:*** level1
* level2
* level3
* unspecified
| This has four levels of priority. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **provider\_match** string | **Choices:*** all
* at\_least\_one
* at\_most\_one
* none
| This is configurable for provided contracts. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | Name of existing tenant. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `tenant`, `l3out` and `extepg` must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module), [cisco.aci.aci\_l3out](aci_l3out_module#ansible-collections-cisco-aci-aci-l3out-module) and [cisco.aci.aci\_l3out\_extepg](aci_l3out_extepg_module#ansible-collections-cisco-aci-aci-l3out-extepg-module) modules can be used for this.
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **fvtenant**, **l3extInstP** and **l3extOut**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Bind a contract to an external EPG
cisco.aci.aci_l3out_extepg_to_contract:
host: apic
username: admin
password: SomeSecretePassword
tenant: Auto-Demo
l3out: l3out
extepg : testEpg
contract: contract1
contract_type: provider
state: present
delegate_to: localhost
- name: Remove existing contract from an external EPG
cisco.aci.aci_l3out_extepg_to_contract:
host: apic
username: admin
password: SomeSecretePassword
tenant: Auto-Demo
l3out: l3out
extepg : testEpg
contract: contract1
contract_type: provider
state: absent
delegate_to: localhost
- name: Query a contract bound to an external EPG
cisco.aci.aci_l3out_extepg_to_contract:
host: apic
username: admin
password: SomeSecretePassword
tenant: ansible_tenant
l3out: ansible_l3out
extepg: ansible_extEpg
contract: ansible_contract
contract_type: provider
state: query
delegate_to: localhost
register: query_result
- name: Query all contracts relationships
cisco.aci.aci_l3out_extepg_to_contract:
host: apic
username: admin
password: SomeSecretePassword
contract_type: provider
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class "/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Sudhakar Shet Kudtarkar (@kudtarkar1)
* Shreyas Srish (@shrsr)
| programming_docs |
ansible cisco.aci.aci_interface_policy_leaf_breakout_port_group β Manage fabric interface policy leaf breakout port group (infra:BrkoutPortGrp) cisco.aci.aci\_interface\_policy\_leaf\_breakout\_port\_group β Manage fabric interface policy leaf breakout port group (infra:BrkoutPortGrp)
=============================================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_interface_policy_leaf_breakout_port_group`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage fabric interface policy leaf breakout port group on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **breakout\_map** string | | The mapping of breakout port. |
| **breakout\_port\_group** string | | Name of the leaf breakout port group to be added/deleted.
aliases: name |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the leaf breakout port group to be created.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes **infra:BrkoutPortGrp**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create a Leaf Breakout Port Group
cisco.aci.aci_interface_policy_leaf_breakout_port_group:
host: apic
username: admin
password: SomeSecretPassword
breakout_port_group: BreakoutPortName
breakout_map: 10g-4x
state: present
delegate_to: localhost
- name: Query all Leaf Breakout Port Groups of type link
cisco.aci.aci_interface_policy_leaf_breakout_port_group:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
- name: Query a specific Leaf Breakout Port Group
cisco.aci.aci_interface_policy_leaf_breakout_port_group:
host: apic
username: admin
password: SomeSecretPassword
breakout_port_group: BreakoutPortName
state: query
delegate_to: localhost
register: query_result
- name: Delete an Leaf Breakout Port Group
cisco.aci.aci_interface_policy_leaf_breakout_port_group:
host: apic
username: admin
password: SomeSecretPassword
breakout_port_group: BreakoutPortName
state: absent
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Cindy Zhao (@cizhao)
ansible cisco.aci.aci_maintenance_policy β Manage firmware maintenance policies cisco.aci.aci\_maintenance\_policy β Manage firmware maintenance policies
=========================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_maintenance_policy`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage maintenance policies that defines behavior during an ACI upgrade.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **adminst** string | **Choices:*** triggered
* **untriggered** β
| Will trigger an immediate upgrade for nodes if adminst is set to triggered. |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **graceful** boolean | **Choices:*** no
* yes
| Whether the system will bring down the nodes gracefully during an upgrade, which reduces traffic lost. The APIC defaults to `no` when unset during creation. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **ignoreCompat** boolean | **Choices:*** no
* yes
| To check whether compatibility checks should be ignored The APIC defaults to `no` when unset during creation. |
| **name** string | | The name for the maintenance policy.
aliases: maintenance\_policy |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **runmode** string | **Choices:*** **pauseOnlyOnFailures** β
* pauseNever
| Whether the system pauses on error or just continues through it. |
| **scheduler** string | | The name of scheduler that is applied to the policy. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* A scheduler is required for this module, which could have been created using the [cisco.aci.aci\_fabric\_scheduler](aci_fabric_scheduler_module#ansible-collections-cisco-aci-aci-fabric-scheduler-module) module or via the UI.
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Ensure maintenance policy is present
cisco.aci.aci_maintenance_policy:
host: '{{ inventory_hostname }}'
username: '{{ user }}'
password: '{{ pass }}'
validate_certs: no
name: maintenancePol1
scheduler: simpleScheduler
runmode: False
state: present
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Steven Gerhart (@sgerhart)
| programming_docs |
ansible cisco.aci.aci_interface_policy_leaf_policy_group β Manage fabric interface policy leaf policy groups (infra:AccBndlGrp, infra:AccPortGrp) cisco.aci.aci\_interface\_policy\_leaf\_policy\_group β Manage fabric interface policy leaf policy groups (infra:AccBndlGrp, infra:AccPortGrp)
==============================================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_interface_policy_leaf_policy_group`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage fabric interface policy leaf policy groups on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aep** string | | Choice of attached\_entity\_profile (AEP) to be used as part of the leaf policy group to be created.
aliases: aep\_name |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **cdp\_policy** string | | Choice of cdp\_policy to be used as part of the leaf policy group to be created.
aliases: cdp\_policy\_name |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the leaf policy group to be created.
aliases: descr |
| **egress\_data\_plane\_policing\_policy** string | | Choice of egress\_data\_plane\_policing\_policy to be used as part of the leaf policy group to be created.
aliases: egress\_data\_plane\_policing\_policy\_name |
| **fibre\_channel\_interface\_policy** string | | Choice of fibre\_channel\_interface\_policy to be used as part of the leaf policy group to be created.
aliases: fibre\_channel\_interface\_policy\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **ingress\_data\_plane\_policing\_policy** string | | Choice of ingress\_data\_plane\_policing\_policy to be used as part of the leaf policy group to be created.
aliases: ingress\_data\_plane\_policing\_policy\_name |
| **l2\_interface\_policy** string | | Choice of l2\_interface\_policy to be used as part of the leaf policy group to be created.
aliases: l2\_interface\_policy\_name |
| **lag\_type** string / required | **Choices:*** leaf
* link
* node
| Selector for the type of leaf policy group we want to create.
`leaf` for Leaf Access Port Policy Group
`link` for Port Channel (PC)
`node` for Virtual Port Channel (VPC)
aliases: lag\_type\_name |
| **link\_level\_policy** string | | Choice of link\_level\_policy to be used as part of the leaf policy group to be created.
aliases: link\_level\_policy\_name |
| **lldp\_policy** string | | Choice of lldp\_policy to be used as part of the leaf policy group to be created.
aliases: lldp\_policy\_name |
| **mcp\_policy** string | | Choice of mcp\_policy to be used as part of the leaf policy group to be created.
aliases: mcp\_policy\_name |
| **monitoring\_policy** string | | Choice of monitoring\_policy to be used as part of the leaf policy group to be created.
aliases: monitoring\_policy\_name |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **policy\_group** string | | Name of the leaf policy group to be added/deleted.
aliases: name, policy\_group\_name |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **port\_channel\_policy** string | | Choice of port\_channel\_policy to be used as part of the leaf policy group to be created.
aliases: port\_channel\_policy\_name |
| **port\_security\_policy** string | | Choice of port\_security\_policy to be used as part of the leaf policy group to be created.
aliases: port\_security\_policy\_name |
| **priority\_flow\_control\_policy** string | | Choice of priority\_flow\_control\_policy to be used as part of the leaf policy group to be created.
aliases: priority\_flow\_control\_policy\_name |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **slow\_drain\_policy** string | | Choice of slow\_drain\_policy to be used as part of the leaf policy group to be created.
aliases: slow\_drain\_policy\_name |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **storm\_control\_interface\_policy** string | | Choice of storm\_control\_interface\_policy to be used as part of the leaf policy group to be created.
aliases: storm\_control\_interface\_policy\_name |
| **stp\_interface\_policy** string | | Choice of stp\_interface\_policy to be used as part of the leaf policy group to be created.
aliases: stp\_interface\_policy\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* When using the module please select the appropriate link\_aggregation\_type (lag\_type). `link` for Port Channel(PC), `node` for Virtual Port Channel(VPC) and `leaf` for Leaf Access Port Policy Group.
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes **infra:AccBndlGrp** and **infra:AccPortGrp**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create a Port Channel (PC) Interface Policy Group
cisco.aci.aci_interface_policy_leaf_policy_group:
host: apic
username: admin
password: SomeSecretPassword
lag_type: link
policy_group: policygroupname
description: policygroupname description
link_level_policy: whateverlinklevelpolicy
cdp_policy: whatevercdppolicy
lldp_policy: whateverlldppolicy
port_channel_policy: whateverlacppolicy
state: present
delegate_to: localhost
- name: Create a Virtual Port Channel (VPC) Interface Policy Group
cisco.aci.aci_interface_policy_leaf_policy_group:
host: apic
username: admin
password: SomeSecretPassword
lag_type: node
policy_group: policygroupname
link_level_policy: whateverlinklevelpolicy
cdp_policy: whatevercdppolicy
lldp_policy: whateverlldppolicy
port_channel_policy: whateverlacppolicy
state: present
delegate_to: localhost
- name: Create a Leaf Access Port Policy Group
cisco.aci.aci_interface_policy_leaf_policy_group:
host: apic
username: admin
password: SomeSecretPassword
lag_type: leaf
policy_group: policygroupname
link_level_policy: whateverlinklevelpolicy
cdp_policy: whatevercdppolicy
lldp_policy: whateverlldppolicy
state: present
delegate_to: localhost
- name: Query all Leaf Access Port Policy Groups of type link
cisco.aci.aci_interface_policy_leaf_policy_group:
host: apic
username: admin
password: SomeSecretPassword
lag_type: link
state: query
delegate_to: localhost
register: query_result
- name: Query a specific Lead Access Port Policy Group
cisco.aci.aci_interface_policy_leaf_policy_group:
host: apic
username: admin
password: SomeSecretPassword
lag_type: leaf
policy_group: policygroupname
state: query
delegate_to: localhost
register: query_result
- name: Delete an Interface policy Leaf Policy Group
cisco.aci.aci_interface_policy_leaf_policy_group:
host: apic
username: admin
password: SomeSecretPassword
lag_type: leaf
policy_group: policygroupname
state: absent
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Bruno Calogero (@brunocalogero)
ansible cisco.aci.aci_interface_selector_to_switch_policy_leaf_profile β Bind interface selector profiles to switch policy leaf profiles (infra:RsAccPortP) cisco.aci.aci\_interface\_selector\_to\_switch\_policy\_leaf\_profile β Bind interface selector profiles to switch policy leaf profiles (infra:RsAccPortP)
==========================================================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_interface_selector_to_switch_policy_leaf_profile`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Bind interface selector profiles to switch policy leaf profiles on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **interface\_selector** string | | Name of Interface Profile Selector to be added and associated with the Leaf Profile.
aliases: name, interface\_selector\_name, interface\_profile\_name |
| **leaf\_profile** string | | Name of the Leaf Profile to which we add a Selector.
aliases: leaf\_profile\_name |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* This module requires an existing leaf profile, the module [cisco.aci.aci\_switch\_policy\_leaf\_profile](aci_switch_policy_leaf_profile_module#ansible-collections-cisco-aci-aci-switch-policy-leaf-profile-module) can be used for this.
See Also
--------
See also
[cisco.aci.aci\_switch\_policy\_leaf\_profile](aci_switch_policy_leaf_profile_module#ansible-collections-cisco-aci-aci-switch-policy-leaf-profile-module)
The official documentation on the **cisco.aci.aci\_switch\_policy\_leaf\_profile** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **infra:RsAccPortP**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Associating an interface selector profile to a switch policy leaf profile
cisco.aci.aci_interface_selector_to_switch_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
leaf_profile: sw_name
interface_selector: interface_profile_name
state: present
delegate_to: localhost
- name: Remove an interface selector profile associated with a switch policy leaf profile
cisco.aci.aci_interface_selector_to_switch_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
leaf_profile: sw_name
interface_selector: interface_profile_name
state: absent
delegate_to: localhost
- name: Query an interface selector profile associated with a switch policy leaf profile
cisco.aci.aci_interface_selector_to_switch_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
leaf_profile: sw_name
interface_selector: interface_profile_name
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Bruno Calogero (@brunocalogero)
| programming_docs |
ansible cisco.aci.aci_vrf β Manage contexts or VRFs (fv:Ctx) cisco.aci.aci\_vrf β Manage contexts or VRFs (fv:Ctx)
=====================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_vrf`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage contexts or VRFs on Cisco ACI fabrics.
* Each context is a private network associated to a tenant, i.e. VRF.
* Enable Preferred Groups for VRF
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | The description for the VRF.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **match\_type** string | **Choices:*** all
* at\_least\_one
* at\_most\_one
* none
| Configures match type for contracts under vzAny |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **policy\_control\_direction** string | **Choices:*** egress
* ingress
| Determines if the policy should be enforced by the fabric on ingress or egress. |
| **policy\_control\_preference** string | **Choices:*** enforced
* unenforced
| Determines if the fabric should enforce contract policies to allow routing and packet forwarding. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **preferred\_group** string | **Choices:*** enabled
* disabled
| Enables preferred groups for the VRF under vzAny |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | The name of the Tenant the VRF should belong to.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
| **vrf** string | | The name of the VRF.
aliases: context, name, vrf\_name |
Notes
-----
Note
* The `tenant` used must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module) module can be used for this.
See Also
--------
See also
[cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module)
The official documentation on the **cisco.aci.aci\_tenant** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **fv:Ctx**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new VRF to a tenant
cisco.aci.aci_vrf:
host: apic
username: admin
password: SomeSecretPassword
vrf: vrf_lab
tenant: lab_tenant
descr: Lab VRF
policy_control_preference: enforced
policy_control_direction: ingress
state: present
delegate_to: localhost
- name: Remove a VRF for a tenant
cisco.aci.aci_vrf:
host: apic
username: admin
password: SomeSecretPassword
vrf: vrf_lab
tenant: lab_tenant
state: absent
delegate_to: localhost
- name: Query a VRF of a tenant
cisco.aci.aci_vrf:
host: apic
username: admin
password: SomeSecretPassword
vrf: vrf_lab
tenant: lab_tenant
state: query
delegate_to: localhost
register: query_result
- name: Query all VRFs
cisco.aci.aci_vrf:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Jacob McGill (@jmcgill298)
ansible cisco.aci.aci_cloud_epg β Manage Cloud EPG (cloud:EPg) cisco.aci.aci\_cloud\_epg β Manage Cloud EPG (cloud:EPg)
========================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_cloud_epg`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Cloud EPG on Cisco Cloud ACI
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **ap** string | | The name of the cloud application profile.
aliases: app\_profile, app\_profile\_name |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description of the cloud EPG.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name** string | | The name of the cloud EPG.
aliases: cloud\_epg, cloud\_epg\_name, epg, epg\_name |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | The name of the existing tenant. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
| **vrf** string | | The name of the VRF.
aliases: context, vrf\_name |
Notes
-----
Note
* More information about the internal APIC class **cloud:EPg** from [the APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/).
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create aci cloud epg (check_mode)
cisco.aci.aci_cloud_epg:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
ap: apName
vrf: vrfName
description: Aci Cloud EPG
name: epgName
state: present
delegate_to: localhost
- name: Remove cloud epg
cisco.aci.aci_cloud_epg:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
ap: apName
name: cloudName
state: absent
delegate_to: localhost
- name: query all
cisco.aci.aci_cloud_epg:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
ap: apName
state: query
delegate_to: localhost
- name: query a specific cloud epg
cisco.aci.aci_cloud_epg:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
ap: apName
name: epgName
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Nirav (@nirav)
* Cindy Zhao (@cizhao)
| programming_docs |
ansible cisco.aci.aci_cloud_aws_provider β Manage Cloud AWS Provider (cloud:AwsProvider) cisco.aci.aci\_cloud\_aws\_provider β Manage Cloud AWS Provider (cloud:AwsProvider)
===================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_cloud_aws_provider`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage AWS provider on Cisco Cloud ACI.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_key\_id** string | | Cloud Access Key ID. |
| **account\_id** string | | AWS Account ID. |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **is\_account\_in\_org** boolean | **Choices:*** no
* yes
| Is Account in Organization. |
| **is\_trusted** boolean | **Choices:*** no
* yes
| Trusted Tenant |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **secret\_access\_key** string | | Cloud Secret Access Key. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | Name of tenant. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* More information about the internal APIC class **cloud:AwsProvider** from
* [the APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/).
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create aws provider again after deletion as not trusted
cisco.aci.aci_cloud_aws_provider:
host: apic
username: admin
password: SomeSecretePassword
tenant: ansible_test
account_id: 111111111111
is_trusted: yes
state: present
delegate_to: localhost
- name: Delete aws provider
cisco.aci.aci_cloud_aws_provider:
host: apic
username: admin
password: SomeSecretePassword
tenant: ansible_test
account_id: 111111111111
is_trusted: yes
state: absent
delegate_to: localhost
- name: Query aws provider
cisco.aci.aci_cloud_aws_provider:
host: apic
username: admin
password: SomeSecretePassword
state: query
delegate_to: localhost
- name: Query all aws provider
cisco.aci.aci_cloud_aws_provider:
host: apic
username: admin
password: SomeSecretePassword
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Shreyas Srish (@shrsr)
ansible cisco.aci.aci_fabric_scheduler β This modules creates ACI schedulers. cisco.aci.aci\_fabric\_scheduler β This modules creates ACI schedulers.
=======================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_fabric_scheduler`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* With the module you can create schedule policies that can be a shell, onetime execution or recurring
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **concurCap** integer | | This is the amount of devices that can be executed on at a time |
| **date** string | | This is the date and time that the scheduler will execute |
| **day** string | **Choices:*** Monday
* Tuesday
* Wednesday
* Thursday
* Friday
* Saturday
* Sunday
* even-day
* odd-day
* **every-day** β
| This sets the day when execution will take place |
| **description** string | | Description for the Scheduler.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **hour** integer | | This set the hour of execution |
| **maxTime** string | | This is the amount MAX amount of time a process can be executed |
| **minute** integer | | This sets the minute of execution, used in conjunction with hour |
| **name** string | | The name of the Scheduler.
aliases: scheduler\_name |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **recurring** boolean | **Choices:*** no
* yes
| If you want to make the Scheduler a recurring it would be a "True" and for a oneTime execution it would be "False". For a shell just exclude this option from the task |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
| **windowname** string | | This is the name for your what recurring or oneTime execution |
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Simple Scheduler (Empty)
cisco.aci.aci_fabric_scheduler:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: no
name: simpleScheduler
state: present
- name: Remove Simple Scheduler
cisco.aci.aci_fabric_scheduler:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: no
name: simpleScheduler
state: absent
- name: One Time Scheduler
cisco.aci.aci_fabric_scheduler:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: no
name: OneTime
windowname: OneTime
recurring: False
concurCap: 20
date: "2018-11-20T24:00:00"
state: present
- name: Recurring Scheduler
cisco.aci.aci_fabric_scheduler:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: no
name: Recurring
windowname: Recurring
recurring: True
concurCap: 20
hour: 13
minute: 30
day: Tuesday
state: present
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Steven Gerhart (@sgerhart)
| programming_docs |
ansible cisco.aci.aci_l3out_bgp_peer β Manage Layer 3 Outside (L3Out) BGP Peers (bgp:PeerP) cisco.aci.aci\_l3out\_bgp\_peer β Manage Layer 3 Outside (L3Out) BGP Peers (bgp:PeerP)
======================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_l3out_bgp_peer`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage L3Out BGP Peers on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **address\_type\_controls** list / elements=string | **Choices:*** af-ucast
* af-mcast
| Address Type Controls |
| **admin\_state** string | **Choices:*** enabled
* disabled
| Admin state for the BGP session |
| **allow\_self\_as\_count** integer | | Number of allowed self AS. Only used if `allow-self-as` is enabled under `bgp_controls`. |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **bgp\_controls** list / elements=string | **Choices:*** send-com
* send-ext-com
* allow-self-as
* as-override
* dis-peer-as-check
* nh-self
| BGP Controls |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **interface\_profile** string / required | | Name of the interface profile.
aliases: interface\_profile\_name, logical\_interface |
| **l3out** string / required | | Name of an existing L3Out.
aliases: l3out\_name |
| **node\_id** string / required | | Node to build the interface on for Port-channels and single ports. Hyphen separated pair of nodes (e.g. "201-202") for vPCs. |
| **node\_profile** string / required | | Name of the node profile.
aliases: node\_profile\_name, logical\_node |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **path\_ep** string / required | | Path to interface Interface Port Group name for Port-channels and vPCs Port number for single ports (e.g. "eth1/12") |
| **peer\_controls** list / elements=string | **Choices:*** bfd
* dis-conn-check
| Peer Controls |
| **peer\_ip** string / required | | IP address of the BGP peer. |
| **pod\_id** string / required | | Pod to build the interface on. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_asn\_controls** list / elements=string | **Choices:*** remove-exclusive
* remove-all
* replace-as
| Private AS Controls |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **remote\_asn** integer | | Autonomous System Number of the BGP peer. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string / required | | Name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **ttl** integer | | eBGP Multihop Time To Live |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
| **weight** integer | | Weight for BGP routes from this neighbor |
See Also
--------
See also
M(aci\_l3out)
The official documentation on the **aci\_l3out** module.
M(aci\_l3out\_logical\_node\_profile)
The official documentation on the **aci\_l3out\_logical\_node\_profile** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes **bgp:peerP**
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new BGP peer on a physical interface
cisco.aci.aci_l3out_bgp_peer:
host: apic
username: admin
password: SomeSecretPassword
tenant: my_tenant
l3out: my_l3out
node_profile: my_node_profile
interface_profile: my_interface_profile
pod_id: 1
node_id: 201
path_ep: eth1/12
peer_ip: 192.168.10.2
remote_asn: 65456
bgp_controls:
- nh-self
- send-com
- send-ext-com
peer_controls:
- bfd
state: present
delegate_to: localhost
- name: Add a new BGP peer on a vPC
cisco.aci.aci_l3out_bgp_peer:
host: apic
username: admin
password: SomeSecretPassword
tenant: my_tenant
l3out: my_l3out
node_profile: my_node_profile
interface_profile: my_interface_profile
pod_id: 1
node_id: 201-202
path_ep: my_vpc_ipg
peer_ip: 192.168.20.2
remote_asn: 65457
ttl: 4
weight: 50
state: present
delegate_to: localhost
- name: Shutdown a BGP peer
cisco.aci.aci_l3out_bgp_peer:
host: apic
username: admin
password: SomeSecretPassword
tenant: my_tenant
l3out: my_l3out
node_profile: my_node_profile
interface_profile: my_interface_profile
pod_id: 1
node_id: 201
path_ep: eth1/12
peer_ip: 192.168.10.2
admin_state: disabled
state: present
delegate_to: localhost
- name: Delete a BGP peer
cisco.aci.aci_l3out_bgp_peer:
host: apic
username: admin
password: SomeSecretPassword
tenant: my_tenant
l3out: my_l3out
node_profile: my_node_profile
interface_profile: my_interface_profile
pod_id: 1
node_id: 201
path_ep: eth1/12
peer_ip: 192.168.10.2
state: absent
delegate_to: localhost
- name: Query a BGP peer
cisco.aci.aci_l3out_bgp_peer:
host: apic
username: admin
password: SomeSecretPassword
tenant: my_tenant
l3out: my_l3out
node_profile: my_node_profile
interface_profile: my_interface_profile
pod_id: 1
node_id: 201
path_ep: eth1/12
peer_ip: 192.168.10.2
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Tim Cragg (@timcragg)
ansible cisco.aci.aci_epg_to_contract β Bind EPGs to Contracts (fv:RsCons, fv:RsProv) cisco.aci.aci\_epg\_to\_contract β Bind EPGs to Contracts (fv:RsCons, fv:RsProv)
================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_epg_to_contract`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Bind EPGs to Contracts on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **ap** string | | Name of an existing application network profile, that will contain the EPGs.
aliases: app\_profile, app\_profile\_name |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **contract** string | | The name of the contract.
aliases: contract\_name |
| **contract\_type** string / required | **Choices:*** consumer
* provider
| Determines if the EPG should Provide or Consume the Contract. |
| **epg** string | | The name of the end point group.
aliases: epg\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **priority** string | **Choices:*** level1
* level2
* level3
* unspecified
| QoS class. The APIC defaults to `unspecified` when unset during creation. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **provider\_match** string | **Choices:*** all
* at\_least\_one
* at\_most\_one
* none
| The matching algorithm for Provided Contracts. The APIC defaults to `at_least_one` when unset during creation. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | Name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `tenant`, `app_profile`, `EPG`, and `Contract` used must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module), [cisco.aci.aci\_ap](aci_ap_module#ansible-collections-cisco-aci-aci-ap-module), [cisco.aci.aci\_epg](aci_epg_module#ansible-collections-cisco-aci-aci-epg-module), and [cisco.aci.aci\_contract](aci_contract_module#ansible-collections-cisco-aci-aci-contract-module) modules can be used for this.
See Also
--------
See also
[cisco.aci.aci\_ap](aci_ap_module#ansible-collections-cisco-aci-aci-ap-module)
The official documentation on the **cisco.aci.aci\_ap** module.
[cisco.aci.aci\_epg](aci_epg_module#ansible-collections-cisco-aci-aci-epg-module)
The official documentation on the **cisco.aci.aci\_epg** module.
[cisco.aci.aci\_contract](aci_contract_module#ansible-collections-cisco-aci-aci-contract-module)
The official documentation on the **cisco.aci.aci\_contract** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes **fv:RsCons** and **fv:RsProv**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new contract to EPG binding
cisco.aci.aci_epg_to_contract:
host: apic
username: admin
password: SomeSecretPassword
tenant: anstest
ap: anstest
epg: anstest
contract: anstest_http
contract_type: provider
state: present
delegate_to: localhost
- name: Remove an existing contract to EPG binding
cisco.aci.aci_epg_to_contract:
host: apic
username: admin
password: SomeSecretPassword
tenant: anstest
ap: anstest
epg: anstest
contract: anstest_http
contract_type: provider
state: absent
delegate_to: localhost
- name: Query a specific contract to EPG binding
cisco.aci.aci_epg_to_contract:
host: apic
username: admin
password: SomeSecretPassword
tenant: anstest
ap: anstest
epg: anstest
contract: anstest_http
contract_type: provider
state: query
delegate_to: localhost
register: query_result
- name: Query all provider contract to EPG bindings
cisco.aci.aci_epg_to_contract:
host: apic
username: admin
password: SomeSecretPassword
contract_type: provider
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Jacob McGill (@jmcgill298)
| programming_docs |
ansible cisco.aci.aci_aaa_user_certificate β Manage AAA user certificates (aaa:UserCert) cisco.aci.aci\_aaa\_user\_certificate β Manage AAA user certificates (aaa:UserCert)
===================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_aaa_user_certificate`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage AAA user certificates on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aaa\_user** string / required | | The name of the user to add a certificate to. |
| **aaa\_user\_type** string | **Choices:*** appuser
* **user** β
| Whether this is a normal user or an appuser. |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate** string | | The PEM format public key extracted from the X.509 certificate.
aliases: cert\_data, certificate\_data |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name** string | | The name of the user certificate entry in ACI.
aliases: cert\_name |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `aaa_user` must exist before using this module in your playbook. The [cisco.aci.aci\_aaa\_user](aci_aaa_user_module#ansible-collections-cisco-aci-aci-aaa-user-module) module can be used for this.
See Also
--------
See also
[cisco.aci.aci\_aaa\_user](aci_aaa_user_module#ansible-collections-cisco-aci-aci-aaa-user-module)
The official documentation on the **cisco.aci.aci\_aaa\_user** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **aaa:UserCert**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a certificate to user
cisco.aci.aci_aaa_user_certificate:
host: apic
username: admin
password: SomeSecretPassword
aaa_user: admin
name: admin
certificate_data: '{{ lookup("file", "pki/admin.crt") }}'
state: present
delegate_to: localhost
- name: Remove a certificate of a user
cisco.aci.aci_aaa_user_certificate:
host: apic
username: admin
password: SomeSecretPassword
aaa_user: admin
name: admin
state: absent
delegate_to: localhost
- name: Query a certificate of a user
cisco.aci.aci_aaa_user_certificate:
host: apic
username: admin
password: SomeSecretPassword
aaa_user: admin
name: admin
state: query
delegate_to: localhost
register: query_result
- name: Query all certificates of a user
cisco.aci.aci_aaa_user_certificate:
host: apic
username: admin
password: SomeSecretPassword
aaa_user: admin
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Dag Wieers (@dagwieers)
ansible cisco.aci.aci_interface_policy_l2 β Manage Layer 2 interface policies (l2:IfPol) cisco.aci.aci\_interface\_policy\_l2 β Manage Layer 2 interface policies (l2:IfPol)
===================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_interface_policy_l2`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Layer 2 interface policies on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | The description of the Layer 2 interface policy.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **l2\_policy** string | | The name of the Layer 2 interface policy.
aliases: name |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **qinq** string | **Choices:*** core
* disabled
* edge
| Determines if QinQ is disabled or if the port should be considered a core or edge port. The APIC defaults to `disabled` when unset during creation. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
| **vepa** boolean | **Choices:*** no
* yes
| Determines if Virtual Ethernet Port Aggregator is disabled or enabled. The APIC defaults to `no` when unset during creation. |
| **vlan\_scope** string | **Choices:*** global
* portlocal
| The scope of the VLAN. The APIC defaults to `global` when unset during creation. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **l2:IfPol**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a Layer 2 interface policy
cisco.aci.aci_interface_policy_l2:
host: '{{ hostname }}'
username: '{{ username }}'
password: '{{ password }}'
l2_policy: '{{ l2_policy }}'
vlan_scope: '{{ vlan_policy }}'
description: '{{ description }}'
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Dag Wieers (@dagwieers)
| programming_docs |
ansible cisco.aci.aci_interface_description β Setting and removing description on physical interfaces. cisco.aci.aci\_interface\_description β Setting and removing description on physical interfaces.
================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_interface_description`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Setting and removing description on physical interfaces on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | The `description` that should be attached to the `interface`. |
| **fex\_id** integer | | The fex ID that the `interface` belongs to. The `fex_id` value is usually something like '123'. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **interface** string | | The name of the `interface` that is targeted. Usually an interface name with the following format `1/7`. |
| **node\_id** integer | | The switch ID that the `interface` belongs to. The `node_id` value is usually something like '101'.
aliases: leaf, spine, node |
| **node\_type** string | **Choices:*** leaf
* spine
| The type of node the `interface` is configured on. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **pod\_id** integer | | The pod number.
`pod_id` is usually an integer below `12`
aliases: pod, pod\_number |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Set Interface Description
cisco.aci.aci_interface_description:
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: no
pod_id: 1
node_id: 105
node_type: leaf
interface: 1/49
description: foobar
state: present
delegate_to: localhost
- name: Remove Interface Description
cisco.aci.aci_interface_description:
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: no
pod_id: 1
node_id: 105
node_type: leaf
interface: 1/49
description: foobar
state: absent
delegate_to: localhost
- name: Set Interface Description on Fex
cisco.aci.aci_interface_description:
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: no
pod_id: 1
node_id: 105
fex_id: 123
interface: 1/49
description: foobar
state: present
delegate_to: localhost
- name: Remove Interface Description on Fex
cisco.aci.aci_interface_description:
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: no
pod_id: 1
node_id: 105
fex_id: 123
interface: 1/49
description: foobar
state: absent
delegate_to: localhost
- name: Query Interface
cisco.aci.aci_interface_description:
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: no
pod_id: 1
node_id: 105
node_type: leaf
interface: 1/49
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Akini Ross (@akinross)
ansible cisco.aci.aci_access_port_to_interface_policy_leaf_profile β Manage Fabric interface policy leaf profile interface selectors (infra:HPortS, infra:RsAccBaseGrp, infra:PortBlk) cisco.aci.aci\_access\_port\_to\_interface\_policy\_leaf\_profile β Manage Fabric interface policy leaf profile interface selectors (infra:HPortS, infra:RsAccBaseGrp, infra:PortBlk)
=====================================================================================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_access_port_to_interface_policy_leaf_profile`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Fabric interface policy leaf profile interface selectors on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_port\_selector** string | | The name of the Fabric access policy leaf interface profile access port selector.
aliases: name, access\_port\_selector\_name |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | The description to assign to the `access_port_selector`
|
| **from\_card** string | | **Deprecated** Starting with Ansible 2.8 we recommend using [cisco.aci.aci\_access\_port\_block\_to\_access\_port](aci_access_port_block_to_access_port_module) instead. The parameter will be removed in Ansible 2.12. The beginning (from-range) of the card range block for the leaf access port block.
aliases: from\_card\_range |
| **from\_port** string | | **Deprecated** Starting with Ansible 2.8 we recommend using [cisco.aci.aci\_access\_port\_block\_to\_access\_port](aci_access_port_block_to_access_port_module) instead. The parameter will be removed in Ansible 2.12. The beginning (from-range) of the port range block for the leaf access port block.
aliases: from, fromPort, from\_port\_range |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **interface\_profile** string | | The name of the Fabric access policy leaf interface profile.
aliases: leaf\_interface\_profile\_name, leaf\_interface\_profile, interface\_profile\_name |
| **interface\_type** string | **Choices:*** breakout
* fex
* port\_channel
* **switch\_port** β
* vpc
| The type of interface for the static EPG deployment. |
| **leaf\_port\_blk\_description** string | | **Deprecated** Starting with Ansible 2.8 we recommend using [cisco.aci.aci\_access\_port\_block\_to\_access\_port](aci_access_port_block_to_access_port_module) instead. The parameter will be removed in Ansible 2.12. The description to assign to the `leaf_port_blk`
|
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **policy\_group** string | | The name of the fabric access policy group to be associated with the leaf interface profile interface selector.
aliases: policy\_group\_name |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **port\_blk** string | | **Deprecated** Starting with Ansible 2.8 we recommend using [cisco.aci.aci\_access\_port\_block\_to\_access\_port](aci_access_port_block_to_access_port_module) instead. The parameter will be removed in Ansible 2.12. The name of the Fabric access policy leaf interface profile access port block.
aliases: leaf\_port\_blk\_name, leaf\_port\_blk, port\_blk\_name |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **to\_card** string | | **Deprecated** Starting with Ansible 2.8 we recommend using [cisco.aci.aci\_access\_port\_block\_to\_access\_port](aci_access_port_block_to_access_port_module) instead. The parameter will be removed in Ansible 2.12. The end (to-range) of the card range block for the leaf access port block.
aliases: to\_card\_range |
| **to\_port** string | | **Deprecated** Starting with Ansible 2.8 we recommend using [cisco.aci.aci\_access\_port\_block\_to\_access\_port](aci_access_port_block_to_access_port_module) instead. The parameter will be removed in Ansible 2.12. The end (to-range) of the port range block for the leaf access port block.
aliases: to, toPort, to\_port\_range |
| **type** string | **Choices:*** fex
* **leaf** β
| The type of access port to be created under respective profile. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `interface_profile` must exist before using this module in your playbook. The [cisco.aci.aci\_interface\_policy\_leaf\_profile](aci_interface_policy_leaf_profile_module#ansible-collections-cisco-aci-aci-interface-policy-leaf-profile-module) modules can be used for this.
See Also
--------
See also
[cisco.aci.aci\_access\_port\_block\_to\_access\_port](aci_access_port_block_to_access_port_module#ansible-collections-cisco-aci-aci-access-port-block-to-access-port-module)
The official documentation on the **cisco.aci.aci\_access\_port\_block\_to\_access\_port** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes **infra:HPortS**, **infra:RsAccBaseGrp** and **infra:PortBlk**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Associate an Interface Access Port Selector to an Interface Policy Leaf Profile with a Policy Group
cisco.aci.aci_access_port_to_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname
access_port_selector: accessportselectorname
port_blk: leafportblkname
from_port: 13
to_port: 16
policy_group: policygroupname
state: present
delegate_to: localhost
- name: Associate an interface access port selector to an Interface Policy Leaf Profile (w/o policy group) (check if this works)
cisco.aci.aci_access_port_to_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname
access_port_selector: accessportselectorname
port_blk: leafportblkname
from_port: 13
to_port: 16
state: present
delegate_to: localhost
- name: Remove an interface access port selector associated with an Interface Policy Leaf Profile
cisco.aci.aci_access_port_to_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname
access_port_selector: accessportselectorname
state: absent
delegate_to: localhost
- name: Remove an interface access port selector associated with an Interface Policy Fex Profile
cisco.aci.aci_access_port_to_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: fexintprfname
access_port_selector: accessportselectorname
state: absent
delegate_to: localhost
- name: Query Specific access_port_selector under given leaf_interface_profile
cisco.aci.aci_access_port_to_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname
access_port_selector: accessportselectorname
state: query
delegate_to: localhost
register: query_result
- name: Query Specific access_port_selector under given Fex leaf_interface_profile
cisco.aci.aci_access_port_to_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: fexintprfname
access_port_selector: accessportselectorname
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Bruno Calogero (@brunocalogero)
* Shreyas Srish (@shrsr)
| programming_docs |
ansible cisco.aci.aci_cloud_ap β Manage Cloud Application Profile (AP) (cloud:App) cisco.aci.aci\_cloud\_ap β Manage Cloud Application Profile (AP) (cloud:App)
============================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_cloud_ap`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Cloud Application Profile (AP) objects on Cisco Cloud ACI
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the cloud application profile.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name** string | | The name of the cloud application profile.
aliases: app\_profile, app\_profile\_name, ap |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | The name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* More information about the internal APIC class **cloud:App** from [the APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/).
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new cloud AP
cisco.aci.aci_cloud_ap:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
name: intranet
description: Web Intranet EPG
state: present
delegate_to: localhost
- name: Remove a cloud AP
cisco.aci.aci_cloud_ap:
host: apic
username: admin
password: SomeSecretPassword
validate_certs: no
tenant: production
name: intranet
state: absent
delegate_to: localhost
- name: Query a cloud AP
cisco.aci.aci_cloud_ap:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
name: ticketing
state: query
delegate_to: localhost
register: query_result
- name: Query all cloud APs
cisco.aci.aci_cloud_ap:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
- name: Query all cloud APs with a Specific Name
cisco.aci.aci_cloud_ap:
host: apic
username: admin
password: SomeSecretPassword
validate_certs: no
name: ticketing
state: query
delegate_to: localhost
register: query_result
- name: Query all cloud APs of a tenant
cisco.aci.aci_cloud_ap:
host: apic
username: admin
password: SomeSecretPassword
validate_certs: no
tenant: production
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Nirav (@nirav)
* Cindy Zhao (@cizhao)
ansible cisco.aci.aci_tenant β Manage tenants (fv:Tenant) cisco.aci.aci\_tenant β Manage tenants (fv:Tenant)
==================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_tenant`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage tenants on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the tenant.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | The name of the tenant.
aliases: name, tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[cisco.aci.aci\_ap](aci_ap_module#ansible-collections-cisco-aci-aci-ap-module)
The official documentation on the **cisco.aci.aci\_ap** module.
[cisco.aci.aci\_bd](aci_bd_module#ansible-collections-cisco-aci-aci-bd-module)
The official documentation on the **cisco.aci.aci\_bd** module.
[cisco.aci.aci\_contract](aci_contract_module#ansible-collections-cisco-aci-aci-contract-module)
The official documentation on the **cisco.aci.aci\_contract** module.
[cisco.aci.aci\_filter](aci_filter_module#ansible-collections-cisco-aci-aci-filter-module)
The official documentation on the **cisco.aci.aci\_filter** module.
[cisco.aci.aci\_vrf](aci_vrf_module#ansible-collections-cisco-aci-aci-vrf-module)
The official documentation on the **cisco.aci.aci\_vrf** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **fv:Tenant**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new tenant
cisco.aci.aci_tenant:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
description: Production tenant
state: present
delegate_to: localhost
- name: Remove a tenant
cisco.aci.aci_tenant:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
state: absent
delegate_to: localhost
- name: Query a tenant
cisco.aci.aci_tenant:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
state: query
delegate_to: localhost
register: query_result
- name: Query all tenants
cisco.aci.aci_tenant:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Jacob McGill (@jmcgill298)
| programming_docs |
ansible cisco.aci.aci_l3out_static_routes β Manage Static routes object (l3ext:ipRouteP) cisco.aci.aci\_l3out\_static\_routes β Manage Static routes object (l3ext:ipRouteP)
===================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_l3out_static_routes`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage External Subnet objects (l3ext:ipRouteP)
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **bfd** string | **Choices:*** bfd
* **None** β
| Determines if bfd is required for route control. The APIC defaults to `null` when unset during creation. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | The description for the static routes.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **l3out** string | | Name of an existing L3Out.
aliases: l3out\_name |
| **logical\_node** string | | Name of an existing logical node profile.
aliases: node\_profile, node\_profile\_name |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **node\_id** integer | | Existing nodeId. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **pod\_id** integer | | Existing podId. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **preference** integer | | Administrative preference value for the route. |
| **prefix** string | | Configure IP and next hop IP for the routed outside network.
aliases: route |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | Name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **track\_policy** string | | Relation definition for static route to TrackList. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `tenant`, `l3out`, `logical_node`, `fabric_node` and `prefix` used must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module) and [cisco.aci.aci\_l3out](aci_l3out_module#ansible-collections-cisco-aci-aci-l3out-module) modules can be used for this.
See Also
--------
See also
[cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module)
The official documentation on the **cisco.aci.aci\_tenant** module.
[cisco.aci.aci\_l3out](aci_l3out_module#ansible-collections-cisco-aci-aci-l3out-module)
The official documentation on the **cisco.aci.aci\_l3out** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **l3ext:Out**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create static routes
cisco.aci.aci_l3out_static_routes:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
l3out: l3out
logical_node: nodeName
node_id: 101
pod_id: 1
prefix: 10.10.0.0/16
delegate_to: localhost
- name: Delete static routes
cisco.aci.aci_l3out_static_routes:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
l3out: l3out
logical_node: nodeName
node_id: 101
pod_id: 1
prefix: 10.10.0.0/16
delegate_to: localhost
- name: Query for a specific MO under l3out
cisco.aci.aci_l3out_static_routes:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
l3out: l3out
logical_node: nodeName
node_id: 101
pod_id: 1
prefix: 10.10.0.0/16
delegate_to: localhost
- name: Query for all static routes
cisco.aci.aci_l3out_static_routes:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Anvitha Jain(@anvitha-jain)
ansible cisco.aci.aci_cloud_provider β Query Cloud Provider information (cloud:ProvP) cisco.aci.aci\_cloud\_provider β Query Cloud Provider information (cloud:ProvP)
===============================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_cloud_provider`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Query Cloud Provider information (cloud:ProvP) on Cisco Cloud ACI.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** **query** β
| Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* More information about the internal APIC class **cloud:ProvP** from [the APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/).
* This module is used to query Cloud Provider information.
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Query cloud provider information
cisco.aci.aci_cloud_provider:
host: apic
username: userName
password: somePassword
validate_certs: no
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Lionel Hercot (@lhercot)
| programming_docs |
ansible cisco.aci.aci_interface_policy_ospf β Manage OSPF interface policies (ospf:IfPol) cisco.aci.aci\_interface\_policy\_ospf β Manage OSPF interface policies (ospf:IfPol)
====================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_interface_policy_ospf`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage OSPF interface policies on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **controls** list / elements=string | **Choices:*** advert-subnet
* bfd
* mtu-ignore
* passive
| The interface policy controls. This is a list of one or more of the following controls:
`advert-subnet` -- Advertise IP subnet instead of a host mask in the router LSA.
`bfd` -- Bidirectional Forwarding Detection
`mtu-ignore` -- Disables MTU mismatch detection on an interface.
`passive` -- The interface does not participate in the OSPF protocol and will not establish adjacencies or send routing updates. However the interface is announced as part of the routing network. |
| **cost** integer | | The OSPF cost of the interface. The cost (also called metric) of an interface in OSPF is an indication of the overhead required to send packets across a certain interface. The cost of an interface is inversely proportional to the bandwidth of that interface. A higher bandwidth indicates a lower cost. There is more overhead (higher cost) and time delays involved in crossing a 56k serial line than crossing a 10M ethernet line. The formula used to calculate the cost is `cost= 10000 0000/bandwith in bps` For example, it will cost 10 EXP8/10 EXP7 = 10 to cross a 10M Ethernet line and will cost 10 EXP8/1544000 = 64 to cross a T1 line. By default, the cost of an interface is calculated based on the bandwidth; you can force the cost of an interface with the ip ospf cost value interface subconfiguration mode command. Accepted values range between `1` and `450`. The APIC defaults to `0` when unset during creation. |
| **dead\_interval** integer | | The interval between hello packets from a neighbor before the router declares the neighbor as down. This value must be the same for all networking devices on a specific network. Specifying a smaller dead interval (seconds) will give faster detection of a neighbor being down and improve convergence, but might cause more routing instability. Accepted values range between `1` and `65535`. The APIC defaults to `40` when unset during creation. |
| **description** string | | The description for the OSPF interface.
aliases: descr |
| **hello\_interval** integer | | The interval between hello packets that OSPF sends on the interface. Note that the smaller the hello interval, the faster topological changes will be detected, but more routing traffic will ensue. This value must be the same for all routers and access servers on a specific network. Accepted values range between `1` and `65535`. The APIC defaults to `10` when unset during creation. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **network\_type** string | **Choices:*** bcast
* p2p
| The OSPF interface policy network type. OSPF supports broadcast and point-to-point. The APIC defaults to `unspecified` when unset during creation. |
| **ospf** string | | The OSPF interface policy name. This name can be between 1 and 64 alphanumeric characters. Note that you cannot change this name after the object has been saved.
aliases: ospf\_interface, name |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **prefix\_suppression** boolean | **Choices:*** no
* yes
| Whether prefix suppressions is enabled or disabled. The APIC defaults to `inherit` when unset during creation. |
| **priority** integer | | The priority for the OSPF interface profile. Accepted values ranges between `0` and `255`. The APIC defaults to `1` when unset during creation. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **retransmit\_interval** integer | | The interval between LSA retransmissions. The retransmit interval occurs while the router is waiting for an acknowledgement from the neighbor router that it received the LSA. If no acknowledgment is received at the end of the interval, then the LSA is resent. Accepted values range between `1` and `65535`. The APIC defaults to `5` when unset during creation. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | The name of the Tenant the OSPF interface policy should belong to.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **transmit\_delay** integer | | The delay time needed to send an LSA update packet. OSPF increments the LSA age time by the transmit delay amount before transmitting the LSA update. You should take into account the transmission and propagation delays for the interface when you set this value. Accepted values range between `1` and `450`. The APIC defaults to `1` when unset during creation. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **ospf:IfPol**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Ensure ospf interface policy exists
cisco.aci.aci_interface_policy_ospf:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
ospf: ospf1
state: present
delegate_to: localhost
- name: Ensure ospf interface policy does not exist
cisco.aci.aci_interface_policy_ospf:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
ospf: ospf1
state: present
delegate_to: localhost
- name: Query an ospf interface policy
cisco.aci.aci_interface_policy_ospf:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
ospf: ospf1
state: query
delegate_to: localhost
register: query_result
- name: Query all ospf interface policies in tenant production
cisco.aci.aci_interface_policy_ospf:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Dag Wieers (@dagwieers)
ansible cisco.aci.aci_aaa_user β Manage AAA users (aaa:User) cisco.aci.aci\_aaa\_user β Manage AAA users (aaa:User)
======================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_aaa_user`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage AAA users on Cisco ACI fabrics.
Requirements
------------
The below requirements are needed on the host that executes this module.
* python-dateutil
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aaa\_password** string | | The password of the locally-authenticated user. |
| **aaa\_password\_lifetime** integer | | The lifetime of the locally-authenticated user password. |
| **aaa\_password\_update\_required** boolean | **Choices:*** no
* yes
| Whether this account needs password update. |
| **aaa\_user** string | | The name of the locally-authenticated user user to add.
aliases: name, user |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **clear\_password\_history** boolean | **Choices:*** no
* yes
| Whether to clear the password history of a locally-authenticated user. |
| **description** string | | Description for the AAA user.
aliases: descr |
| **email** string | | The email address of the locally-authenticated user. |
| **enabled** boolean | **Choices:*** no
* yes
| The status of the locally-authenticated user account. |
| **expiration** string | | The expiration date of the locally-authenticated user account. |
| **expires** boolean | **Choices:*** no
* yes
| Whether to enable an expiration date for the locally-authenticated user account. |
| **first\_name** string | | The first name of the locally-authenticated user. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **last\_name** string | | The last name of the locally-authenticated user. |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **phone** string | | The phone number of the locally-authenticated user. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* This module is not idempotent when `aaa_password` is being used (even if that password was already set identically). This appears to be an inconsistency wrt. the idempotent nature of the APIC REST API. The vendor has been informed. More information in [the ACI documentation](../../../scenario_guides/guide_aci#aci-guide-known-issues).
See Also
--------
See also
[cisco.aci.aci\_aaa\_user\_certificate](aci_aaa_user_certificate_module#ansible-collections-cisco-aci-aci-aaa-user-certificate-module)
The official documentation on the **cisco.aci.aci\_aaa\_user\_certificate** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **aaa:User**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a user
cisco.aci.aci_aaa_user:
host: apic
username: admin
password: SomeSecretPassword
aaa_user: dag
aaa_password: AnotherSecretPassword
expiration: never
expires: no
email: [email protected]
phone: 1-234-555-678
first_name: Dag
last_name: Wieers
state: present
delegate_to: localhost
- name: Remove a user
cisco.aci.aci_aaa_user:
host: apic
username: admin
password: SomeSecretPassword
aaa_user: dag
state: absent
delegate_to: localhost
- name: Query a user
cisco.aci.aci_aaa_user:
host: apic
username: admin
password: SomeSecretPassword
aaa_user: dag
state: query
delegate_to: localhost
register: query_result
- name: Query all users
cisco.aci.aci_aaa_user:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Dag Wieers (@dagwieers)
| programming_docs |
ansible cisco.aci.aci_syslog_group β Manage Syslog groups (syslog:Group, syslog:Console, syslog:File and syslog:Prof). cisco.aci.aci\_syslog\_group β Manage Syslog groups (syslog:Group, syslog:Console, syslog:File and syslog:Prof).
================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_syslog_group`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage syslog groups
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **admin\_state** string | **Choices:*** enabled
* disabled
| Administrative state of the syslog group |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **console\_log\_severity** string | **Choices:*** alerts
* critical
* debugging
* emergencies
* error
* information
* notifications
* warnings
| Severity of events to log to console |
| **console\_logging** string | **Choices:*** enabled
* disabled
| Log events to console |
| **format** string | **Choices:*** aci
* nxos
| Format of the syslog messages. If omitted when creating a group, ACI defaults to using aci format. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **include\_ms** boolean | **Choices:*** no
* yes
| Include milliseconds in log timestamps |
| **include\_time\_zone** boolean | **Choices:*** no
* yes
| Include timezone in log timestamps |
| **local\_file\_log\_severity** string | **Choices:*** alerts
* critical
* debugging
* emergencies
* error
* information
* notifications
* warnings
| Severity of events to log to local file |
| **local\_file\_logging** string | **Choices:*** enabled
* disabled
| Log to local file |
| **name** string | | Name of the syslog group
aliases: syslog\_group, syslog\_group\_name |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes **syslog:Group**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create a syslog group
cisco.aci.aci_syslog_group:
host: apic
username: admin
password: SomeSecretPassword
name: my_syslog_group
local_file_logging: enabled
local_file_log_severity: warnings
console_logging: enabled
console_log_severity: critical
state: present
delegate_to: localhost
- name: Disable logging to local file
cisco.aci.aci_syslog_group:
host: apic
username: admin
password: SomeSecretPassword
name: my_syslog_group
local_file_logging: disabled
state: present
delegate_to: localhost
- name: Remove a syslog group
cisco.aci.aci_syslog_group:
host: apic
username: admin
password: SomeSecretPassword
name: my_syslog_group
state: absent
delegate_to: localhost
- name: Query a syslog group
cisco.aci.aci_syslog_group:
host: apic
username: admin
password: SomeSecretPassword
name: my_syslog_group
state: query
delegate_to: localhost
register: query_result
- name: Query all syslog groups
cisco.aci.aci_syslog_group:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Tim Cragg (@timcragg)
ansible cisco.aci.aci_fabric_spine_profile β Manage fabric spine profiles (fabric:SpineP). cisco.aci.aci\_fabric\_spine\_profile β Manage fabric spine profiles (fabric:SpineP).
=====================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_fabric_spine_profile`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage fabric spine switch profiles in an ACI fabric.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | description of the profile
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name** string | | Name of the fabric spine switch profile
aliases: spine\_profile, spine\_switch\_profile |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **fabricSpineP**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create a spine switch profile
cisco.aci.aci_fabric_spine_profile:
host: apic
username: admin
password: SomeSecretPassword
name: my_spine_profile
state: present
delegate_to: localhost
- name: Remove a spine switch profile
cisco.aci.aci_fabric_spine_profile:
host: apic
username: admin
password: SomeSecretPassword
name: my_spine_profile
state: absent
delegate_to: localhost
- name: Query a spine profile
cisco.aci.aci_fabric_spine_profile:
host: apic
username: admin
password: SomeSecretPassword
name: my_spine_profile
state: query
delegate_to: localhost
register: query_result
- name: Query all spine profiles
cisco.aci.aci_fabric_spine_profile:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Tim Cragg (@timcragg)
| programming_docs |
ansible cisco.aci.aci_cloud_region β Manage Cloud Providers Region (cloud:Region) cisco.aci.aci\_cloud\_region β Manage Cloud Providers Region (cloud:Region)
===========================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_cloud_region`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Cloud Providers Region on Cisco Cloud ACI.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **cloud** string / required | **Choices:*** aws
* azure
| The vendor of the controller |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **region** string | | The name of the cloud provider's region.
aliases: name |
| **state** string | **Choices:*** **query** β
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* More information about the internal APIC class **cloud:Region** from [the APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/).
* This module is used to query Cloud Providers Region.
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Query all regions
cisco.aci.aci_cloud_region:
host: apic
username: userName
password: somePassword
validate_certs: no
cloud: 'aws'
state: query
delegate_to: localhost
- name: Query a specific region
cisco.aci.aci_cloud_region:
host: apic
username: userName
password: somePassword
validate_certs: no
cloud: 'aws'
region: eu-west-2
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Nirav (@nirav)
* Cindy Zhao (@cizhao)
ansible cisco.aci.aci_filter_entry β Manage filter entries (vz:Entry) cisco.aci.aci\_filter\_entry β Manage filter entries (vz:Entry)
===============================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_filter_entry`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage filter entries for a filter on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **arp\_flag** string | **Choices:*** arp\_reply
* arp\_request
* unspecified
| The arp flag to use when the ether\_type is arp. The APIC defaults to `unspecified` when unset during creation. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the Filter Entry.
aliases: descr |
| **dst\_port** string | | Used to set both destination start and end ports to the same value when ip\_protocol is tcp or udp. Accepted values are any valid TCP/UDP port range. The APIC defaults to `unspecified` when unset during creation. |
| **dst\_port\_end** string | | Used to set the destination end port when ip\_protocol is tcp or udp. Accepted values are any valid TCP/UDP port range. The APIC defaults to `unspecified` when unset during creation. |
| **dst\_port\_start** string | | Used to set the destination start port when ip\_protocol is tcp or udp. Accepted values are any valid TCP/UDP port range. The APIC defaults to `unspecified` when unset during creation. |
| **entry** string | | Then name of the Filter Entry.
aliases: entry\_name, filter\_entry, name |
| **ether\_type** string | **Choices:*** arp
* fcoe
* ip
* ipv4
* ipv6
* mac\_security
* mpls\_ucast
* trill
* unspecified
| The Ethernet type. The APIC defaults to `unspecified` when unset during creation. |
| **filter** string | | The name of Filter that the entry should belong to.
aliases: filter\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **icmp6\_msg\_type** string | **Choices:*** dst\_unreachable
* echo\_request
* echo\_reply
* neighbor\_advertisement
* neighbor\_solicitation
* redirect
* time\_exceeded
* unspecified
| ICMPv6 message type; used when ip\_protocol is icmpv6. The APIC defaults to `unspecified` when unset during creation. |
| **icmp\_msg\_type** string | **Choices:*** dst\_unreachable
* echo
* echo\_reply
* src\_quench
* time\_exceeded
* unspecified
| ICMPv4 message type; used when ip\_protocol is icmp. The APIC defaults to `unspecified` when unset during creation. |
| **ip\_protocol** string | **Choices:*** eigrp
* egp
* icmp
* icmpv6
* igmp
* igp
* l2tp
* ospfigp
* pim
* tcp
* udp
* unspecified
| The IP Protocol type when ether\_type is ip. The APIC defaults to `unspecified` when unset during creation. |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| present, absent, query |
| **stateful** boolean | **Choices:*** no
* yes
| Determines the statefulness of the filter entry. |
| **tenant** string | | The name of the tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `tenant` and `filter` used must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module) and [cisco.aci.aci\_filter](aci_filter_module#ansible-collections-cisco-aci-aci-filter-module) modules can be used for this.
See Also
--------
See also
[cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module)
The official documentation on the **cisco.aci.aci\_tenant** module.
[cisco.aci.aci\_filter](aci_filter_module#ansible-collections-cisco-aci-aci-filter-module)
The official documentation on the **cisco.aci.aci\_filter** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **vz:Entry**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- cisco.aci.aci_filter_entry:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
state: "{{ state }}"
entry: "{{ entry }}"
tenant: "{{ tenant }}"
ether_name: "{{ ether_name }}"
icmp_msg_type: "{{ icmp_msg_type }}"
filter: "{{ filter }}"
descr: "{{ descr }}"
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Jacob McGill (@jmcgill298)
| programming_docs |
ansible cisco.aci.aci_interface_blacklist β Enabling or Disabling physical interfaces. cisco.aci.aci\_interface\_blacklist β Enabling or Disabling physical interfaces.
================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_interface_blacklist`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Enables or Disables physical interfaces on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **fex\_id** integer | | The fex ID that the `interface` belongs to. The `fex_id` value is usually something like '123'. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **interface** string | | The name of the `interface` that is targeted. Usually an interface name with the following format `1/7`. |
| **node\_id** integer | | The switch ID that the `interface` belongs to. The `node_id` value is usually something like '101'.
aliases: leaf, spine, node |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **pod\_id** integer | | The pod number.
`pod_id` is usually an integer below `12`
aliases: pod, pod\_number |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Disable Interface
cisco.aci.aci_interface_blacklist:
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: no
pod_id: 1
node_id: 105
interface: 1/49
state: present
delegate_to: localhost
- name: Enable Interface
cisco.aci.aci_interface_blacklist:
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: no
pod_id: 1
node_id: 105
interface: 1/49
state: absent
delegate_to: localhost
- name: Disable Interface on Fex
cisco.aci.aci_interface_blacklist:
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: no
pod_id: 1
node_id: 105
fex_id: 123
interface: 1/49
state: present
delegate_to: localhost
- name: Enable Interface on Fex
cisco.aci.aci_interface_blacklist:
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: no
pod_id: 1
node_id: 105
fex_id: 123
interface: 1/49
state: absent
delegate_to: localhost
- name: Query Interface
cisco.aci.aci_interface_blacklist:
host: "{{ inventory_hostname }}"
username: "{{ username }}"
password: "{{ password }}"
validate_certs: no
pod_id: 1
node_id: 105
interface: 1/49
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Akini Ross (@akinross)
ansible cisco.aci.aci_l2out_logical_interface_path β Manage Layer 2 Outside (L2Out) logical interface path (l2extRsPathL2OutAtt) cisco.aci.aci\_l2out\_logical\_interface\_path β Manage Layer 2 Outside (L2Out) logical interface path (l2extRsPathL2OutAtt)
============================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_l2out_logical_interface_path`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage interface path entry of L2 outside node (BD extension) on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **interface** string | | The `interface` string value part of the tDn. Usually a policy group like `test-IntPolGrp` or an interface of the following format `1/7` depending on `interface_type`. |
| **interface\_profile** string | | Name of the interface profile.
aliases: name, interface\_profile\_name, logical\_interface |
| **interface\_type** string | **Choices:*** **switch\_port** β
* port\_channel
* vpc
| The type of interface for the static EPG deployment. |
| **l2out** string | | Name of an existing L2Out.
aliases: l2out\_name |
| **leaves** list / elements=string | | The switch ID(s) that the `interface` belongs to. When `interface_type` is `switch_port` or `port_channel`, then `leaves` is a string of the leaf ID. When `interface_type` is `vpc`, then `leaves` is a list with both leaf IDs. The `leaves` value is usually something like '101' or '101-102' depending on `connection_type`.
aliases: leafs, nodes, paths, switches |
| **node\_profile** string | | Name of the node profile.
aliases: node\_profile\_name, logical\_node |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **pod\_id** integer | | The pod number part of the tDn.
`pod_id` is usually an integer below `10`.
aliases: pod, pod\_number |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | Name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
M(aci\_l2out)
The official documentation on the **aci\_l2out** module.
M(aci\_l2out\_logical\_node\_profile)
The official documentation on the **aci\_l2out\_logical\_node\_profile** module.
M(aci\_l2out\_logical\_interface\_profile)
The official documentation on the **aci\_l2out\_logical\_interface\_profile** module.
M(aci\_l2out\_extepg)
The official documentation on the **aci\_l2out\_extepg** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add new node profile
cisco.aci.aci_l2out_logical_node_profile:
host: apic
username: admin
password: SomeSecretPassword
tenant: my_tenant
l2out: my_l2out
#node_profile: my_node_profile # 'default' by default
state: present
delegate_to: localhost
- name: Add new interface profile
cisco.aci.aci_l2out_logical_interface_profile:
host: apic
username: admin
password: SomeSecretPassword
tenant: my_tenant
l2out: my_l2out
node_profile: default
interface_profile: my_interface_profile # 'default' by default
state: present
delegate_to: localhost
- name: Add new path to interface profile
cisco.aci.aci_l2out_logical_interface_path:
host: apic
username: admin
password: SomeSecretPassword
tenant: my_tenant
l2out: my_l2out
node_profile: default
interface_profile: default
interface_type: vpc
pod_id: 1
leaves: 101-102
interface: L2o1
state: present
delegate_to: localhost
- name: Delete an interface profile
cisco.aci.aci_l2out_logical_interface_profile:
host: apic
username: admin
password: SomeSecretPassword
tenant: my_tenant
l2out: my_l2out
node_profile: default
interface_profile: default
state: absent
delegate_to: localhost
- name: Query an node profile
cisco.aci.aci_l2out_logical_node_profile:
host: apic
username: admin
password: SomeSecretPassword
tenant: my_tenant
l2out: my_l2out
#node_profile: default
state: query
delegate_to: localhost
register: query_result
- name: Query all node profiles
cisco.aci.aci_l2out_logical_node_profile:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Oleksandr Kreshchenko (@alexkross)
| programming_docs |
ansible cisco.aci.aci_cloud_external_epg_selector β Manage Cloud Endpoint Selector for External EPGs (cloud:ExtEPSelector) cisco.aci.aci\_cloud\_external\_epg\_selector β Manage Cloud Endpoint Selector for External EPGs (cloud:ExtEPSelector)
======================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_cloud_external_epg_selector`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
Synopsis
--------
* Decides which endpoints belong to the EPGs based on several parameters.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **ap** string | | The name of the cloud application profile.
aliases: app\_profile, app\_profile\_name |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **cloud\_external\_epg** string | | Name of Object cloud\_external\_epg. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name** string | | The name of the Cloud Endpoint selector.
aliases: selector, cloud\_external\_epg\_selector, external\_epg\_selector, extepg\_selector, selector\_name |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **subnet** string | | IP address of the Cloud Subnet.
aliases: ip |
| **tenant** string | | The name of tenant. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* More information about the internal APIC class **cloud:ExtEPSelector** from [the APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/).
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new cloud external EPG selector
cisco.aci.aci_cloud_external_epg_selector:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenant1
ap: ap1
cloud_external_epg: ext_epg
name: subnet_name
subnet: 10.0.0.0/16
state: present
delegate_to: localhost
- name: Remove a cloud external EPG selector
cisco.aci.aci_cloud_external_epg_selector:
host: apic
username: admin
password: SomeSecretPassword
validate_certs: no
tenant: tenant1
ap: ap1
cloud_external_epg: ext_epg
name: subnet_name
subnet: 10.0.0.0/16
state: absent
delegate_to: localhost
- name: Query all cloud external EPG selectors
cisco.aci.aci_cloud_external_epg_selector:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenant1
ap: ap1
cloud_external_epg: ext_epg
state: query
delegate_to: localhost
```
### Authors
* Anvitha Jain (@anvitha-jain)
ansible cisco.aci.aci_l2out_logical_interface_profile β Manage Layer 2 Outside (L2Out) interface profiles (l2ext:LIfP) cisco.aci.aci\_l2out\_logical\_interface\_profile β Manage Layer 2 Outside (L2Out) interface profiles (l2ext:LIfP)
==================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_l2out_logical_interface_profile`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage interface profiles of L2 outside (BD extension) on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **interface\_profile** string | | Name of the interface profile.
aliases: name, interface\_profile\_name, logical\_interface |
| **l2out** string | | Name of an existing L2Out.
aliases: l2out\_name |
| **node\_profile** string | **Default:**"default" | Name of the node profile.
aliases: node\_profile\_name, logical\_node |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | Name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
M(aci\_l2out)
The official documentation on the **aci\_l2out** module.
M(aci\_l2out\_logical\_node\_profile)
The official documentation on the **aci\_l2out\_logical\_node\_profile** module.
M(aci\_l2out\_logical\_interface\_path)
The official documentation on the **aci\_l2out\_logical\_interface\_path** module.
M(aci\_l2out\_extepg)
The official documentation on the **aci\_l2out\_extepg** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
See module aci_l2out_logical_interface_path.
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Oleksandr Kreshchenko (@alexkross)
ansible cisco.aci.aci_interface_policy_lldp β Manage LLDP interface policies (lldp:IfPol) cisco.aci.aci\_interface\_policy\_lldp β Manage LLDP interface policies (lldp:IfPol)
====================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_interface_policy_lldp`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage LLDP interface policies on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | The description for the LLDP interface policy name.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **lldp\_policy** string | | The LLDP interface policy name.
aliases: name |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **receive\_state** boolean | **Choices:*** no
* yes
| Enable or disable Receive state. The APIC defaults to `yes` when unset during creation. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **transmit\_state** boolean | **Choices:*** no
* yes
| Enable or Disable Transmit state. The APIC defaults to `yes` when unset during creation. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **lldp:IfPol**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a LLDP interface policy
cisco.aci.aci_interface_policy_lldp:
host: '{{ hostname }}'
username: '{{ username }}'
password: '{{ password }}'
lldp_policy: '{{ lldp_policy }}'
description: '{{ description }}'
receive_state: '{{ receive_state }}'
transmit_state: '{{ transmit_state }}'
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Dag Wieers (@dagwieers)
| programming_docs |
ansible cisco.aci.aci_interface_policy_link_level β Manage Link Level interface policies (fabric:HIfPol) cisco.aci.aci\_interface\_policy\_link\_level β Manage Link Level interface policies (fabric:HIfPol)
====================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_interface_policy_link_level`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* The link level interface policy specifies the layer 1 parameters of switch interfaces.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **auto\_negotiation** boolean | **Choices:*** no
* **yes** β
| Auto-negotiation enables devices to automatically exchange information over a link about speed and duplex abilities. The APIC defaults to `on` when unset during creation. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | The description of the Link Level interface policy.
aliases: descr |
| **forwarding\_error\_correction** string | **Choices:*** **inherit** β
* kp-fec
* cl91-rs-fec
* cl74-fc-fec
* disable-fec
* ieee-rs-fec
* cons16-rs-fec
| Determines the forwarding error correction (FEC) mode. The APIC defaults to `inherit` when unset during creation. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **link\_debounce\_interval** integer | **Default:**100 | Enables the debounce timer for physical interface ports and sets it for a specified amount of time in milliseconds. The APIC defaults to `100` when unset during creation. |
| **link\_level\_policy** string | | The name of the Link Level interface policy.
aliases: name |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **speed** string | **Choices:*** 100M
* 1G
* 10G
* 25G
* 40G
* 50G
* 100G
* 200G
* 400G
* **inherit** β
| Determines the interface policy administrative port speed. The APIC defaults to `inherit` when unset during creation. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **fabric:HIfPol**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a Link Level Policy
aci_interface_policy_link_level:
host: apic
username: admin
password: SomeSecretPassword
link_level_policy: link_level_policy_test
description: via Ansible
auto_negotiation: on
speed: 100M
link_debounce_interval: 100
forwarding_error_correction: cl91-rs-fec
state: present
delegate_to: localhost
- name: Remove a Link Level Policy
aci_interface_policy_link_level:
host: apic
username: admin
password: SomeSecretPassword
link_level_policy: ansible_test
state: absent
- name: Query a Link Level Policy
aci_interface_policy_link_level:
host: apic
username: admin
password: SomeSecretPassword
link_level_policy: link_level_policy_test
state: query
delegate_to: localhost
- name: Query all Link Level Policies
aci_interface_policy_link_level:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Vasily Prokopov (@vasilyprokopov)
ansible cisco.aci.aci_system β Query the ACI system information (top:System) cisco.aci.aci\_system β Query the ACI system information (top:System)
=====================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_system`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Query the ACI system information (top:System) on Cisco ACI.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **id** integer | | The controller node ID
aliases: controller, node |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** **query** β
| Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* More information about the internal APIC class **top:System** from [the APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/).
* This module is used to query system information for both cloud and on-premises controllers.
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Query all controllers system information
cisco.aci.aci_system:
host: apic
username: userName
password: somePassword
validate_certs: no
state: query
delegate_to: localhost
- name: Query controller 1 specific system information
cisco.aci.aci_system:
host: apic
username: userName
password: somePassword
validate_certs: no
id: 1
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Lionel Hercot (@lhercot)
| programming_docs |
ansible cisco.aci.aci_contract_subject_to_filter β Bind Contract Subjects to Filters (vz:RsSubjFiltAtt) cisco.aci.aci\_contract\_subject\_to\_filter β Bind Contract Subjects to Filters (vz:RsSubjFiltAtt)
===================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_contract_subject_to_filter`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Bind Contract Subjects to Filters on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **contract** string | | The name of the contract.
aliases: contract\_name |
| **filter** string | | The name of the Filter to bind to the Subject.
aliases: filter\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **log** string | **Choices:*** log
* none
| Determines if the binding should be set to log. The APIC defaults to `none` when unset during creation.
aliases: directive |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **subject** string | | The name of the Contract Subject.
aliases: contract\_subject, subject\_name |
| **tenant** string | | The name of the tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `tenant`, `contract`, `subject`, and `filter_name` must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module), [cisco.aci.aci\_contract](aci_contract_module#ansible-collections-cisco-aci-aci-contract-module), [cisco.aci.aci\_contract\_subject](aci_contract_subject_module#ansible-collections-cisco-aci-aci-contract-subject-module), and [cisco.aci.aci\_filter](aci_filter_module#ansible-collections-cisco-aci-aci-filter-module) modules can be used for these.
See Also
--------
See also
[cisco.aci.aci\_contract\_subject](aci_contract_subject_module#ansible-collections-cisco-aci-aci-contract-subject-module)
The official documentation on the **cisco.aci.aci\_contract\_subject** module.
[cisco.aci.aci\_filter](aci_filter_module#ansible-collections-cisco-aci-aci-filter-module)
The official documentation on the **cisco.aci.aci\_filter** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **vz:RsSubjFiltAtt**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new contract subject to filer binding
cisco.aci.aci_contract_subject_to_filter:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
subject: test
filter: '{{ filter }}'
log: '{{ log }}'
state: present
delegate_to: localhost
- name: Remove an existing contract subject to filter binding
cisco.aci.aci_contract_subject_to_filter:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
subject: test
filter: '{{ filter }}'
log: '{{ log }}'
state: present
delegate_to: localhost
- name: Query a specific contract subject to filter binding
cisco.aci.aci_contract_subject_to_filter:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
subject: test
filter: '{{ filter }}'
state: query
delegate_to: localhost
register: query_result
- name: Query all contract subject to filter bindings
cisco.aci.aci_contract_subject_to_filter:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
subject: test
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Jacob McGill (@jmcgill298)
ansible cisco.aci.aci_interface_policy_port_channel β Manage port channel interface policies (lacp:LagPol) cisco.aci.aci\_interface\_policy\_port\_channel β Manage port channel interface policies (lacp:LagPol)
======================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_interface_policy_port_channel`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage port channel interface policies on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | The description for the port channel.
aliases: descr |
| **fast\_select** boolean | **Choices:*** no
* yes
| Determines if Fast Select is enabled for Hot Standby Ports. This makes up the LACP Policy Control Policy; if one setting is defined, then all other Control Properties left undefined or set to false will not exist after the task is ran. The APIC defaults to `yes` when unset during creation. |
| **graceful\_convergence** boolean | **Choices:*** no
* yes
| Determines if Graceful Convergence is enabled. This makes up the LACP Policy Control Policy; if one setting is defined, then all other Control Properties left undefined or set to false will not exist after the task is ran. The APIC defaults to `yes` when unset during creation. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **load\_defer** boolean | **Choices:*** no
* yes
| Determines if Load Defer is enabled. This makes up the LACP Policy Control Policy; if one setting is defined, then all other Control Properties left undefined or set to false will not exist after the task is ran. The APIC defaults to `no` when unset during creation. |
| **max\_links** integer | | Maximum links. Accepted values range between 1 and 16. The APIC defaults to `16` when unset during creation. |
| **min\_links** integer | | Minimum links. Accepted values range between 1 and 16. The APIC defaults to `1` when unset during creation. |
| **mode** string | **Choices:*** active
* mac-pin
* mac-pin-nicload
* off
* passive
| Port channel interface policy mode. Determines the LACP method to use for forming port-channels. The APIC defaults to `off` when unset during creation. |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **port\_channel** string | | Name of the port channel.
aliases: name |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **suspend\_individual** boolean | **Choices:*** no
* yes
| Determines if Suspend Individual is enabled. This makes up the LACP Policy Control Policy; if one setting is defined, then all other Control Properties left undefined or set to false will not exist after the task is ran. The APIC defaults to `yes` when unset during creation. |
| **symmetric\_hash** boolean | **Choices:*** no
* yes
| Determines if Symmetric Hashing is enabled. This makes up the LACP Policy Control Policy; if one setting is defined, then all other Control Properties left undefined or set to false will not exist after the task is ran. The APIC defaults to `no` when unset during creation. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **lacp:LagPol**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a port channel interface policy
cisco.aci.aci_interface_policy_port_channel:
host: '{{ inventory_hostname }}'
username: '{{ username }}'
password: '{{ password }}'
port_channel: '{{ port_channel }}'
description: '{{ description }}'
min_links: '{{ min_links }}'
max_links: '{{ max_links }}'
mode: '{{ mode }}'
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Dag Wieers (@dagwieers)
| programming_docs |
ansible cisco.aci.aci_aep β Manage attachable Access Entity Profile (AEP) objects (infra:AttEntityP, infra:ProvAcc) cisco.aci.aci\_aep β Manage attachable Access Entity Profile (AEP) objects (infra:AttEntityP, infra:ProvAcc)
============================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_aep`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Connect to external virtual and physical domains by using attachable Access Entity Profiles (AEP) on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aep** string | | The name of the Attachable Access Entity Profile.
aliases: aep\_name, name |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the AEP.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **infra\_vlan** boolean | **Choices:*** no
* yes
| Enable infrastructure VLAN. The hypervisor functions of the AEP.
`no` will disable the infrastructure vlan if it is enabled.
aliases: infrastructure\_vlan |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[cisco.aci.aci\_aep\_to\_domain](aci_aep_to_domain_module#ansible-collections-cisco-aci-aci-aep-to-domain-module)
The official documentation on the **cisco.aci.aci\_aep\_to\_domain** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes **infra:AttEntityP** and **infra:ProvAcc**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new AEP
cisco.aci.aci_aep:
host: apic
username: admin
password: SomeSecretPassword
aep: ACI-AEP
description: default
infra_vlan: true
state: present
delegate_to: localhost
- name: Remove an existing AEP
cisco.aci.aci_aep:
host: apic
username: admin
password: SomeSecretPassword
aep: ACI-AEP
state: absent
delegate_to: localhost
- name: Query all AEPs
cisco.aci.aci_aep:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
- name: Query a specific AEP
cisco.aci.aci_aep:
host: apic
username: admin
password: SomeSecretPassword
aep: ACI-AEP
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Swetha Chunduri (@schunduri)
* Shreyas Srish (@shrsr)
ansible cisco.aci.aci_encap_pool_range β Manage encap ranges assigned to pools (fvns:EncapBlk, fvns:VsanEncapBlk) cisco.aci.aci\_encap\_pool\_range β Manage encap ranges assigned to pools (fvns:EncapBlk, fvns:VsanEncapBlk)
============================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_encap_pool_range`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage vlan, vxlan, and vsan ranges that are assigned to pools on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **allocation\_mode** string | **Choices:*** dynamic
* inherit
* static
| The method used for allocating encaps to resources. Only vlan and vsan support allocation modes.
aliases: mode |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the pool range.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **pool** string | | The name of the pool that the range should be assigned to.
aliases: pool\_name |
| **pool\_allocation\_mode** string | **Choices:*** dynamic
* static
| The method used for allocating encaps to resources. Only vlan and vsan support allocation modes.
aliases: pool\_mode |
| **pool\_type** string / required | **Choices:*** vlan
* vxlan
* vsan
| The encap type of `pool`.
aliases: type |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **range\_end** integer | | The end of encap range.
aliases: end |
| **range\_name** string | | The name to give to the encap range.
aliases: name, range |
| **range\_start** integer | | The start of the encap range.
aliases: start |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `pool` must exist in order to add or delete a range.
See Also
--------
See also
[cisco.aci.aci\_encap\_pool](aci_encap_pool_module#ansible-collections-cisco-aci-aci-encap-pool-module)
The official documentation on the **cisco.aci.aci\_encap\_pool** module.
[cisco.aci.aci\_vlan\_pool\_encap\_block](aci_vlan_pool_encap_block_module#ansible-collections-cisco-aci-aci-vlan-pool-encap-block-module)
The official documentation on the **cisco.aci.aci\_vlan\_pool\_encap\_block** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes **fvns:EncapBlk** and **fvns:VsanEncapBlk**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new VLAN pool range
cisco.aci.aci_encap_pool_range:
host: apic
username: admin
password: SomeSecretPassword
pool: production
pool_type: vlan
pool_allocation_mode: static
range_name: anstest
range_start: 20
range_end: 40
allocation_mode: inherit
state: present
delegate_to: localhost
- name: Remove a VLAN pool range
cisco.aci.aci_encap_pool_range:
host: apic
username: admin
password: SomeSecretPassword
pool: production
pool_type: vlan
pool_allocation_mode: static
range_name: anstest
range_start: 20
range_end: 40
state: absent
delegate_to: localhost
- name: Query a VLAN range
cisco.aci.aci_encap_pool_range:
host: apic
username: admin
password: SomeSecretPassword
pool: production
pool_type: vlan
pool_allocation_mode: static
range_name: anstest
range_start: 20
range_end: 50
state: query
delegate_to: localhost
register: query_result
- name: Query a VLAN pool for ranges by range_name
cisco.aci.aci_encap_pool_range:
host: apic
username: admin
password: SomeSecretPassword
pool_type: vlan
range_name: anstest
state: query
delegate_to: localhost
register: query_result
- name: Query a VLAN pool for ranges by range_start
cisco.aci.aci_encap_pool_range:
host: apic
username: admin
password: SomeSecretPassword
pool_type: vlan
range_start: 20
state: query
delegate_to: localhost
register: query_result
- name: Query a VLAN pool for ranges by range_start and range_end
cisco.aci.aci_encap_pool_range:
host: apic
username: admin
password: SomeSecretPassword
pool_type: vlan
range_start: 20
range_end: 40
state: query
delegate_to: localhost
register: query_result
- name: Query all VLAN pool ranges
cisco.aci.aci_encap_pool_range:
host: apic
username: admin
password: SomeSecretPassword
pool_type: vlan
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Jacob McGill (@jmcgill298)
| programming_docs |
ansible cisco.aci.aci_contract_export β Manage contract interfaces (vz:CPIf) cisco.aci.aci\_contract\_export β Manage contract interfaces (vz:CPIf)
======================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_contract_export`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Contract interfaces on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **contract** string | | The name of the contract to export.
aliases: contract\_name |
| **description** string | | Description for the contract interface.
aliases: descr |
| **destination\_tenant** string | | The The tenant associated with the contract interface. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name** string | | The name of the contract interface.
aliases: interface\_name |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | The name of the tenant hosting the contract to export.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[cisco.aci.aci\_contract](aci_contract_module#ansible-collections-cisco-aci-aci-contract-module)
The official documentation on the **cisco.aci.aci\_contract** module.
[cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module)
The official documentation on the **cisco.aci.aci\_tenant** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **vz:BrCP**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create a new contract interface
cisco.aci.aci_contract_export:
host: apic
username: admin
password: SomeSecretPassword
name: contractintf
destination_tenant: tndest
tenant: tnsrc
contract: web_to_db
state: present
delegate_to: localhost
- name: Remove an existing contract interface
cisco.aci.aci_contract_export:
host: apic
username: admin
password: SomeSecretPassword
name: contractintf
destination_tenant: tndest
tenant: tnsrc
contract: web_to_db
state: absent
delegate_to: localhost
- name: Query a specific contract interface
cisco.aci.aci_contract_export:
host: apic
username: admin
password: SomeSecretPassword
name: contractintf
destination_tenant: tndest
tenant: tnsrc
contract: web_to_db
state: query
delegate_to: localhost
register: query_result
- name: Query all contract interfaces
cisco.aci.aci_contract_export:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Marcel Zehnder (@maercu)
ansible cisco.aci.aci_contract_subject_to_service_graph β Bind contract subject to service graph (vz:RsSubjGraphAtt). cisco.aci.aci\_contract\_subject\_to\_service\_graph β Bind contract subject to service graph (vz:RsSubjGraphAtt).
==================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_contract_subject_to_service_graph`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Bind contract subject to service graph.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **contract** string | | The name of the contract. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **service\_graph** string | | The service graph name. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **subject** string | | The contract subject name. |
| **tenant** string | | The name of an existing tenant. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new contract subject to service graph binding
cisco.aci.aci_contract_subject_to_service_graph:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
subject: test
service_graph: '{{ service_graph }}'
state: present
delegate_to: localhost
- name: Remove an existing contract subject to service graph binding
cisco.aci.aci_contract_subject_to_service_graph:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
subject: test
service_graph: '{{ service_graph }}'
state: absent
delegate_to: localhost
- name: Query a specific contract subject to service graph binding
cisco.aci.aci_contract_subject_to_service_graph:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
subject: test
service_graph: '{{ service_graph }}'
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Marcel Zehnder (@maercu)
| programming_docs |
ansible cisco.aci.aci_epg_to_domain β Bind EPGs to Domains (fv:RsDomAtt) cisco.aci.aci\_epg\_to\_domain β Bind EPGs to Domains (fv:RsDomAtt)
===================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_epg_to_domain`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Bind EPGs to Physical and Virtual Domains on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **allow\_useg** string | **Choices:*** encap
* useg
| Allows micro-segmentation. The APIC defaults to `encap` when unset during creation. |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **ap** string | | Name of an existing application network profile, that will contain the EPGs.
aliases: app\_profile, app\_profile\_name |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **custom\_epg\_name** string | | The custom epg name in VMM domain association. |
| **deploy\_immediacy** string | **Choices:*** immediate
* lazy
| Determines when the policy is pushed to hardware Policy CAM. The APIC defaults to `lazy` when unset during creation. |
| **domain** string | | Name of the physical or virtual domain being associated with the EPG.
aliases: domain\_name, domain\_profile |
| **domain\_type** string | **Choices:*** l2dom
* phys
* vmm
| Specify whether the Domain is a physical (phys), a virtual (vmm) or an L2 external domain association (l2dom).
aliases: type |
| **encap** integer | | The VLAN encapsulation for the EPG when binding a VMM Domain with static `encap_mode`. This acts as the secondary encap when using useg. Accepted values range between `1` and `4096`. |
| **encap\_mode** string | **Choices:*** auto
* vlan
* vxlan
| The encapsulation method to be used. The APIC defaults to `auto` when unset during creation. If vxlan is selected, switching\_mode must be "AVE". |
| **enhanced\_lag\_policy** string | | Name of the VMM Domain Enhanced Lag Policy.
aliases: lag\_policy |
| **epg** string | | Name of the end point group.
aliases: epg\_name, name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **netflow** boolean | **Choices:*** no
* yes
| Determines if netflow should be enabled. The APIC defaults to `no` when unset during creation. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **primary\_encap** integer | | Determines the primary VLAN ID when using useg. Accepted values range between `1` and `4096`. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **promiscuous** string | **Choices:*** accept
* **reject** β
| Allow/Disallow promiscuous mode in vmm domain |
| **resolution\_immediacy** string | **Choices:*** immediate
* lazy
* pre-provision
| Determines when the policies should be resolved and available. The APIC defaults to `lazy` when unset during creation. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **switching\_mode** string | **Choices:*** AVE
* **native** β
| Switching Mode used by the switch |
| **tenant** string | | Name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
| **vm\_provider** string | **Choices:*** cloudfoundry
* kubernetes
* microsoft
* openshift
* openstack
* redhat
* vmware
| The VM platform for VMM Domains. Support for Kubernetes was added in ACI v3.0. Support for CloudFoundry, OpenShift and Red Hat was added in ACI v3.1. |
Notes
-----
Note
* The `tenant`, `ap`, `epg`, and `domain` used must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module) [cisco.aci.aci\_ap](aci_ap_module#ansible-collections-cisco-aci-aci-ap-module), [cisco.aci.aci\_epg](aci_epg_module#ansible-collections-cisco-aci-aci-epg-module) [cisco.aci.aci\_domain](aci_domain_module#ansible-collections-cisco-aci-aci-domain-module) modules can be used for this.
* OpenStack VMM domains must not be created using this module. The OpenStack VMM domain is created directly by the Cisco APIC Neutron plugin as part of the installation and configuration. This module can be used to query status of an OpenStack VMM domain.
See Also
--------
See also
[cisco.aci.aci\_ap](aci_ap_module#ansible-collections-cisco-aci-aci-ap-module)
The official documentation on the **cisco.aci.aci\_ap** module.
[cisco.aci.aci\_epg](aci_epg_module#ansible-collections-cisco-aci-aci-epg-module)
The official documentation on the **cisco.aci.aci\_epg** module.
[cisco.aci.aci\_domain](aci_domain_module#ansible-collections-cisco-aci-aci-domain-module)
The official documentation on the **cisco.aci.aci\_domain** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **fv:RsDomAtt**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new physical domain to EPG binding
cisco.aci.aci_epg_to_domain:
host: apic
username: admin
password: SomeSecretPassword
tenant: anstest
ap: anstest
epg: anstest
domain: anstest
domain_type: phys
state: present
delegate_to: localhost
- name: Remove an existing physical domain to EPG binding
cisco.aci.aci_epg_to_domain:
host: apic
username: admin
password: SomeSecretPassword
tenant: anstest
ap: anstest
epg: anstest
domain: anstest
domain_type: phys
state: absent
delegate_to: localhost
- name: Query a specific physical domain to EPG binding
cisco.aci.aci_epg_to_domain:
host: apic
username: admin
password: SomeSecretPassword
tenant: anstest
ap: anstest
epg: anstest
domain: anstest
domain_type: phys
state: query
delegate_to: localhost
register: query_result
- name: Query all domain to EPG bindings
cisco.aci.aci_epg_to_domain:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Jacob McGill (@jmcgill298)
* Shreyas Srish (@shrsr)
ansible cisco.aci.aci_config_rollback β Provides rollback and rollback preview functionality (config:ImportP) cisco.aci.aci\_config\_rollback β Provides rollback and rollback preview functionality (config:ImportP)
=======================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_config_rollback`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Provides rollback and rollback preview functionality for Cisco ACI fabrics.
* Config Rollbacks are done using snapshots `aci_snapshot` with the configImportP class.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **compare\_export\_policy** string | | The export policy that the `compare_snapshot` is associated to. |
| **compare\_snapshot** string | | The name of the snapshot to compare with `snapshot`. |
| **description** string | | The description for the Import Policy.
aliases: descr |
| **export\_policy** string | | The export policy that the `snapshot` is associated to. |
| **fail\_on\_decrypt** boolean | **Choices:*** no
* yes
| Determines if the APIC should fail the rollback if unable to decrypt secured data. The APIC defaults to `yes` when unset. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **import\_mode** string | **Choices:*** atomic
* best-effort
| Determines how the import should be handled by the APIC. The APIC defaults to `atomic` when unset. |
| **import\_policy** string | | The name of the Import Policy to use for config rollback. |
| **import\_type** string | **Choices:*** merge
* replace
| Determines how the current and snapshot configuration should be compared for replacement. The APIC defaults to `replace` when unset. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **snapshot** string / required | | The name of the snapshot to rollback to, or the base snapshot to use for comparison. The `aci_snapshot` module can be used to query the list of available snapshots. |
| **state** string | **Choices:*** preview
* **rollback** β
| Use `preview` for previewing the diff between two snapshots. Use `rollback` for reverting the configuration to a previous snapshot. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[cisco.aci.aci\_config\_snapshot](aci_config_snapshot_module#ansible-collections-cisco-aci-aci-config-snapshot-module)
The official documentation on the **cisco.aci.aci\_config\_snapshot** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **config:ImportP**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
---
- name: Create a Snapshot
cisco.aci.aci_config_snapshot:
host: apic
username: admin
password: SomeSecretPassword
export_policy: config_backup
state: present
delegate_to: localhost
- name: Query Existing Snapshots
cisco.aci.aci_config_snapshot:
host: apic
username: admin
password: SomeSecretPassword
export_policy: config_backup
state: query
delegate_to: localhost
- name: Compare Snapshot Files
cisco.aci.aci_config_rollback:
host: apic
username: admin
password: SomeSecretPassword
export_policy: config_backup
snapshot: run-2017-08-28T06-24-01
compare_export_policy: config_backup
compare_snapshot: run-2017-08-27T23-43-56
state: preview
delegate_to: localhost
- name: Rollback Configuration
cisco.aci.aci_config_rollback:
host: apic
username: admin
password: SomeSecretPassword
import_policy: rollback_config
export_policy: config_backup
snapshot: run-2017-08-28T06-24-01
state: rollback
delegate_to: localhost
- name: Rollback Configuration
cisco.aci.aci_config_rollback:
host: apic
username: admin
password: SomeSecretPassword
import_policy: rollback_config
export_policy: config_backup
snapshot: run-2017-08-28T06-24-01
description: Rollback 8-27 changes
import_mode: atomic
import_type: replace
fail_on_decrypt: yes
state: rollback
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **preview** string | when state is preview | A preview between two snapshots |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Jacob McGill (@jmcgill298)
| programming_docs |
ansible cisco.aci.aci_cloud_external_epg β Manage Cloud External EPG (cloud:ExtEPg) cisco.aci.aci\_cloud\_external\_epg β Manage Cloud External EPG (cloud:ExtEPg)
==============================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_cloud_external_epg`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Configures WAN router connectivity to the cloud infrastructure.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **ap** string | | The name of the cloud application profile.
aliases: app\_profile, app\_profile\_name |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | configuration item description.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name** string | | Name of Object cloud\_external\_epg.
aliases: cloud\_external\_epg, cloud\_external\_epg\_name, external\_epg, external\_epg\_name, extepg, extepg\_name |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **route\_reachability** string | **Choices:*** inter-site
* internet
* unspecified
| Route reachability for this EPG. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | The name of tenant. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
| **vrf** string | | The name of the VRF.
aliases: context, vrf\_name |
Notes
-----
Note
* More information about the internal APIC class **cloud:ExtEPg** from [the APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/).
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new cloud external EPG
cisco.aci.aci_cloud_external_epg:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenant1
ap: ap1
vrf: vrf1
description: Cloud External EPG description
name: ext_epg
route_reachability: internet
state: present
delegate_to: localhost
- name: Remove a cloud external EPG
cisco.aci.aci_cloud_external_epg:
host: apic
username: admin
password: SomeSecretPassword
validate_certs: no
tenant: tenant1
ap: ap1
name: ext_epg
state: absent
delegate_to: localhost
- name: Query a cloud external EPG
cisco.aci.aci_cloud_external_epg:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenant1
ap: ap1
name: ext_epg
state: query
delegate_to: localhost
- name: query all
cisco.aci.aci_cloud_external_epg:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenant1
ap: ap1
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'name\_alias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'name\_alias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Anvitha Jain (@anvitha-jain)
ansible cisco.aci.aci_filter β Manages top level filter objects (vz:Filter) cisco.aci.aci\_filter β Manages top level filter objects (vz:Filter)
====================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_filter`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manages top level filter objects on Cisco ACI fabrics.
* This modules does not manage filter entries, see [cisco.aci.aci\_filter\_entry](aci_filter_entry_module#ansible-collections-cisco-aci-aci-filter-entry-module) for this functionality.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the filter.
aliases: descr |
| **filter** string | | The name of the filter.
aliases: filter\_name, name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | The name of the tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `tenant` used must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module) module can be used for this.
See Also
--------
See also
[cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module)
The official documentation on the **cisco.aci.aci\_tenant** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **vz:Filter**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new filter to a tenant
cisco.aci.aci_filter:
host: apic
username: admin
password: SomeSecretPassword
filter: web_filter
description: Filter for web protocols
tenant: production
state: present
delegate_to: localhost
- name: Remove a filter for a tenant
cisco.aci.aci_filter:
host: apic
username: admin
password: SomeSecretPassword
filter: web_filter
tenant: production
state: absent
delegate_to: localhost
- name: Query a filter of a tenant
cisco.aci.aci_filter:
host: apic
username: admin
password: SomeSecretPassword
filter: web_filter
tenant: production
state: query
delegate_to: localhost
register: query_result
- name: Query all filters for a tenant
cisco.aci.aci_filter:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Dag Wieers (@dagwieers)
| programming_docs |
ansible cisco.aci.aci_contract_subject β Manage initial Contract Subjects (vz:Subj) cisco.aci.aci\_contract\_subject β Manage initial Contract Subjects (vz:Subj)
=============================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_contract_subject`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage initial Contract Subjects on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **consumer\_match** string | **Choices:*** all
* at\_least\_one
* at\_most\_one
* none
| The match criteria across consumers. The APIC defaults to `at_least_one` when unset during creation. |
| **contract** string | | The name of the Contract.
aliases: contract\_name |
| **description** string | | Description for the contract subject.
aliases: descr |
| **dscp** string | **Choices:*** AF11
* AF12
* AF13
* AF21
* AF22
* AF23
* AF31
* AF32
* AF33
* AF41
* AF42
* AF43
* CS0
* CS1
* CS2
* CS3
* CS4
* CS5
* CS6
* CS7
* EF
* VA
* unspecified
| The target DSCP. The APIC defaults to `unspecified` when unset during creation.
aliases: target |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **priority** string | **Choices:*** level1
* level2
* level3
* unspecified
| The QoS class. The APIC defaults to `unspecified` when unset during creation. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **provider\_match** string | **Choices:*** all
* at\_least\_one
* at\_most\_one
* none
| The match criteria across providers. The APIC defaults to `at_least_one` when unset during creation. |
| **reverse\_filter** boolean | **Choices:*** no
* yes
| Determines if the APIC should reverse the src and dst ports to allow the return traffic back, since ACI is stateless filter. The APIC defaults to `yes` when unset during creation. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **subject** string | | The contract subject name.
aliases: contract\_subject, name, subject\_name |
| **tenant** string | | The name of the tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `tenant` and `contract` used must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module) and [cisco.aci.aci\_contract](aci_contract_module#ansible-collections-cisco-aci-aci-contract-module) modules can be used for this.
See Also
--------
See also
[cisco.aci.aci\_contract](aci_contract_module#ansible-collections-cisco-aci-aci-contract-module)
The official documentation on the **cisco.aci.aci\_contract** module.
[cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module)
The official documentation on the **cisco.aci.aci\_tenant** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **vz:Subj**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new contract subject
cisco.aci.aci_contract_subject:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
subject: default
description: test
reverse_filter: yes
priority: level1
dscp: unspecified
state: present
register: query_result
- name: Remove a contract subject
cisco.aci.aci_contract_subject:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
subject: default
state: absent
delegate_to: localhost
- name: Query a contract subject
cisco.aci.aci_contract_subject:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
subject: default
state: query
delegate_to: localhost
register: query_result
- name: Query all contract subjects
cisco.aci.aci_contract_subject:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Swetha Chunduri (@schunduri)
ansible cisco.aci.aci_cloud_epg_selector β Manage Cloud Endpoint Selector (cloud:EPSelector) cisco.aci.aci\_cloud\_epg\_selector β Manage Cloud Endpoint Selector (cloud:EPSelector)
=======================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_cloud_epg_selector`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Cloud Endpoint Selector on Cisco Cloud ACI
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **ap** string / required | | The name of the cloud application profile. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description of the Cloud Endpoint Selector. |
| **epg** string / required | | The name of the cloud EPG. |
| **expressions** list / elements=dictionary | | Expressions associated to this selector. |
| | **key** string / required | | The key of the expression. The key is custom or is one of region, zone and ip The key can be zone only when the site is AWS. |
| | **operator** string / required | **Choices:*** not\_in
* in
* equals
* not\_equals
* has\_key
* does\_not\_have\_key
| The operator associated to the expression. Operator `has_key` or `does_not_have_key` is only available for key custom or zone |
| | **value** string | | The value associated to the expression. If the operator is `in` or `not_in`, the value should be a comma separated string. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name** string | | The name of the Cloud Endpoint selector.
aliases: selector, selector\_name |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string / required | | The name of the existing tenant. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* More information about the internal APIC class **cloud:EPSelector** from [the APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/).
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create aci cloud epg selector
cisco.aci.aci_cloud_epg_selector:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
ap: apName
epg: epgName
description: cloud epg selector
name: selectorName
expressions:
- key: ip
operator: in
value: 10.10.10.1
state: present
delegate_to: localhost
- name: Remove cloud epg selector
cisco.aci.aci_cloud_epg_selector:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
ap: apName
epg: epgName
name: selectorName
state: absent
delegate_to: localhost
- name: query all
cisco.aci.aci_cloud_epg:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
ap: apName
epg: epgName
state: query
delegate_to: localhost
- name: query a specific cloud epg selector
cisco.aci.aci_cloud_epg:
host: apic
username: admin
password: SomeSecretPassword
tenant: tenantName
ap: apName
epg: epgName
name: selectorName
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Cindy Zhao (@cizhao)
| programming_docs |
ansible cisco.aci.aci_l3out_interface β Manage Layer 3 Outside (L3Out) interfaces (l3ext:RsPathL3OutAtt) cisco.aci.aci\_l3out\_interface β Manage Layer 3 Outside (L3Out) interfaces (l3ext:RsPathL3OutAtt)
==================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_l3out_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage L3Out interfaces on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **addr** string | | IP address. |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **encap** string | | encapsulation on the interface (e.g. "vlan-500") |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **interface\_profile** string / required | | Name of the interface profile.
aliases: interface\_profile\_name, logical\_interface |
| **interface\_type** string | **Choices:*** l3-port
* sub-interface
* ext-svi
| Type of interface to build. |
| **l3out** string / required | | Name of an existing L3Out.
aliases: l3out\_name |
| **mode** string | **Choices:*** regular
* native
* untagged
| Interface mode, only used if instance\_type is ext-svi |
| **node\_id** string / required | | Node to build the interface on for Port-channels and single ports. Hyphen separated pair of nodes (e.g. "201-202") for vPCs. |
| **node\_profile** string / required | | Name of the node profile.
aliases: node\_profile\_name, logical\_node |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **path\_ep** string / required | | Path to interface Interface Policy Group name for Port-channels and vPCs Port number for single ports (e.g. "eth1/12") |
| **pod\_id** string / required | | Pod to build the interface on. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string / required | | Name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
M(aci\_l3out)
The official documentation on the **aci\_l3out** module.
M(aci\_l3out\_logical\_node\_profile)
The official documentation on the **aci\_l3out\_logical\_node\_profile** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **l3ext:RsPathL3OutAtt**
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new routed interface
cisco.aci.aci_l3out_interface:
host: apic
username: admin
password: SomeSecretPassword
tenant: my_tenant
l3out: my_l3out
node_profile: my_node_profile
interface_profile: my_interface_profile
pod_id: 1
node_id: 201
path_ep: eth1/12
interface_type: l3-port
addr: 192.168.10.1/27
state: present
delegate_to: localhost
- name: Add a new SVI vPC
cisco.aci.aci_l3out_interface:
host: apic
username: admin
password: SomeSecretPassword
tenant: my_tenant
l3out: my_l3out
node_profile: my_node_profile
interface_profile: my_interface_profile
pod_id: 1
node_id: 201-202
path_ep: my_vpc_ipg
interface_type: ext-svi
encap: vlan-800
mode: regular
state: present
delegate_to: localhost
- name: Delete an interface
cisco.aci.aci_l3out_interface:
host: apic
username: admin
password: SomeSecretPassword
tenant: my_tenant
l3out: my_l3out
node_profile: my_node_profile
interface_profile: my_interface_profile
pod_id: 1
node_id: 201
path_ep: eth1/12
state: absent
delegate_to: localhost
- name: Query an interface
cisco.aci.aci_l3out_interface:
host: apic
username: admin
password: SomeSecretPassword
tenant: my_tenant
l3out: my_l3out
node_profile: my_node_profile
interface_profile: my_interface_profile
pod_id: 1
node_id: 201
path_ep: eth1/12
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Tim Cragg (@timcragg)
ansible cisco.aci.aci_interface_policy_port_security β Manage port security (l2:PortSecurityPol) cisco.aci.aci\_interface\_policy\_port\_security β Manage port security (l2:PortSecurityPol)
============================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_interface_policy_port_security`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage port security on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | The description for the contract.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **max\_end\_points** integer | | Maximum number of end points. Accepted values range between `0` and `12000`. The APIC defaults to `0` when unset during creation. |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **port\_security** string | | The name of the port security.
aliases: name |
| **port\_security\_timeout** integer | | The delay time in seconds before MAC learning is re-enabled Accepted values range between `60` and `3600`
The APIC defaults to `60` when unset during creation |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **l2:PortSecurityPol**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a port security interface policy
cisco.aci.aci_interface_policy_port_security:
host: '{{ inventory_hostname }}'
username: '{{ username }}'
password: '{{ password }}'
port_security: '{{ port_security }}'
description: '{{ descr }}'
max_end_points: '{{ max_end_points }}'
port_security_timeout: '{{ port_security_timeout }}'
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Dag Wieers (@dagwieers)
| programming_docs |
ansible cisco.aci.aci_interface_policy_leaf_profile β Manage fabric interface policy leaf profiles (infra:AccPortP) cisco.aci.aci\_interface\_policy\_leaf\_profile β Manage fabric interface policy leaf profiles (infra:AccPortP)
===============================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_interface_policy_leaf_profile`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage fabric interface policy leaf profiles on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the Fabric access policy leaf interface profile.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **interface\_profile** string | | The name of the Fabric access policy leaf interface profile.
aliases: name, leaf\_interface\_profile\_name, leaf\_interface\_profile, interface\_profile\_name |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **type** string | **Choices:*** fex
* **leaf** β
| The type of profile to be created. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **infra:AccPortP**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new leaf_interface_profile
cisco.aci.aci_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname
description: leafintprfname description
state: present
delegate_to: localhost
- name: Add a new leaf_interface_profile of type fex
cisco.aci.aci_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname_fex
type: fex
description: leafintprfname description
state: present
delegate_to: localhost
- name: Remove a leaf_interface_profile
cisco.aci.aci_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname
state: absent
delegate_to: localhost
- name: Remove a leaf_interface_profile of type fex
cisco.aci.aci_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname_fex
type: fex
state: absent
delegate_to: localhost
- name: Query a leaf_interface_profile
cisco.aci.aci_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname
state: query
delegate_to: localhost
register: query_result
- name: Query a leaf_interface_profile of type fex
cisco.aci.aci_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
interface_profile: leafintprfname_fex
type: fex
state: query
delegate_to: localhost
register: query_result
- name: Query all leaf_interface_profiles
cisco.aci.aci_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
- name: Query all leaf_interface_profiles of type fex
cisco.aci.aci_interface_policy_leaf_profile:
host: apic
username: admin
password: SomeSecretPassword
type: fex
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Bruno Calogero (@brunocalogero)
* Shreyas Srish (@shrsr)
ansible cisco.aci.aci_access_sub_port_block_to_access_port β Manage sub port blocks of Fabric interface policy leaf profile interface selectors (infra:HPortS, infra:SubPortBlk) cisco.aci.aci\_access\_sub\_port\_block\_to\_access\_port β Manage sub port blocks of Fabric interface policy leaf profile interface selectors (infra:HPortS, infra:SubPortBlk)
===============================================================================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_access_sub_port_block_to_access_port`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage sub port blocks of Fabric interface policy leaf profile interface selectors on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_port\_selector** string | | The name of the Fabric access policy leaf interface profile access port selector.
aliases: name, access\_port\_selector\_name |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **from\_card** string | | The beginning (from-range) of the card range block for the leaf access port block.
aliases: from\_card\_range |
| **from\_port** string | | The beginning (from-range) of the port range block for the leaf access port block.
aliases: from, fromPort, from\_port\_range |
| **from\_sub\_port** string | | The beginning (from-range) of the sub port range block for the leaf access port block.
aliases: fromSubPort, from\_sub\_port\_range |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **leaf\_interface\_profile** string | | The name of the Fabric access policy leaf interface profile.
aliases: leaf\_interface\_profile\_name |
| **leaf\_port\_blk** string | | The name of the Fabric access policy leaf interface profile access port block.
aliases: leaf\_port\_blk\_name |
| **leaf\_port\_blk\_description** string | | The description to assign to the `leaf_port_blk`. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **to\_card** string | | The end (to-range) of the card range block for the leaf access port block.
aliases: to\_card\_range |
| **to\_port** string | | The end (to-range) of the port range block for the leaf access port block.
aliases: to, toPort, to\_port\_range |
| **to\_sub\_port** string | | The end (to-range) of the sub port range block for the leaf access port block.
aliases: toSubPort, to\_sub\_port\_range |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes **infra:HPortS** and **infra:SubPortBlk**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Associate an access sub port block (single port) to an interface selector
cisco.aci.aci_access_sub_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
leaf_interface_profile: leafintprfname
access_port_selector: accessportselectorname
leaf_port_blk: leafportblkname
from_port: 13
to_port: 13
from_sub_port: 1
to_sub_port: 1
state: present
delegate_to: localhost
- name: Associate an access sub port block (port range) to an interface selector
cisco.aci.aci_access_sub_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
leaf_interface_profile: leafintprfname
access_port_selector: accessportselectorname
leaf_port_blk: leafportblkname
from_port: 13
to_port: 13
from_sub_port: 1
to_sub_port: 3
state: present
delegate_to: localhost
- name: Remove an access sub port block from an interface selector
cisco.aci.aci_access_sub_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
leaf_interface_profile: leafintprfname
access_port_selector: accessportselectorname
leaf_port_blk: leafportblkname
from_port: 13
to_port: 13
from_sub_port: 1
to_sub_port: 1
state: absent
delegate_to: localhost
- name: Query Specific access sub port block under given access port selector
cisco.aci.aci_access_sub_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
leaf_interface_profile: leafintprfname
access_port_selector: accessportselectorname
leaf_port_blk: leafportblkname
state: query
delegate_to: localhost
register: query_result
- name: Query all access sub port blocks under given leaf interface profile
cisco.aci.aci_access_sub_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
leaf_interface_profile: leafintprfname
state: query
delegate_to: localhost
register: query_result
- name: Query all access sub port blocks in the fabric
cisco.aci.aci_access_sub_port_block_to_access_port:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Simon Metzger (@smnmtzgr)
| programming_docs |
ansible cisco.aci.aci_l3out β Manage Layer 3 Outside (L3Out) objects (l3ext:Out) cisco.aci.aci\_l3out β Manage Layer 3 Outside (L3Out) objects (l3ext:Out)
=========================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_l3out`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Layer 3 Outside (L3Out) on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **asn** integer | | The AS number for the L3Out. Only applicable when using 'eigrp' as the l3protocol
aliases: as\_number |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the L3Out.
aliases: descr |
| **domain** string | | Name of the external L3 domain being associated with the L3Out.
aliases: ext\_routed\_domain\_name, routed\_domain |
| **dscp** string | **Choices:*** AF11
* AF12
* AF13
* AF21
* AF22
* AF23
* AF31
* AF32
* AF33
* AF41
* AF42
* AF43
* CS0
* CS1
* CS2
* CS3
* CS4
* CS5
* CS6
* CS7
* EF
* VA
* unspecified
| The target Differentiated Service (DSCP) value. The APIC defaults to `unspecified` when unset during creation.
aliases: target |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **l3out** string | | Name of L3Out being created.
aliases: l3out\_name, name |
| **l3protocol** list / elements=string | **Choices:*** bgp
* eigrp
* ospf
* pim
* static
| Routing protocol for the L3Out |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **route\_control** list / elements=string | **Choices:*** export
* import
| Route Control enforcement direction. The only allowed values are export or import,export.
aliases: route\_control\_enforcement |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | Name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
| **vrf** string | | Name of the VRF being associated with the L3Out.
aliases: vrf\_name |
Notes
-----
Note
* The `tenant` and `domain` and `vrf` used must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module) and [cisco.aci.aci\_domain](aci_domain_module#ansible-collections-cisco-aci-aci-domain-module) and [cisco.aci.aci\_vrf](aci_vrf_module#ansible-collections-cisco-aci-aci-vrf-module) modules can be used for this.
See Also
--------
See also
[cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module)
The official documentation on the **cisco.aci.aci\_tenant** module.
[cisco.aci.aci\_domain](aci_domain_module#ansible-collections-cisco-aci-aci-domain-module)
The official documentation on the **cisco.aci.aci\_domain** module.
[cisco.aci.aci\_vrf](aci_vrf_module#ansible-collections-cisco-aci-aci-vrf-module)
The official documentation on the **cisco.aci.aci\_vrf** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **l3ext:Out**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new L3Out
cisco.aci.aci_l3out:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
name: prod_l3out
description: L3Out for Production tenant
domain: l3dom_prod
vrf: prod
l3protocol: ospf
state: present
delegate_to: localhost
- name: Delete L3Out
cisco.aci.aci_l3out:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
name: prod_l3out
state: absent
delegate_to: localhost
- name: Query L3Out information
cisco.aci.aci_l3out:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
name: prod_l3out
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Rostyslav Davydenko (@rost-d)
ansible cisco.aci.aci_maintenance_group β This creates an ACI maintenance group cisco.aci.aci\_maintenance\_group β This creates an ACI maintenance group
=========================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_maintenance_group`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This modules creates an ACI maintenance group
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **group** string | | This is the name of the group |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **policy** string | | This is the name of the policy that was created using aci\_maintenance\_policy |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* a maintenance policy (aci\_maintenance\_policy must be created prior to creating an aci maintenance group
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: maintenance group
cisco.aci.aci_maintenance_group:
host: "{{ inventory_hostname }}"
username: "{{ user }}"
password: "{{ pass }}"
validate_certs: no
group: maintenancegrp1
policy: maintenancePol1
state: present
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Steven Gerhart (@sgerhart)
| programming_docs |
ansible cisco.aci.aci_fabric_switch_block β Manage switch blocks (fabric:NodeBlk). cisco.aci.aci\_fabric\_switch\_block β Manage switch blocks (fabric:NodeBlk).
=============================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_fabric_switch_block`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage fabric node blocks within switch associations (fabric:SpineS and fabric:LeafS) contained within fabric switch profiles (fabric:SpineP and fabric:LeafP)
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **association** string | | Name of an existing switch association
aliases: association\_name, switch\_association |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description of the Node Block
aliases: descr |
| **from\_node** integer | | First Node ID of the block
aliases: from, from\_ |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name** string | | Name of the block
aliases: block\_name |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **profile** string | | Name of an existing fabric spine or leaf switch profile
aliases: profile\_name, switch\_profile |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **switch\_type** string / required | **Choices:*** leaf
* spine
| Type of switch profile, leaf or spine |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **to\_node** integer | | Last Node ID of the block
aliases: to, to\_ |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **fabricNodeBlk**
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create a spine switch association block
cisco.aci.aci_fabric_switch_block:
host: apic
username: admin
password: SomeSecretPassword
switch_type: spine
profile: my_spine_profile
association: my_spine_switch_assoc
name: my_spine_block
from_node: 101
to_node: 101
state: present
delegate_to: localhost
- name: Remove a spine switch profile association
cisco.aci.aci_fabric_switch_block:
host: apic
username: admin
password: SomeSecretPassword
switch_type: spine
profile: my_spine_profile
association: my_spine_switch_assoc
name: my_spine_block
state: absent
delegate_to: localhost
- name: Query a spine profile association
cisco.aci.aci_fabric_switch_block:
host: apic
username: admin
password: SomeSecretPassword
switch_type: spine
profile: my_spine_profile
association: my_spine_switch_assoc
name: my_spine_block
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Tim Cragg (@timcragg)
ansible cisco.aci.aci_snmp_community_policy β Manage SNMP community policies (snmp:CommunityP). cisco.aci.aci\_snmp\_community\_policy β Manage SNMP community policies (snmp:CommunityP).
==========================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_snmp_community_policy`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage SNMP community policies
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **community** string | | Name of the SNMP community policy |
| **description** string | | Description of the SNMP policy |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **policy** string | | Name of an existing SNMP policy
aliases: snmp\_policy, snmp\_policy\_name |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **snmp:CommunityP**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create an SNMP community policy
cisco.aci.aci_snmp_community_policy:
host: apic
username: admin
password: SomeSecretPassword
policy: my_snmp_policy
community: my_snmp_community
state: present
delegate_to: localhost
- name: Remove an SNMP community policy
cisco.aci.aci_snmp_community_policy:
host: apic
username: admin
password: SomeSecretPassword
policy: my_snmp_policy
community: my_snmp_community
state: absent
delegate_to: localhost
- name: Query an SNMP community policy
cisco.aci.aci_snmp_community_policy:
host: apic
username: admin
password: SomeSecretPassword
policy: my_snmp_policy
community: my_snmp_community
state: query
delegate_to: localhost
register: query_result
- name: Query all SNMP community policies
cisco.aci.aci_snmp_community_policy:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Tim Cragg (@timcragg)
| programming_docs |
ansible cisco.aci.aci_l3out_extepg β Manage External Network Instance Profile (ExtEpg) objects (l3extInstP:instP) cisco.aci.aci\_l3out\_extepg β Manage External Network Instance Profile (ExtEpg) objects (l3extInstP:instP)
===========================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_l3out_extepg`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage External Network Instance Profile (ExtEpg) objects (l3extInstP:instP)
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the ExtEpg.
aliases: descr |
| **dscp** string | **Choices:*** AF11
* AF12
* AF13
* AF21
* AF22
* AF23
* AF31
* AF32
* AF33
* AF41
* AF42
* AF43
* CS0
* CS1
* CS2
* CS3
* CS4
* CS5
* CS6
* CS7
* EF
* VA
* unspecified
| The target Differentiated Service (DSCP) value. The APIC defaults to `unspecified` when unset during creation.
aliases: target |
| **extepg** string | | Name of ExtEpg being created.
aliases: extepg\_name, name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **l3out** string | | Name of an existing L3Out.
aliases: l3out\_name |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **preferred\_group** boolean | **Choices:*** no
* yes
| Whether ot not the EPG is part of the Preferred Group and can communicate without contracts. This is very convenient for migration scenarios, or when ACI is used for network automation but not for policy. The APIC defaults to `no` when unset during creation. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | Name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `tenant` and `domain` and `vrf` used must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module) and [cisco.aci.aci\_domain](aci_domain_module#ansible-collections-cisco-aci-aci-domain-module) and [cisco.aci.aci\_vrf](aci_vrf_module#ansible-collections-cisco-aci-aci-vrf-module) modules can be used for this.
See Also
--------
See also
[cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module)
The official documentation on the **cisco.aci.aci\_tenant** module.
[cisco.aci.aci\_domain](aci_domain_module#ansible-collections-cisco-aci-aci-domain-module)
The official documentation on the **cisco.aci.aci\_domain** module.
[cisco.aci.aci\_vrf](aci_vrf_module#ansible-collections-cisco-aci-aci-vrf-module)
The official documentation on the **cisco.aci.aci\_vrf** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **l3ext:Out**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new ExtEpg
cisco.aci.aci_l3out_extepg:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
l3out: prod_l3out
name: prod_extepg
description: ExtEpg for Production L3Out
state: present
delegate_to: localhost
- name: Delete ExtEpg
cisco.aci.aci_extepg:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
l3out: prod_l3out
name: prod_extepg
state: absent
delegate_to: localhost
- name: Query ExtEpg information
cisco.aci.aci_l3out_extepg:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
l3out: prod_l3out
name: prod_extepg
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Rostyslav Davydenko (@rost-d)
ansible cisco.aci.aci_cloud_bgp_asn β Manage Cloud APIC BGP Autonomous System Profile (cloud:BgpAsP) cisco.aci.aci\_cloud\_bgp\_asn β Manage Cloud APIC BGP Autonomous System Profile (cloud:BgpAsP)
===============================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_cloud_bgp_asn`.
New in version 2.1.0: of cisco.aci
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage the BGP Autonomous System Profile for Cloud APIC
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **asn** string | | The BGP Autonomous System Number. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description of the BGP Autonomous System Profile.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name** string | | object name
aliases: autonomous\_system\_profile, autonomous\_system\_profile\_name |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* More information about the internal APIC class **cloud:BgpAsP** from [the APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/).
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new cloud BGP ASN
cisco.aci.aci_cloud_bgp_asn:
host: apic
username: admin
password: SomeSecretPassword
asn: 64601
description: ASN description
name: ASN_1
state: present
delegate_to: localhost
- name: Remove a cloud BGP ASN
cisco.aci.aci_cloud_bgp_asn:
host: apic
username: admin
password: SomeSecretPassword
validate_certs: no
state: absent
delegate_to: localhost
- name: Query a cloud BGP ASN
cisco.aci.aci_cloud_bgp_asn:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Anvitha Jain (@anvitha-jain)
| programming_docs |
ansible cisco.aci.aci_domain_to_vlan_pool β Bind Domain to VLAN Pools (infra:RsVlanNs) cisco.aci.aci\_domain\_to\_vlan\_pool β Bind Domain to VLAN Pools (infra:RsVlanNs)
==================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_domain_to_vlan_pool`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Bind Domain to VLAN Pools on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **domain** string | | Name of the domain being associated with the VLAN Pool.
aliases: domain\_name, domain\_profile |
| **domain\_type** string / required | **Choices:*** fc
* l2dom
* l3dom
* phys
* vmm
| Determines if the Domain is physical (phys) or virtual (vmm). |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **pool** string | | The name of the pool.
aliases: pool\_name, vlan\_pool |
| **pool\_allocation\_mode** string / required | **Choices:*** dynamic
* static
| The method used for allocating VLANs to resources.
aliases: allocation\_mode, mode |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
| **vm\_provider** string | **Choices:*** cloudfoundry
* kubernetes
* microsoft
* openshift
* openstack
* redhat
* vmware
| The VM platform for VMM Domains. Support for Kubernetes was added in ACI v3.0. Support for CloudFoundry, OpenShift and Red Hat was added in ACI v3.1. |
Notes
-----
Note
* The `domain` and `vlan_pool` parameters should exist before using this module. The [cisco.aci.aci\_domain](aci_domain_module#ansible-collections-cisco-aci-aci-domain-module) and [cisco.aci.aci\_vlan\_pool](aci_vlan_pool_module#ansible-collections-cisco-aci-aci-vlan-pool-module) can be used for these.
See Also
--------
See also
[cisco.aci.aci\_domain](aci_domain_module#ansible-collections-cisco-aci-aci-domain-module)
The official documentation on the **cisco.aci.aci\_domain** module.
[cisco.aci.aci\_vlan\_pool](aci_vlan_pool_module#ansible-collections-cisco-aci-aci-vlan-pool-module)
The official documentation on the **cisco.aci.aci\_vlan\_pool** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **infra:RsVlanNs**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Bind a VMM domain to VLAN pool
cisco.aci.aci_domain_to_vlan_pool:
host: apic
username: admin
password: SomeSecretPassword
domain: vmw_dom
domain_type: vmm
pool: vmw_pool
pool_allocation_mode: dynamic
vm_provider: vmware
state: present
delegate_to: localhost
- name: Remove a VMM domain to VLAN pool binding
cisco.aci.aci_domain_to_vlan_pool:
host: apic
username: admin
password: SomeSecretPassword
domain: vmw_dom
domain_type: vmm
pool: vmw_pool
pool_allocation_mode: dynamic
vm_provider: vmware
state: absent
delegate_to: localhost
- name: Bind a physical domain to VLAN pool
cisco.aci.aci_domain_to_vlan_pool:
host: apic
username: admin
password: SomeSecretPassword
domain: phys_dom
domain_type: phys
pool: phys_pool
pool_allocation_mode: static
state: present
delegate_to: localhost
- name: Bind a physical domain to VLAN pool
cisco.aci.aci_domain_to_vlan_pool:
host: apic
username: admin
password: SomeSecretPassword
domain: phys_dom
domain_type: phys
pool: phys_pool
pool_allocation_mode: static
state: absent
delegate_to: localhost
- name: Query an domain to VLAN pool binding
cisco.aci.aci_domain_to_vlan_pool:
host: apic
username: admin
password: SomeSecretPassword
domain: phys_dom
domain_type: phys
pool: phys_pool
pool_allocation_mode: static
state: query
delegate_to: localhost
register: query_result
- name: Query all domain to VLAN pool bindings
cisco.aci.aci_domain_to_vlan_pool:
host: apic
username: admin
password: SomeSecretPassword
domain_type: phys
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Dag Wieers (@dagwieers)
ansible cisco.aci.aci_l3out_logical_node_profile β Manage Layer 3 Outside (L3Out) logical node profiles (l3extLNodeP:lnodep) cisco.aci.aci\_l3out\_logical\_node\_profile β Manage Layer 3 Outside (L3Out) logical node profiles (l3extLNodeP:lnodep)
========================================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_l3out_logical_node_profile`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Layer 3 Outside (L3Out) logical node profiles on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the node profile.
aliases: descr |
| **dscp** string | **Choices:*** AF11
* AF12
* AF13
* AF21
* AF22
* AF23
* AF31
* AF32
* AF33
* AF41
* AF42
* AF43
* CS0
* CS1
* CS2
* CS3
* CS4
* CS5
* CS6
* CS7
* EF
* VA
* unspecified
| The target Differentiated Service (DSCP) value. The APIC defaults to `unspecified` when unset during creation.
aliases: target\_dscp |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **l3out** string | | Name of an existing L3Out.
aliases: l3out\_name |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **node\_profile** string | | Name of the node profile.
aliases: node\_profile\_name, name, logical\_node |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | Name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
M(aci\_l3out)
The official documentation on the **aci\_l3out** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC classes **vmm:DomP**
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new node profile
cisco.aci.aci_l3out_logical_node_profile:
host: apic
username: admin
password: SomeSecretPassword
node_profile: my_node_profile
description: node profile for my_l3out
l3out: my_l3out
tenant: my_tenant
dscp: CS0
state: present
delegate_to: localhost
- name: Delete a node profile
cisco.aci.aci_l3out_logical_node_profile:
host: apic
username: admin
password: SomeSecretPassword
node_profile: my_node_profile
l3out: my_l3out
tenant: my_tenant
state: absent
delegate_to: localhost
- name: Query a node profile
cisco.aci.aci_l3out_logical_node_profile:
host: apic
username: admin
password: SomeSecretPassword
node_profile: my_node_profile
l3out: my_l3out
tenant: my_tenant
state: query
delegate_to: localhost
register: query_result
- name: Query all node profile for L3out
cisco.aci.aci_l3out_logical_node_profile:
host: apic
username: admin
password: SomeSecretPassword
l3out: my_l3out
tenant: my_tenant
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Jason Juenger (@jasonjuenger)
| programming_docs |
ansible cisco.aci.aci_tenant_ep_retention_policy β Manage End Point (EP) retention protocol policies (fv:EpRetPol) cisco.aci.aci\_tenant\_ep\_retention\_policy β Manage End Point (EP) retention protocol policies (fv:EpRetPol)
==============================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_tenant_ep_retention_policy`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage End Point (EP) retention protocol policies on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **bounce\_age** integer | | Bounce entry aging interval in seconds. Accepted values range between `150` and `65535`; 0 is used for infinite. The APIC defaults to `630` when unset during creation. |
| **bounce\_trigger** string | **Choices:*** coop
* flood
| Determines if the bounce entries are installed by RARP Flood or COOP Protocol. The APIC defaults to `coop` when unset during creation. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the End point retention policy.
aliases: descr |
| **epr\_policy** string | | The name of the end point retention policy.
aliases: epr\_name, name |
| **hold\_interval** integer | | Hold interval in seconds. Accepted values range between `5` and `65535`. The APIC defaults to `300` when unset during creation. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **local\_ep\_interval** integer | | Local end point aging interval in seconds. Accepted values range between `120` and `65535`; 0 is used for infinite. The APIC defaults to `900` when unset during creation. |
| **move\_frequency** integer | | Move frequency per second. Accepted values range between `0` and `65535`; 0 is used for none. The APIC defaults to `256` when unset during creation. |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **remote\_ep\_interval** integer | | Remote end point aging interval in seconds. Accepted values range between `120` and `65535`; 0 is used for infinite. The APIC defaults to `300` when unset during creation. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | The name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `tenant` used must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module) module can be used for this.
See Also
--------
See also
[cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module)
The official documentation on the **cisco.aci.aci\_tenant** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **fv:EpRetPol**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new EPR policy
cisco.aci.aci_tenant_ep_retention_policy:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
epr_policy: EPRPol1
bounce_age: 630
hold_interval: 300
local_ep_interval: 900
remote_ep_interval: 300
move_frequency: 256
description: test
state: present
delegate_to: localhost
- name: Remove an EPR policy
cisco.aci.aci_tenant_ep_retention_policy:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
epr_policy: EPRPol1
state: absent
delegate_to: localhost
- name: Query an EPR policy
cisco.aci.aci_tenant_ep_retention_policy:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
epr_policy: EPRPol1
state: query
delegate_to: localhost
register: query_result
- name: Query all EPR policies
cisco.aci.aci_tenant_ep_retention_policy:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Swetha Chunduri (@schunduri)
ansible cisco.aci.aci_bd_subnet β Manage Subnets (fv:Subnet) cisco.aci.aci\_bd\_subnet β Manage Subnets (fv:Subnet)
======================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_bd_subnet`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Subnets on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **bd** string | | The name of the Bridge Domain.
aliases: bd\_name |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | The description for the Subnet.
aliases: descr |
| **enable\_vip** boolean | **Choices:*** no
* yes
| Determines if the Subnet should be treated as a VIP; used when the BD is extended to multiple sites. The APIC defaults to `no` when unset during creation. |
| **gateway** string | | The IPv4 or IPv6 gateway address for the Subnet.
aliases: gateway\_ip |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **mask** integer | | The subnet mask for the Subnet. This is the number associated with CIDR notation. For IPv4 addresses, accepted values range between `0` and `32`. For IPv6 addresses, accepted Values range between `0` and `128`.
aliases: subnet\_mask |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **nd\_prefix\_policy** string | | The IPv6 Neighbor Discovery Prefix Policy to associate with the Subnet. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **preferred** boolean | **Choices:*** no
* yes
| Determines if the Subnet is preferred over all available Subnets. Only one Subnet per Address Family (IPv4/IPv6). can be preferred in the Bridge Domain. The APIC defaults to `no` when unset during creation. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **route\_profile** string | | The Route Profile to the associate with the Subnet. |
| **route\_profile\_l3\_out** string | | The L3 Out that contains the associated Route Profile. |
| **scope** list / elements=string | **Choices:*** private
* public
* shared
| Determines the scope of the Subnet. The `private` option only allows communication with hosts in the same VRF. The `public` option allows the Subnet to be advertised outside of the ACI Fabric, and allows communication with hosts in other VRFs. The shared option limits communication to hosts in either the same VRF or the shared VRF. The value is a list of options, `private` and `public` are mutually exclusive, but both can be used with `shared`. The APIC defaults to `private` when unset during creation. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **subnet\_control** string | **Choices:*** nd\_ra
* no\_gw
* querier\_ip
* unspecified
| Determines the Subnet's Control State. The `querier_ip` option is used to treat the gateway\_ip as an IGMP querier source IP. The `nd_ra` option is used to treat the gateway\_ip address as a Neighbor Discovery Router Advertisement Prefix. The `no_gw` option is used to remove default gateway functionality from the gateway address. The APIC defaults to `nd_ra` when unset during creation. |
| **subnet\_name** string | | The name of the Subnet.
aliases: name |
| **tenant** string | | The name of the Tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `gateway` parameter is the root key used to access the Subnet (not name), so the `gateway` is required when the state is `absent` or `present`.
* The `tenant` and `bd` used must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module) module and [cisco.aci.aci\_bd](aci_bd_module#ansible-collections-cisco-aci-aci-bd-module) can be used for these.
See Also
--------
See also
[cisco.aci.aci\_bd](aci_bd_module#ansible-collections-cisco-aci-aci-bd-module)
The official documentation on the **cisco.aci.aci\_bd** module.
[cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module)
The official documentation on the **cisco.aci.aci\_tenant** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **fv:Subnet**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Create a tenant
cisco.aci.aci_tenant:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
state: present
delegate_to: localhost
- name: Create a bridge domain
cisco.aci.aci_bd:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
bd: database
state: present
delegate_to: localhost
- name: Create a subnet
cisco.aci.aci_bd_subnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
bd: database
gateway: 10.1.1.1
mask: 24
state: present
delegate_to: localhost
- name: Create a subnet with options
cisco.aci.aci_bd_subnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
bd: database
subnet_name: sql
gateway: 10.1.2.1
mask: 23
description: SQL Servers
scope: public
route_profile_l3_out: corp
route_profile: corp_route_profile
state: present
delegate_to: localhost
- name: Update a subnets scope to private and shared
cisco.aci.aci_bd_subnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
bd: database
gateway: 10.1.1.1
mask: 24
scope: [private, shared]
state: present
delegate_to: localhost
- name: Get all subnets
cisco.aci.aci_bd_subnet:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
- name: Get all subnets of specific gateway in specified tenant
cisco.aci.aci_bd_subnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
gateway: 10.1.1.1
mask: 24
state: query
delegate_to: localhost
register: query_result
- name: Get specific subnet
cisco.aci.aci_bd_subnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
bd: database
gateway: 10.1.1.1
mask: 24
state: query
delegate_to: localhost
register: query_result
- name: Delete a subnet
cisco.aci.aci_bd_subnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
bd: database
gateway: 10.1.1.1
mask: 24
state: absent
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Jacob McGill (@jmcgill298)
| programming_docs |
ansible cisco.aci.aci_l2out β Manage Layer2 Out (L2Out) objects. cisco.aci.aci\_l2out β Manage Layer2 Out (L2Out) objects.
=========================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_l2out`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Layer2 Out configuration on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **bd** string | | Name of the Bridge domain which is associted with the L2Out. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the L2Out. |
| **domain** string | | Name of the external L2 Domain that is being associated with L2Out. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **l2out** string | | The name of outer layer2.
aliases: name |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string | | Name of an existing tenant. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
| **vlan** integer | | The VLAN which is being associated with the L2Out. |
Notes
-----
Note
* The `tenant` must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module) modules can be used for this.
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **fvTenant**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new L2Out
cisco.aci.aci_l2out:
host: apic
username: admin
password: SomeSecretePassword
tenant: Auto-Demo
l2out: l2out
description: via Ansible
bd: bd1
domain: l2Dom
vlan: 3200
state: present
delegate_to: localhost
- name: Remove an L2Out
cisco.aci.aci_l2out:
host: apic
username: admin
password: SomeSecretePassword
tenant: Auto-Demo
l2out: l2out
state: absent
delegate_to: localhost
- name: Query an L2Out
cisco.aci.aci_l2out:
host: apic
username: admin
password: SomeSecretePassword
tenant: Auto-Demo
l2out: l2out
state: query
delegate_to: localhost
register: query_result
- name: Query all L2Outs in a specific tenant
cisco.aci.aci_l2out:
host: apic
username: admin
password: SomeSecretePassword
tenant: Auto-Demo
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class "/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Sudhakar Shet Kudtarkar (@kudtarkar1)
* Shreyas Srish (@shrsr)
ansible cisco.aci.aci_node_mgmt_epg β In band or Out of band management EPGs cisco.aci.aci\_node\_mgmt\_epg β In band or Out of band management EPGs
=======================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_node_mgmt_epg`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Cisco ACI Fabric Node EPGs
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **bd** string | | The in-band bridge domain which is used when type is in\_band |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **encap** string | | The in-band access encapsulation which is used when type is in\_band |
| **epg** string | | The name of the end point group
aliases: name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **type** string / required | **Choices:*** in\_band
* out\_of\_band
| type of management interface |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add in band mgmt epg
cisco.aci.aci_node_mgmt_epg:
host: "Host IP"
username: admin
password: SomeSecretePassword
epg: default
type: in_band
encap: vlan-1
bd: bd1
state: present
delegate_to: localhost
- name: Add out of band mgmt epg
cisco.aci.aci_node_mgmt_epg:
host: "Host IP"
username: admin
password: SomeSecretePassword
epg: default
type: out_of_band
state: present
delegate_to: localhost
- name: Query in band mgmt epg
cisco.aci.aci_node_mgmt_epg:
host: "Host IP"
username: admin
password: SomeSecretePassword
epg: default
type: in_band
encap: vlan-1
bd: bd1
state: query
delegate_to: localhost
- name: Query all in band mgmt epg
cisco.aci.aci_node_mgmt_epg:
host: "Host IP"
username: admin
password: SomeSecretePassword
type: in_band
state: query
delegate_to: localhost
- name: Query all out of band mgmt epg
cisco.aci.aci_node_mgmt_epg:
host: "Host IP"
username: admin
password: SomeSecretePassword
type: out_of_band
state: query
delegate_to: localhost
- name: Remove in band mgmt epg
cisco.aci.aci_node_mgmt_epg:
host: "Host IP"
username: admin
password: SomeSecretePassword
epg: default
type: in_band
state: absent
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class "/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** class\_map (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Shreyas Srish (@shrsr)
| programming_docs |
ansible cisco.aci.aci_l3out_extsubnet β Manage External Subnet objects (l3extSubnet:extsubnet) cisco.aci.aci\_l3out\_extsubnet β Manage External Subnet objects (l3extSubnet:extsubnet)
========================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_l3out_extsubnet`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage External Subnet objects (l3extSubnet:extsubnet)
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the External Subnet.
aliases: descr |
| **extepg** string / required | | Name of an existing ExtEpg.
aliases: extepg\_name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **l3out** string / required | | Name of an existing L3Out.
aliases: l3out\_name |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **network** string | | The network address for the Subnet.
aliases: address, ip |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **scope** list / elements=string | **Choices:*** export-rtctrl
* **import-security** β
* shared-rtctrl
* shared-security
**Default:**["import-security"] | Determines the scope of the Subnet. The `export-rtctrl` option controls which external networks are advertised out of the fabric using route-maps and IP prefix-lists. The `import-security` option classifies for the external EPG. The rules and contracts defined in this external EPG apply to networks matching this subnet. The `shared-rtctrl` option controls which external prefixes are advertised to other tenants for shared services. The `shared-security` option configures the classifier for the subnets in the VRF where the routes are leaked. The APIC defaults to `import-security` when unset during creation. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **subnet\_name** string | | Name of External Subnet being created.
aliases: name |
| **tenant** string / required | | Name of an existing tenant.
aliases: tenant\_name |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* The `tenant` and `domain` and `vrf` used must exist before using this module in your playbook. The [cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module) and [cisco.aci.aci\_domain](aci_domain_module#ansible-collections-cisco-aci-aci-domain-module) and [cisco.aci.aci\_vrf](aci_vrf_module#ansible-collections-cisco-aci-aci-vrf-module) modules can be used for this.
See Also
--------
See also
[cisco.aci.aci\_tenant](aci_tenant_module#ansible-collections-cisco-aci-aci-tenant-module)
The official documentation on the **cisco.aci.aci\_tenant** module.
[cisco.aci.aci\_domain](aci_domain_module#ansible-collections-cisco-aci-aci-domain-module)
The official documentation on the **cisco.aci.aci\_domain** module.
[cisco.aci.aci\_vrf](aci_vrf_module#ansible-collections-cisco-aci-aci-vrf-module)
The official documentation on the **cisco.aci.aci\_vrf** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **l3ext:Out**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new External Subnet
cisco.aci.aci_l3out_extsubnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
l3out: prod_l3out
extepg: prod_extepg
description: External Subnet for Production ExtEpg
network: 192.0.2.0/24
scope: export-rtctrl
state: present
delegate_to: localhost
- name: Delete External Subnet
cisco.aci.aci_l3out_extsubnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
l3out: prod_l3out
extepg: prod_extepg
network: 192.0.2.0/24
state: absent
delegate_to: localhost
- name: Query ExtEpg Subnet information
cisco.aci.aci_l3out_extsubnet:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
l3out: prod_l3out
extepg: prod_extepg
network: 192.0.2.0/24
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Rostyslav Davydenko (@rost-d)
* Cindy Zhao (@cizhao)
ansible cisco.aci.aci_vlan_pool β Manage VLAN pools (fvns:VlanInstP) cisco.aci.aci\_vlan\_pool β Manage VLAN pools (fvns:VlanInstP)
==============================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_vlan_pool`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage VLAN pools on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | Description for the `pool`.
aliases: descr |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **pool** string | | The name of the pool.
aliases: name, pool\_name |
| **pool\_allocation\_mode** string | **Choices:*** dynamic
* static
| The method used for allocating VLANs to resources.
aliases: allocation\_mode, mode |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[cisco.aci.aci\_encap\_pool](aci_encap_pool_module#ansible-collections-cisco-aci-aci-encap-pool-module)
The official documentation on the **cisco.aci.aci\_encap\_pool** module.
[cisco.aci.aci\_vlan\_pool\_encap\_block](aci_vlan_pool_encap_block_module#ansible-collections-cisco-aci-aci-vlan-pool-encap-block-module)
The official documentation on the **cisco.aci.aci\_vlan\_pool\_encap\_block** module.
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **fvns:VlanInstP**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a new VLAN pool
cisco.aci.aci_vlan_pool:
host: apic
username: admin
password: SomeSecretPassword
pool: production
pool_allocation_mode: dynamic
description: Production VLANs
state: present
delegate_to: localhost
- name: Remove a VLAN pool
cisco.aci.aci_vlan_pool:
host: apic
username: admin
password: SomeSecretPassword
pool: production
pool_allocation_mode: dynamic
state: absent
delegate_to: localhost
- name: Query a VLAN pool
cisco.aci.aci_vlan_pool:
host: apic
username: admin
password: SomeSecretPassword
pool: production
pool_allocation_mode: dynamic
state: query
delegate_to: localhost
register: query_result
- name: Query all VLAN pools
cisco.aci.aci_vlan_pool:
host: apic
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Jacob McGill (@jmcgill298)
* Dag Wieers (@dagwieers)
| programming_docs |
ansible cisco.aci.aci_cloud_zone β Manage Cloud Availability Zone (cloud:Zone) cisco.aci.aci\_cloud\_zone β Manage Cloud Availability Zone (cloud:Zone)
========================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_cloud_zone`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage Cloud Availability Zone on Cisco Cloud ACI.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **cloud** string / required | **Choices:*** aws
* azure
| The cloud provider. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name** string | | object name
aliases: zone |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **region** string / required | | The name of the cloud provider's region. |
| **state** string | **Choices:*** **query** β
| Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* More information about the internal APIC class **cloud:Zone** from [the APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/).
* This module is used to query Cloud Availability Zone.
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Query all zones in a region
cisco.aci.aci_cloud_zone:
host: apic
username: userName
password: somePassword
validate_certs: no
cloud: 'aws'
region: regionName
state: query
delegate_to: localhost
- name: Query a specific zone
cisco.aci.aci_cloud_zone:
host: apic
username: userName
password: somePassword
validate_certs: no
cloud: 'aws'
region: regionName
zone: zoneName
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Nirav (@nirav)
* Cindy Zhao (@cizhao)
ansible cisco.aci.aci_interface_policy_fc β Manage Fibre Channel interface policies (fc:IfPol) cisco.aci.aci\_interface\_policy\_fc β Manage Fibre Channel interface policies (fc:IfPol)
=========================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_interface_policy_fc`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage ACI Fiber Channel interface policies on Cisco ACI fabrics.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **description** string | | The description of the Fiber Channel interface policy.
aliases: descr |
| **fc\_policy** string | | The name of the Fiber Channel interface policy.
aliases: name |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **name\_alias** string | | The alias for the current object. This relates to the nameAlias field in ACI. |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **port\_mode** string | **Choices:*** f
* np
| The Port Mode to use. The APIC defaults to `f` when unset during creation. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* **present** β
* query
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
See Also
--------
See also
[APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/)
More information about the internal APIC class **fc:IfPol**.
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Add a Fibre Channel interface policy
cisco.aci.aci_interface_policy_fc:
host: '{{ hostname }}'
username: '{{ username }}'
password: '{{ password }}'
fc_policy: '{{ fc_policy }}'
port_mode: '{{ port_mode }}'
description: '{{ description }}'
state: present
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Dag Wieers (@dagwieers)
ansible cisco.aci.aci_cloud_vpn_gateway β Manage cloudRouterP in Cloud Context Profile (cloud:cloudRouterP) cisco.aci.aci\_cloud\_vpn\_gateway β Manage cloudRouterP in Cloud Context Profile (cloud:cloudRouterP)
======================================================================================================
Note
This plugin is part of the [cisco.aci collection](https://galaxy.ansible.com/cisco/aci) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.aci`.
To use it in a playbook, specify: `cisco.aci.aci_cloud_vpn_gateway`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Manage cloudRouterP objects on Cisco Cloud ACI.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **annotation** string | | User-defined string for annotating an object. If the value is not specified in the task, the value of environment variable `ACI_ANNOTATION` will be used instead. |
| **certificate\_name** string | | The X.509 certificate name attached to the APIC AAA user used for signature-based authentication. If a `private_key` filename was provided, this defaults to the `private_key` basename, without extension. If PEM-formatted content was provided for `private_key`, this defaults to the `username` value. If the value is not specified in the task, the value of environment variable `ACI_CERTIFICATE_NAME` will be used instead.
aliases: cert\_name |
| **cloud\_context\_profile** string / required | | The name of cloud context profile. |
| **host** string / required | | IP Address or hostname of APIC resolvable by Ansible control host. If the value is not specified in the task, the value of environment variable `ACI_HOST` will be used instead.
aliases: hostname |
| **output\_level** string | **Choices:*** debug
* info
* **normal** β
| Influence the output of this ACI module.
`normal` means the standard output, incl. `current` dict
`info` adds informational output, incl. `previous`, `proposed` and `sent` dicts
`debug` adds debugging output, incl. `filter_string`, `method`, `response`, `status` and `url` information If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_LEVEL` will be used instead. |
| **output\_path** string | | Path to a file that will be used to dump the ACI JSON configuration objects generated by the module. If the value is not specified in the task, the value of environment variable `ACI_OUTPUT_PATH` will be used instead. |
| **owner\_key** string | | User-defined string for the ownerKey attribute of an ACI object. This attribute represents a key for enabling clients to own their data for entity correlation. If the value is not specified in the task, the value of environment variable `ACI_OWNER_KEY` will be used instead. |
| **owner\_tag** string | | User-defined string for the ownerTag attribute of an ACI object. This attribute represents a tag for enabling clients to add their own data. For example, to indicate who created this object. If the value is not specified in the task, the value of environment variable `ACI_OWNER_TAG` will be used instead. |
| **password** string | | The password to use for authentication. This option is mutual exclusive with `private_key`. If `private_key` is provided too, it will be used instead. If the value is not specified in the task, the value of environment variables `ACI_PASSWORD` or `ANSIBLE_NET_PASSWORD` will be used instead. |
| **port** integer | | Port number to be used for REST connection. The default value depends on parameter `use_ssl`. If the value is not specified in the task, the value of environment variable `ACI_PORT` will be used instead. |
| **private\_key** string | | Either a PEM-formatted private key file or the private key content used for signature-based authentication. This value also influences the default `certificate_name` that is used. This option is mutual exclusive with `password`. If `password` is provided too, it will be ignored. If the value is not specified in the task, the value of environment variable `ACI_PRIVATE_KEY` or `ANSIBLE_NET_SSH_KEYFILE` will be used instead.
aliases: cert\_key |
| **state** string | **Choices:*** absent
* present
* **query** β
| Use `present` or `absent` for adding or removing. Use `query` for listing an object or multiple objects. |
| **tenant** string / required | | The name of tenant. |
| **timeout** integer | **Default:**30 | The socket level timeout in seconds. If the value is not specified in the task, the value of environment variable `ACI_TIMEOUT` will be used instead. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. If the value is not specified in the task, the value of environment variable `ACI_USE_PROXY` will be used instead. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. If the value is not specified in the task, the value of environment variable `ACI_USE_SSL` will be used instead. |
| **username** string | **Default:**"admin" | The username to use for authentication. If the value is not specified in the task, the value of environment variables `ACI_USERNAME` or `ANSIBLE_NET_USERNAME` will be used instead.
aliases: user |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| If `no`, SSL certificates will not be validated. This should only set to `no` when used on personally controlled sites using self-signed certificates. If the value is not specified in the task, the value of environment variable `ACI_VALIDATE_CERTS` will be used instead. |
Notes
-----
Note
* More information about the internal APIC class **cloud:cloudRouterP** from [the APIC Management Information Model reference](https://developer.cisco.com/docs/apic-mim-ref/).
See Also
--------
See also
[Cisco ACI Guide](../../../scenario_guides/guide_aci#aci-guide)
Detailed information on how to manage your ACI infrastructure using Ansible.
[Developing Cisco ACI modules](https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_aci.html#aci-dev-guide)
Detailed guide on how to write your own Cisco ACI modules to contribute.
Examples
--------
```
- name: Enable VpnGateway
cisco.aci.aci_cloud_vpn_gateway:
host: apic_host
username: admin
password: SomeSecretPassword
tenant: ansible_test
cloud_context_profile: ctx_profile_1
state: present
delegate_to: localhost
- name: Disable VpnGateway
cisco.aci.aci_cloud_vpn_gateway:
host: apic_host
username: admin
password: SomeSecretPassword
tenant: ansible_test
cloud_context_profile: ctx_profile_1
state: absent
delegate_to: localhost
- name: Query VpnGateway
cisco.aci.aci_cloud_vpn_gateway:
host: apic_host
username: admin
password: SomeSecretPassword
tenant: ansible_test
cloud_context_profile: ctx_profile_1
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **current** list / elements=string | success | The existing configuration from the APIC after the module has finished **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production environment', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **error** dictionary | failure | The error information as returned from the APIC **Sample:** {'code': '122', 'text': 'unknown managed object class foo'} |
| **filter\_string** string | failure or debug | The filter string used for the request **Sample:** ?rsp-prop-include=config-only |
| **method** string | failure or debug | The HTTP method used for the request to the APIC **Sample:** POST |
| **previous** list / elements=string | info | The original configuration from the APIC before the module has started **Sample:** [{'fvTenant': {'attributes': {'descr': 'Production', 'dn': 'uni/tn-production', 'name': 'production', 'nameAlias': '', 'ownerKey': '', 'ownerTag': ''}}}] |
| **proposed** dictionary | info | The assembled configuration from the user-provided parameters **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment', 'name': 'production'}}} |
| **raw** string | parse error | The raw output returned by the APIC REST API (xml or json) **Sample:** <?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata> |
| **response** string | failure or debug | The HTTP response from the APIC **Sample:** OK (30 bytes) |
| **sent** list / elements=string | info | The actual/minimal configuration pushed to the APIC **Sample:** {'fvTenant': {'attributes': {'descr': 'Production environment'}}} |
| **status** integer | failure or debug | The HTTP status from the APIC **Sample:** 200 |
| **url** string | failure or debug | The HTTP url used for the request to the APIC **Sample:** https://10.11.12.13/api/mo/uni/tn-production.json |
### Authors
* Cindy Zhao (@cizhao)
| programming_docs |
ansible cisco.ios.ios_lacp β LACP resource module cisco.ios.ios\_lacp β LACP resource module
==========================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_lacp`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of Global LACP on Cisco IOS network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** dictionary | | The provided configurations. |
| | **system** dictionary | | This option sets the default system parameters for LACP. |
| | | **priority** integer / required | | LACP priority for the system. Refer to vendor documentation for valid values. |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **show lacp sys-id**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* deleted
* rendered
* parsed
* gathered
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL.
Examples
--------
```
# Using merged
#
# Before state:
# -------------
#
# vios#show lacp sys-id
# 32768, 5e00.0000.8000
- name: Merge provided configuration with device configuration
cisco.ios.ios_lacp:
config:
system:
priority: 123
state: merged
# After state:
# ------------
#
# vios#show lacp sys-id
# 123, 5e00.0000.8000
# Using replaced
#
# Before state:
# -------------
#
# vios#show lacp sys-id
# 500, 5e00.0000.8000
- name: Replaces Global LACP configuration
cisco.ios.ios_lacp:
config:
system:
priority: 123
state: replaced
# After state:
# ------------
#
# vios#show lacp sys-id
# 123, 5e00.0000.8000
# Using Deleted
#
# Before state:
# -------------
#
# vios#show lacp sys-id
# 500, 5e00.0000.8000
- name: Delete Global LACP attribute
cisco.ios.ios_lacp:
state: deleted
# After state:
# -------------
#
# vios#show lacp sys-id
# 32768, 5e00.0000.8000
# Using Gathered
# Before state:
# -------------
#
# vios#show lacp sys-id
# 123, 5e00.0000.8000
- name: Gather listed LACP with provided configurations
cisco.ios.ios_lacp:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": {
# "system": {
# "priority": 500
# }
# }
# After state:
# ------------
#
# vios#show lacp sys-id
# 123, 5e00.0000.8000
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_lacp:
config:
system:
priority: 123
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "lacp system-priority 10"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# lacp system-priority 123
- name: Parse the commands for provided configuration
cisco.ios.ios_lacp:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": {
# "system": {
# "priority": 123
# }
# }
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device. **Sample:** ['lacp system-priority 10'] |
### Authors
* Sumit Jaiswal (@justjais)
ansible cisco.ios.ios_system β Manage the system attributes on Cisco IOS devices cisco.ios.ios\_system β Manage the system attributes on Cisco IOS devices
=========================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_system`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of node system attributes on Cisco IOS devices. It provides an option to configure host system parameters or remove those parameters from the device active configuration.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **domain\_name** list / elements=raw | | Configure the IP domain name on the remote device to the provided value. Value should be in the dotted name form and will be appended to the `hostname` to create a fully-qualified domain name. |
| **domain\_search** list / elements=raw | | Provides the list of domain suffixes to append to the hostname for the purpose of doing name resolution. This argument accepts a list of names and will be reconciled with the current active configuration on the running node. |
| **hostname** string | | Configure the device hostname parameter. This option takes an ASCII string value. |
| **lookup\_enabled** boolean | **Choices:*** no
* yes
| Administrative control for enabling or disabling DNS lookups. When this argument is set to True, lookups are performed and when it is set to False, lookups are not performed. |
| **lookup\_source** string | | Provides one or more source interfaces to use for performing DNS lookups. The interface provided in `lookup_source` must be a valid interface configured on the device. |
| **name\_servers** list / elements=raw | | List of DNS name servers by IP address to use to perform name resolution lookups. This argument accepts either a list of DNS servers See examples. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **state** string | **Choices:*** **present** β
* absent
| State of the configuration values in the device's current active configuration. When set to *present*, the values should be configured in the device active configuration and when set to *absent* the values should not be in the device active configuration |
Notes
-----
Note
* Tested against IOS 15.6
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: configure hostname and domain name
cisco.ios.ios_system:
hostname: ios01
domain_name: test.example.com
domain_search:
- ansible.com
- redhat.com
- cisco.com
- name: remove configuration
cisco.ios.ios_system:
state: absent
- name: configure DNS lookup sources
cisco.ios.ios_system:
lookup_source: MgmtEth0/0/CPU0/0
lookup_enabled: yes
- name: configure name servers
cisco.ios.ios_system:
name_servers:
- 8.8.8.8
- 8.8.4.4
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['hostname ios01', 'ip domain name test.example.com'] |
### Authors
* Peter Sprygada (@privateip)
ansible cisco.ios.ios_ntp_global β ntp_global resource module cisco.ios.ios\_ntp\_global β ntp\_global resource module
========================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_ntp_global`.
New in version 2.5.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of ntp on Cisco IOS devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** dictionary | | A dictionary of ntp options |
| | **access\_group** dictionary | | Control NTP access |
| | | **peer** list / elements=dictionary | | Provide full access |
| | | | **access\_list** string | | name or number of access list |
| | | | **ipv4** boolean | **Choices:*** no
* yes
| ipv4 access lists (Default not idempotent) |
| | | | **ipv6** boolean | **Choices:*** no
* yes
| ipv6 access lists (Default not idempotent) |
| | | | **kod** boolean | **Choices:*** no
* yes
| Send a Kiss-o-Death packet for failing peers |
| | | **query\_only** list / elements=dictionary | | Allow only control queries |
| | | | **access\_list** string | | name or number of access list |
| | | | **ipv4** boolean | **Choices:*** no
* yes
| ipv4 access lists (Default not idempotent) |
| | | | **ipv6** boolean | **Choices:*** no
* yes
| ipv6 access lists (Default not idempotent) |
| | | | **kod** boolean | **Choices:*** no
* yes
| Send a Kiss-o-Death packet for failing peers |
| | | **serve** list / elements=dictionary | | Provide server and query access |
| | | | **access\_list** string | | name or number of access list |
| | | | **ipv4** boolean | **Choices:*** no
* yes
| ipv4 access lists (Default not idempotent) |
| | | | **ipv6** boolean | **Choices:*** no
* yes
| ipv6 access lists (Default not idempotent) |
| | | | **kod** boolean | **Choices:*** no
* yes
| Send a Kiss-o-Death packet for failing peers |
| | | **serve\_only** list / elements=dictionary | | Provide only server access |
| | | | **access\_list** string | | name or number of access list |
| | | | **ipv4** boolean | **Choices:*** no
* yes
| ipv4 access lists (Default not idempotent) |
| | | | **ipv6** boolean | **Choices:*** no
* yes
| ipv6 access lists (Default not idempotent) |
| | | | **kod** boolean | **Choices:*** no
* yes
| Send a Kiss-o-Death packet for failing peers |
| | **allow** dictionary | | Allow processing of packets |
| | | **control** dictionary | | Allow processing control mode packets |
| | | | **rate\_limit** integer | | Rate-limit delay. |
| | | **private** boolean | **Choices:*** no
* yes
| Allow processing private mode packets |
| | **authenticate** boolean | **Choices:*** no
* yes
| Authenticate time sources |
| | **authentication\_keys** list / elements=dictionary | | Authentication key for trusted time sources |
| | | **algorithm** string | | Authentication type |
| | | **encryption** integer | | Authentication key encryption type |
| | | **id** integer | | Key number |
| | | **key** string | | Password |
| | **broadcast\_delay** integer | | Estimated round-trip delay |
| | **clock\_period** integer | | Length of hardware clock tick, clock period in 2^-32 seconds |
| | **logging** boolean | **Choices:*** no
* yes
| Enable NTP message logging |
| | **master** dictionary | | Act as NTP master clock |
| | | **enabled** boolean | **Choices:*** no
* yes
| Enable master clock |
| | | **stratum** integer | | Stratum number |
| | **max\_associations** integer | | Set maximum number of associations |
| | **max\_distance** integer | | Maximum Distance for synchronization |
| | **min\_distance** integer | | Minimum distance to consider for clockhop |
| | **orphan** integer | | Threshold Stratum for orphan mode |
| | **panic\_update** boolean | **Choices:*** no
* yes
| Reject time updates > panic threshold (default 1000Sec) |
| | **passive** boolean | **Choices:*** no
* yes
| NTP passive mode |
| | **peers** list / elements=dictionary | | Configure NTP peer |
| | | **burst** boolean | **Choices:*** no
* yes
| Send a burst when peer is reachable (Default) |
| | | **iburst** boolean | **Choices:*** no
* yes
| Send a burst when peer is unreachable (Default) |
| | | **key** integer | | Configure peer authentication key |
| | | **maxpoll** integer | | Maximum poll interval Poll value in Log2 |
| | | **minpoll** integer | | Minimum poll interval Poll value in Log2 |
| | | **normal\_sync** boolean | **Choices:*** no
* yes
| Disable rapid sync at startup |
| | | **peer** string | | ipv4/ipv6 address or hostname of the peer |
| | | **prefer** boolean | **Choices:*** no
* yes
| Prefer this peer when possible |
| | | **source** string | | Interface for source address |
| | | **use\_ipv4** boolean | **Choices:*** no
* yes
| Use IP for DNS resolution |
| | | **use\_ipv6** boolean | **Choices:*** no
* yes
| Use IPv6 for DNS resolution |
| | | **version** integer | | Configure NTP version |
| | | **vrf** string | | VPN Routing/Forwarding Information |
| | **servers** list / elements=dictionary | | Configure NTP server |
| | | **burst** boolean | **Choices:*** no
* yes
| Send a burst when peer is reachable (Default) |
| | | **iburst** boolean | **Choices:*** no
* yes
| Send a burst when peer is unreachable (Default) |
| | | **key** integer | | Configure peer authentication key |
| | | **maxpoll** integer | | Maximum poll interval Poll value in Log2 |
| | | **minpoll** integer | | Minimum poll interval Poll value in Log2 |
| | | **normal\_sync** boolean | **Choices:*** no
* yes
| Disable rapid sync at startup |
| | | **prefer** boolean | **Choices:*** no
* yes
| Prefer this peer when possible |
| | | **server** string | | ipv4/ipv6 address or hostname of the server |
| | | **source** string | | Interface for source address |
| | | **use\_ipv4** boolean | **Choices:*** no
* yes
| Use IP for DNS resolution |
| | | **use\_ipv6** boolean | **Choices:*** no
* yes
| Use IPv6 for DNS resolution |
| | | **version** integer | | Configure NTP version |
| | | **vrf** string | | VPN Routing/Forwarding Information |
| | **source** string | | Configure interface for source address |
| | **trusted\_keys** list / elements=dictionary | | Key numbers for trusted time sources |
| | | **range\_end** integer | | End key number |
| | | **range\_start** integer | | Start / key number |
| | **update\_calendar** boolean | **Choices:*** no
* yes
| Periodically update calendar with NTP time |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **show running-config | section ^ntp**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* rendered
* gathered
* parsed
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The states *replaced* and *overridden* have identical behaviour for this module. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | section ^ntp* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.6.
* This module works with connection `network_cli`.
Examples
--------
```
# Using state: merged
# Before state:
# -------------
# router-ios#show running-config | section ^ntp
# --------------------- EMPTY -----------------
# Merged play:
# ------------
- name: Apply the provided configuration
cisco.ios.ios_ntp_global:
config:
access_group:
peer:
- access_list: DHCP-Server
ipv4: true
kod: true
- access_list: preauth_ipv6_acl
ipv6: true
kod: true
- access_list: '2'
kod: true
query_only:
- access_list: '10'
allow:
control:
rate_limit: 4
private: true
authenticate: true
authentication_keys:
- algorithm: md5
encryption: 22
id: 2
key: SomeSecurePassword
broadcast_delay: 22
clock_period: 5
logging: true
master:
stratum: 4
max_associations: 34
max_distance: 3
min_distance: 10
orphan: 4
panic_update: true
peers:
- peer: 172.16.1.10
version: 2
- key: 2
minpoll: 5
peer: 172.16.1.11
prefer: true
version: 2
- peer: checkPeerDomainIpv4.com
prefer: true
use_ipv4: true
- peer: checkPeerDomainIpv6.com
use_ipv6: true
- peer: testPeerDomainIpv6.com
prefer: true
use_ipv6: true
servers:
- server: 172.16.1.12
version: 2
- server: checkServerDomainIpv6.com
use_ipv6: true
- server: 172.16.1.13
source: GigabitEthernet0/1
source: GigabitEthernet0/1
trusted_keys:
- range_end: 3
range_start: 3
- range_start: 21
state: merged
# Commands Fired:
# ---------------
# "commands": [
# "ntp allow mode control 4",
# "ntp allow mode private",
# "ntp authenticate",
# "ntp broadcastdelay 22",
# "ntp clock-period 5",
# "ntp logging",
# "ntp master 4",
# "ntp max-associations 34",
# "ntp maxdistance 3",
# "ntp mindistance 10",
# "ntp orphan 4",
# "ntp panic update",
# "ntp source GigabitEthernet0/1",
# "ntp access-group ipv4 peer DHCP-Server kod",
# "ntp access-group ipv6 peer preauth_ipv6_acl kod",
# "ntp access-group peer 2 kod",
# "ntp access-group query-only 10",
# "ntp authentication-key 2 md5 SomeSecurePassword 22",
# "ntp peer 172.16.1.10 version 2",
# "ntp peer 172.16.1.11 key 2 minpoll 5 prefer version 2",
# "ntp peer ip checkPeerDomainIpv4.com prefer",
# "ntp peer ipv6 checkPeerDomainIpv6.com",
# "ntp peer ipv6 testPeerDomainIpv6.com prefer",
# "ntp server 172.16.1.12 version 2",
# "ntp server ipv6 checkServerDomainIpv6.com",
# "ntp server 172.16.1.13 source GigabitEthernet0/1",
# "ntp trusted-key 3 - 3",
# "ntp trusted-key 21"
# ],
# After state:
# ------------
# router-ios#show running-config | section ^ntp
# ntp max-associations 34
# ntp logging
# ntp allow mode control 4
# ntp panic update
# ntp authentication-key 2 md5 0635002C497D0C1A1005173B0D17393C2B3A37 7
# ntp authenticate
# ntp trusted-key 3 - 3
# ntp trusted-key 21
# ntp orphan 4
# ntp mindistance 10
# ntp maxdistance 3
# ntp broadcastdelay 22
# ntp source GigabitEthernet0/1
# ntp access-group peer 2 kod
# ntp access-group ipv6 peer preauth_ipv6_acl kod
# ntp master 4
# ntp peer 172.16.1.10 version 2
# ntp peer 172.16.1.11 key 2 minpoll 5 prefer version 2
# ntp server 172.16.1.12 version 2
# ntp server 172.16.1.13 source GigabitEthernet0/1
# ntp peer ip checkPeerDomainIpv4.com prefer
# ntp peer ipv6 checkPeerDomainIpv6.com
# ntp peer ipv6 testPeerDomainIpv6.com prefer
# ntp server ipv6 checkServerDomainIpv6.com
# Using state: deleted
# Before state:
# -------------
# router-ios#show running-config | section ^ntp
# ntp max-associations 34
# ntp logging
# ntp allow mode control 4
# ntp panic update
# ntp authentication-key 2 md5 0635002C497D0C1A1005173B0D17393C2B3A37 7
# ntp authenticate
# ntp trusted-key 3 - 3
# ntp trusted-key 21
# ntp orphan 4
# ntp mindistance 10
# ntp maxdistance 3
# ntp broadcastdelay 22
# ntp source GigabitEthernet0/1
# ntp access-group peer 2 kod
# ntp access-group ipv6 peer preauth_ipv6_acl kod
# ntp master 4
# ntp peer 172.16.1.10 version 2
# ntp peer 172.16.1.11 key 2 minpoll 5 prefer version 2
# ntp server 172.16.1.12 version 2
# ntp server 172.16.1.13 source GigabitEthernet0/1
# ntp peer ip checkPeerDomainIpv4.com prefer
# ntp peer ipv6 checkPeerDomainIpv6.com
# ntp peer ipv6 testPeerDomainIpv6.com prefer
# ntp server ipv6 checkServerDomainIpv6.com
# Deleted play:
# -------------
- name: Remove all existing configuration
cisco.ios.ios_ntp_global:
state: deleted
# Commands Fired:
# ---------------
# "commands": [
# "no ntp allow mode control 4",
# "no ntp authenticate",
# "no ntp broadcastdelay 22",
# "no ntp logging",
# "no ntp master 4",
# "no ntp max-associations 34",
# "no ntp maxdistance 3",
# "no ntp mindistance 10",
# "no ntp orphan 4",
# "no ntp panic update",
# "no ntp source GigabitEthernet0/1",
# "no ntp access-group peer 2 kod",
# "no ntp access-group ipv6 peer preauth_ipv6_acl kod",
# "no ntp authentication-key 2 md5 0635002C497D0C1A1005173B0D17393C2B3A37 7",
# "no ntp peer 172.16.1.10 version 2",
# "no ntp peer 172.16.1.11 key 2 minpoll 5 prefer version 2",
# "no ntp peer ip checkPeerDomainIpv4.com prefer",
# "no ntp peer ipv6 checkPeerDomainIpv6.com",
# "no ntp peer ipv6 testPeerDomainIpv6.com prefer",
# "no ntp server 172.16.1.12 version 2",
# "no ntp server 172.16.1.13 source GigabitEthernet0/1",
# "no ntp server ipv6 checkServerDomainIpv6.com",
# "no ntp trusted-key 21",
# "no ntp trusted-key 3 - 3"
# ],
# After state:
# ------------
# router-ios#show running-config | section ^ntp
# --------------------- EMPTY -----------------
# Using state: overridden
# Before state:
# -------------
# router-ios#show running-config | section ^ntp
# ntp panic update
# ntp authentication-key 2 md5 00371C0B01680E051A33497E080A16001D1908 7
# ntp authenticate
# ntp trusted-key 3 - 4
# ntp trusted-key 21
# ntp source GigabitEthernet0/1
# ntp peer 172.16.1.10 version 2
# ntp server 172.16.1.12 version 2
# ntp peer ip checkPeerDomainIpv4.com prefer
# ntp server ipv6 checkServerDomainIpv6.com
# Overridden play:
# ----------------
- name: Override commands with provided configuration
cisco.ios.ios_ntp_global:
config:
peers:
- peer: ipv6DomainNew.com
use_ipv6: true
- peer: 172.16.1.100
prefer: true
use_ipv4: true
access_group:
peer:
- access_list: DHCP-Server
ipv6: true
state: overridden
# Commands Fired:
# ---------------
# "commands": [
# "no ntp authenticate",
# "no ntp panic update",
# "no ntp source GigabitEthernet0/1",
# "ntp access-group ipv6 peer DHCP-Server",
# "no ntp authentication-key 2 md5 00371C0B01680E051A33497E080A16001D1908 7",
# "ntp peer ipv6 ipv6DomainNew.com",
# "ntp peer 172.16.1.100 prefer",
# "no ntp peer 172.16.1.10 version 2",
# "no ntp peer ip checkPeerDomainIpv4.com prefer",
# "no ntp server 172.16.1.12 version 2",
# "no ntp server ipv6 checkServerDomainIpv6.com",
# "no ntp trusted-key 21",
# "no ntp trusted-key 3 - 4"
# ],
# After state:
# ------------
# router-ios#show running-config | section ^ntp
# ntp access-group ipv6 peer DHCP-Server
# ntp peer ipv6 ipv6DomainNew.com
# ntp peer 172.16.1.100 prefer
# Using state: replaced
# Before state:
# -------------
# router-ios#show running-config | section ^ntp
# ntp access-group ipv6 peer DHCP-Server
# ntp peer ipv6 ipv6DomainNew.com
# ntp peer 172.16.1.100 prefer
# Replaced play:
# --------------
- name: Replace commands with provided configuration
cisco.ios.ios_ntp_global:
config:
broadcast_delay: 22
clock_period: 5
logging: true
master:
stratum: 4
max_associations: 34
max_distance: 3
min_distance: 10
orphan: 4
state: replaced
# Commands Fired:
# ---------------
# "commands": [
# "ntp broadcastdelay 22",
# "ntp clock-period 5",
# "ntp logging",
# "ntp master 4",
# "ntp max-associations 34",
# "ntp maxdistance 3",
# "ntp mindistance 10",
# "ntp orphan 4",
# "no ntp access-group ipv6 peer DHCP-Server",
# "no ntp peer 172.16.1.100 prefer",
# "no ntp peer ipv6 ipv6DomainNew.com"
# ],
# After state:
# ------------
# router-ios#show running-config | section ^ntp
# ntp max-associations 34
# ntp logging
# ntp orphan 4
# ntp mindistance 10
# ntp maxdistance 3
# ntp broadcastdelay 22
# ntp master 4
# Using state: gathered
# Before state:
# -------------
#router-ios#show running-config | section ^ntp
# ntp max-associations 34
# ntp logging
# ntp allow mode control 4
# ntp panic update
# ntp authentication-key 2 md5 0635002C497D0C1A1005173B0D17393C2B3A37 7
# ntp authenticate
# ntp trusted-key 3 - 3
# ntp trusted-key 21
# ntp orphan 4
# ntp mindistance 10
# ntp maxdistance 3
# ntp broadcastdelay 22
# ntp source GigabitEthernet0/1
# ntp access-group peer 2 kod
# ntp access-group ipv6 peer preauth_ipv6_acl kod
# ntp master 4
# ntp update-calendar
# ntp peer 172.16.1.10 version 2
# ntp peer 172.16.1.11 key 2 minpoll 5 prefer version 2
# ntp server 172.16.1.12 version 2
# ntp server 172.16.1.13 source GigabitEthernet0/1
# ntp peer ip checkPeerDomainIpv4.com prefer
# ntp peer ipv6 checkPeerDomainIpv6.com
# ntp peer ipv6 testPeerDomainIpv6.com prefer
# ntp server ipv6 checkServerDomainIpv6.com
# Gathered play:
# --------------
- name: Gather listed ntp config
cisco.ios.ios_ntp_global:
state: gathered
# Module Execution Result:
# ------------------------
# "gathered": {
# "access_group": {
# "peer": [
# {
# "access_list": "2",
# "kod": true
# },
# {
# "access_list": "preauth_ipv6_acl",
# "ipv6": true,
# "kod": true
# }
# ]
# },
# "allow": {
# "control": {
# "rate_limit": 4
# }
# },
# "authenticate": true,
# "authentication_keys": [
# {
# "algorithm": "md5",
# "encryption": 7,
# "id": 2,
# "key": "0635002C497D0C1A1005173B0D17393C2B3A37"
# }
# ],
# "broadcast_delay": 22,
# "logging": true,
# "master": {
# "stratum": 4
# },
# "max_associations": 34,
# "max_distance": 3,
# "min_distance": 10,
# "orphan": 4,
# "panic_update": true,
# "peers": [
# {
# "peer": "172.16.1.10",
# "version": 2
# },
# {
# "key": 2,
# "minpoll": 5,
# "peer": "172.16.1.11",
# "prefer": true,
# "version": 2
# },
# {
# "peer": "checkPeerDomainIpv4.com",
# "prefer": true,
# "use_ipv4": true
# },
# {
# "peer": "checkPeerDomainIpv6.com",
# "use_ipv6": true
# },
# {
# "peer": "testPeerDomainIpv6.com",
# "prefer": true,
# "use_ipv6": true
# }
# ],
# "servers": [
# {
# "server": "172.16.1.12",
# "version": 2
# },
# {
# "server": "172.16.1.13",
# "source": "GigabitEthernet0/1"
# },
# {
# "server": "checkServerDomainIpv6.com",
# "use_ipv6": true
# }
# ],
# "source": "GigabitEthernet0/1",
# "trusted_keys": [
# {
# "range_start": 21
# },
# {
# "range_end": 3,
# "range_start": 3
# }
# ],
# "update_calendar": true
# },
# After state:
# -------------
# router-ios#show running-config | section ^ntp
# ntp max-associations 34
# ntp logging
# ntp allow mode control 4
# ntp panic update
# ntp authentication-key 2 md5 0635002C497D0C1A1005173B0D17393C2B3A37 7
# ntp authenticate
# ntp trusted-key 3 - 3
# ntp trusted-key 21
# ntp orphan 4
# ntp mindistance 10
# ntp maxdistance 3
# ntp broadcastdelay 22
# ntp source GigabitEthernet0/1
# ntp access-group peer 2 kod
# ntp access-group ipv6 peer preauth_ipv6_acl kod
# ntp master 4
# ntp update-calendar
# ntp peer 172.16.1.10 version 2
# ntp peer 172.16.1.11 key 2 minpoll 5 prefer version 2
# ntp server 172.16.1.12 version 2
# ntp server 172.16.1.13 source GigabitEthernet0/1
# ntp peer ip checkPeerDomainIpv4.com prefer
# ntp peer ipv6 checkPeerDomainIpv6.com
# ntp peer ipv6 testPeerDomainIpv6.com prefer
# ntp server ipv6 checkServerDomainIpv6.com
# Using state: rendered
# Rendered play:
# --------------
- name: Render the commands for provided configuration
cisco.ios.ios_ntp_global:
config:
access_group:
peer:
- access_list: DHCP-Server
ipv4: true
kod: true
- access_list: preauth_ipv6_acl
ipv6: true
kod: true
- access_list: '2'
kod: true
query_only:
- access_list: '10'
allow:
control:
rate_limit: 4
private: true
authenticate: true
authentication_keys:
- algorithm: md5
encryption: 22
id: 2
key: SomeSecurePassword
broadcast_delay: 22
clock_period: 5
logging: true
master:
stratum: 4
max_associations: 34
max_distance: 3
min_distance: 10
orphan: 4
panic_update: true
peers:
- peer: 172.16.1.10
version: 2
- key: 2
minpoll: 5
peer: 172.16.1.11
prefer: true
version: 2
- peer: checkPeerDomainIpv4.com
prefer: true
use_ipv4: true
- peer: checkPeerDomainIpv6.com
use_ipv6: true
- peer: testPeerDomainIpv6.com
prefer: true
use_ipv6: true
servers:
- server: 172.16.1.12
version: 2
- server: checkServerDomainIpv6.com
use_ipv6: true
- server: 172.16.1.13
source: GigabitEthernet0/1
source: GigabitEthernet0/1
trusted_keys:
- range_end: 3
range_start: 10
- range_start: 21
update_calendar: True
state: rendered
# Module Execution Result:
# ------------------------
# "rendered": [
# "ntp allow mode control 4",
# "ntp allow mode private",
# "ntp authenticate",
# "ntp broadcastdelay 22",
# "ntp clock-period 5",
# "ntp logging",
# "ntp master 4",
# "ntp max-associations 34",
# "ntp maxdistance 3",
# "ntp mindistance 10",
# "ntp orphan 4",
# "ntp panic update",
# "ntp source GigabitEthernet0/1",
# "ntp update-calendar",
# "ntp access-group ipv4 peer DHCP-Server kod",
# "ntp access-group ipv6 peer preauth_ipv6_acl kod",
# "ntp access-group peer 2 kod",
# "ntp access-group query-only 10",
# "ntp authentication-key 2 md5 SomeSecurePassword 22",
# "ntp peer 172.16.1.10 version 2",
# "ntp peer 172.16.1.11 key 2 minpoll 5 prefer version 2",
# "ntp peer ip checkPeerDomainIpv4.com prefer",
# "ntp peer ipv6 checkPeerDomainIpv6.com",
# "ntp peer ipv6 testPeerDomainIpv6.com prefer",
# "ntp server 172.16.1.12 version 2",
# "ntp server ipv6 checkServerDomainIpv6.com",
# "ntp server 172.16.1.13 source GigabitEthernet0/1",
# "ntp trusted-key 3 - 3",
# "ntp trusted-key 21"
# ]
# Using state: parsed
# File: parsed.cfg
# ----------------
# ntp allow mode control 4
# ntp allow mode private
# ntp authenticate
# ntp broadcastdelay 22
# ntp clock-period 5
# ntp logging
# ntp master 4
# ntp max-associations 34
# ntp maxdistance 3
# ntp mindistance 10
# ntp orphan 4
# ntp panic update
# ntp source GigabitEthernet0/1
# ntp update-calendar
# ntp access-group ipv4 peer DHCP-Server kod
# ntp access-group ipv6 peer preauth_ipv6_acl kod
# ntp access-group peer 2 kod
# ntp access-group query-only 10
# ntp authentication-key 2 md5 SomeSecurePassword 22
# ntp peer 172.16.1.10 version 2
# ntp peer 172.16.1.11 key 2 minpoll 5 prefer version 2
# ntp peer ip checkPeerDomainIpv4.com prefer
# ntp peer ipv6 checkPeerDomainIpv6.com
# ntp peer ipv6 testPeerDomainIpv6.com prefer
# ntp server 172.16.1.12 version 2
# ntp server ipv6 checkServerDomainIpv6.com
# ntp server 172.16.1.13 source GigabitEthernet0/1
# ntp trusted-key 3 - 13
# ntp trusted-key 21
# Parsed play:
# ------------
- name: Parse the provided configuration with the existing running configuration
cisco.ios.ios_ntp_global:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
# "parsed": {
# "access_group": {
# "peer": [
# {
# "access_list": "2",
# "kod": true
# },
# {
# "access_list": "DHCP-Server",
# "ipv4": true,
# "kod": true
# },
# {
# "access_list": "preauth_ipv6_acl",
# "ipv6": true,
# "kod": true
# }
# ],
# "query_only": [
# {
# "access_list": "10"
# }
# ]
# },
# "allow": {
# "control": {
# "rate_limit": 4
# },
# "private": true
# },
# "authenticate": true,
# "authentication_keys": [
# {
# "algorithm": "md5",
# "encryption": 22,
# "id": 2,
# "key": "SomeSecurePassword"
# }
# ],
# "broadcast_delay": 22,
# "clock_period": 5,
# "logging": true,
# "master": {
# "stratum": 4
# },
# "max_associations": 34,
# "max_distance": 3,
# "min_distance": 10,
# "orphan": 4,
# "panic_update": true,
# "peers": [
# {
# "peer": "172.16.1.10",
# "version": 2
# },
# {
# "peer": "checkPeerDomainIpv6.com",
# "use_ipv6": true
# }
# ],
# "servers": [
# {
# "server": "172.16.1.12",
# "version": 2
# },
# {
# "server": "172.16.1.13",
# "source": "GigabitEthernet0/1"
# },
# {
# "server": "checkServerDomainIpv6.com",
# "use_ipv6": true
# }
# ],
# "source": "GigabitEthernet0/1",
# "trusted_keys": [
# {
# "range_start": 21
# },
# {
# "range_end": 13,
# "range_start": 3
# }
# ],
# "update_calendar": true
# }
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** dictionary | when changed | The resulting configuration after module execution. **Sample:** This output will always be in the same format as the module argspec. |
| **before** dictionary | when *state* is `merged`, `replaced`, `overridden`, `deleted` or `purged` | The configuration prior to the module execution. **Sample:** This output will always be in the same format as the module argspec. |
| **commands** list / elements=string | when *state* is `merged`, `replaced`, `overridden`, `deleted` or `purged` | The set of commands pushed to the remote device. **Sample:** ['ntp peer 20.18.11.3 key 6 minpoll 15 prefer version 2', 'ntp access-group ipv4 peer DHCP-Server kod', 'ntp trusted-key 9 - 96', 'ntp master stratum 2', 'ntp orphan 4', 'ntp panic update'] |
| **gathered** list / elements=string | when *state* is `gathered` | Facts about the network resource gathered from the remote device as structured data. **Sample:** This output will always be in the same format as the module argspec. |
| **parsed** list / elements=string | when *state* is `parsed` | The device native config provided in *running\_config* option parsed into structured data as per module argspec. **Sample:** This output will always be in the same format as the module argspec. |
| **rendered** list / elements=string | when state is *rendered* | The provided configuration in the task rendered in device-native format (offline). **Sample:** ['ntp master stratum 2', 'ntp server ip testserver.com prefer', 'ntp authentication-key 2 md5 testpass 22', 'ntp allow mode control 4', 'ntp max-associations 34', 'ntp broadcastdelay 22'] |
### Authors
* Sagar Paul (@KB-perByte)
| programming_docs |
ansible cisco.ios.ios_facts β Collect facts from remote devices running Cisco IOS cisco.ios.ios\_facts β Collect facts from remote devices running Cisco IOS
==========================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_facts`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Collects a base set of device facts from a remote device that is running IOS. This module prepends all of the base network fact keys with `ansible_net_<fact>`. The facts module will always collect a base set of facts from the device and can enable or disable collection of additional facts.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **available\_network\_resources** boolean | **Choices:*** **no** β
* yes
| When 'True' a list of network resources for which resource modules are available will be provided. |
| **gather\_network\_resources** list / elements=string | | When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument include all and the resources like interfaces, vlans etc. Can specify a list of values to include a larger subset. Values can also be used with an initial `M(!`) to specify that a specific subset should not be collected. Valid subsets are 'all', 'interfaces', 'l2\_interfaces', 'vlans', 'lag\_interfaces', 'lacp', 'lacp\_interfaces', 'lldp\_global', 'lldp\_interfaces', 'l3\_interfaces', 'acl\_interfaces', 'static\_routes', 'acls'. |
| **gather\_subset** list / elements=string | **Default:**"!config" | When supplied, this argument restricts the facts collected to a given subset. Possible values for this argument include `all`, `min`, `hardware`, `config`, and `interfaces`. Specify a list of values to include a larger subset. Use a value with an initial `!` to collect all facts except that subset. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Notes
-----
Note
* Tested against IOS 15.6
* Facts gathering for L3 devices are supposed to produce blank output for unsupported resources like vlan.
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: Gather all legacy facts
cisco.ios.ios_facts:
gather_subset: all
- name: Gather only the config and default facts
cisco.ios.ios_facts:
gather_subset:
- config
- name: Do not gather hardware facts
cisco.ios.ios_facts:
gather_subset:
- '!hardware'
- name: Gather legacy and resource facts
cisco.ios.ios_facts:
gather_subset: all
gather_network_resources: all
- name: Gather only the interfaces resource facts and no legacy facts
cisco.ios.ios_facts:
gather_subset:
- '!all'
- '!min'
gather_network_resources:
- interfaces
- name: Gather interfaces resource and minimal legacy facts
cisco.ios.ios_facts:
gather_subset: min
gather_network_resources: interfaces
- name: Gather L2 interfaces resource and minimal legacy facts
cisco.ios.ios_facts:
gather_subset: min
gather_network_resources: l2_interfaces
- name: Gather L3 interfaces resource and minimal legacy facts
cisco.ios.ios_facts:
gather_subset: min
gather_network_resources: l3_interfaces
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **ansible\_net\_all\_ipv4\_addresses** list / elements=string | when interfaces is configured | All IPv4 addresses configured on the device |
| **ansible\_net\_all\_ipv6\_addresses** list / elements=string | when interfaces is configured | All IPv6 addresses configured on the device |
| **ansible\_net\_api** string | always | The name of the transport |
| **ansible\_net\_config** string | when config is configured | The current active config from the device |
| **ansible\_net\_filesystems** list / elements=string | when hardware is configured | All file system names available on the device |
| **ansible\_net\_filesystems\_info** dictionary | when hardware is configured | A hash of all file systems containing info about each file system (e.g. free and total space) |
| **ansible\_net\_gather\_network\_resources** list / elements=string | when the resource is configured | The list of fact for network resource subsets collected from the device |
| **ansible\_net\_gather\_subset** list / elements=string | always | The list of fact subsets collected from the device |
| **ansible\_net\_hostname** string | always | The configured hostname of the device |
| **ansible\_net\_image** string | always | The image file the device is running |
| **ansible\_net\_interfaces** dictionary | when interfaces is configured | A hash of all interfaces running on the system |
| **ansible\_net\_iostype** string | always | The operating system type (IOS or IOS-XE) running on the remote device |
| **ansible\_net\_memfree\_mb** integer | when hardware is configured | The available free memory on the remote device in Mb |
| **ansible\_net\_memtotal\_mb** integer | when hardware is configured | The total memory on the remote device in Mb |
| **ansible\_net\_model** string | always | The model name returned from the device |
| **ansible\_net\_neighbors** dictionary | when interfaces is configured | The list of CDP and LLDP neighbors from the remote device. If both, CDP and LLDP neighbor data is present on one port, CDP is preferred. |
| **ansible\_net\_python\_version** string | always | The Python version Ansible controller is using |
| **ansible\_net\_serialnum** string | always | The serial number of the remote device |
| **ansible\_net\_stacked\_models** list / elements=string | when multiple devices are configured in a stack | The model names of each device in the stack |
| **ansible\_net\_stacked\_serialnums** list / elements=string | when multiple devices are configured in a stack | The serial numbers of each device in the stack |
| **ansible\_net\_version** string | always | The operating system version running on the remote device |
### Authors
* Peter Sprygada (@privateip)
* Sumit Jaiswal (@justjais)
ansible Cisco.Ios Cisco.Ios
=========
Collection version 2.5.0
Plugin Index
------------
These are the plugins in the cisco.ios collection
### Cliconf Plugins
* [ios](ios_cliconf#ansible-collections-cisco-ios-ios-cliconf) β Use ios cliconf to run command on Cisco IOS platform
### Modules
* [ios\_acl\_interfaces](ios_acl_interfaces_module#ansible-collections-cisco-ios-ios-acl-interfaces-module) β ACL interfaces resource module
* [ios\_acls](ios_acls_module#ansible-collections-cisco-ios-ios-acls-module) β ACLs resource module
* [ios\_banner](ios_banner_module#ansible-collections-cisco-ios-ios-banner-module) β Manage multiline banners on Cisco IOS devices
* [ios\_bgp](ios_bgp_module#ansible-collections-cisco-ios-ios-bgp-module) β Configure global BGP protocol settings on Cisco IOS.
* [ios\_bgp\_address\_family](ios_bgp_address_family_module#ansible-collections-cisco-ios-ios-bgp-address-family-module) β BGP Address family resource module
* [ios\_bgp\_global](ios_bgp_global_module#ansible-collections-cisco-ios-ios-bgp-global-module) β Global BGP resource module
* [ios\_command](ios_command_module#ansible-collections-cisco-ios-ios-command-module) β Run commands on remote devices running Cisco IOS
* [ios\_config](ios_config_module#ansible-collections-cisco-ios-ios-config-module) β Manage Cisco IOS configuration sections
* [ios\_facts](ios_facts_module#ansible-collections-cisco-ios-ios-facts-module) β Collect facts from remote devices running Cisco IOS
* [ios\_interface](ios_interface_module#ansible-collections-cisco-ios-ios-interface-module) β (deprecated, removed after 2022-06-01) Manage Interface on Cisco IOS network devices
* [ios\_interfaces](ios_interfaces_module#ansible-collections-cisco-ios-ios-interfaces-module) β Interfaces resource module
* [ios\_l2\_interface](ios_l2_interface_module#ansible-collections-cisco-ios-ios-l2-interface-module) β (deprecated, removed after 2022-06-01) Manage Layer-2 interface on Cisco IOS devices.
* [ios\_l2\_interfaces](ios_l2_interfaces_module#ansible-collections-cisco-ios-ios-l2-interfaces-module) β L2 interfaces resource module
* [ios\_l3\_interface](ios_l3_interface_module#ansible-collections-cisco-ios-ios-l3-interface-module) β (deprecated, removed after 2022-06-01) Manage Layer-3 interfaces on Cisco IOS network devices.
* [ios\_l3\_interfaces](ios_l3_interfaces_module#ansible-collections-cisco-ios-ios-l3-interfaces-module) β L3 interfaces resource module
* [ios\_lacp](ios_lacp_module#ansible-collections-cisco-ios-ios-lacp-module) β LACP resource module
* [ios\_lacp\_interfaces](ios_lacp_interfaces_module#ansible-collections-cisco-ios-ios-lacp-interfaces-module) β LACP interfaces resource module
* [ios\_lag\_interfaces](ios_lag_interfaces_module#ansible-collections-cisco-ios-ios-lag-interfaces-module) β LAG interfaces resource module
* [ios\_linkagg](ios_linkagg_module#ansible-collections-cisco-ios-ios-linkagg-module) β Manage link aggregation groups on Cisco IOS network devices
* [ios\_lldp](ios_lldp_module#ansible-collections-cisco-ios-ios-lldp-module) β Manage LLDP configuration on Cisco IOS network devices.
* [ios\_lldp\_global](ios_lldp_global_module#ansible-collections-cisco-ios-ios-lldp-global-module) β LLDP resource module
* [ios\_lldp\_interfaces](ios_lldp_interfaces_module#ansible-collections-cisco-ios-ios-lldp-interfaces-module) β LLDP interfaces resource module
* [ios\_logging](ios_logging_module#ansible-collections-cisco-ios-ios-logging-module) β (deprecated, removed after 2023-06-01) Manage logging on network devices
* [ios\_logging\_global](ios_logging_global_module#ansible-collections-cisco-ios-ios-logging-global-module) β Logging resource module
* [ios\_ntp](ios_ntp_module#ansible-collections-cisco-ios-ios-ntp-module) β Manages core NTP configuration.
* [ios\_ntp\_global](ios_ntp_global_module#ansible-collections-cisco-ios-ios-ntp-global-module) β ntp\_global resource module
* [ios\_ospf\_interfaces](ios_ospf_interfaces_module#ansible-collections-cisco-ios-ios-ospf-interfaces-module) β OSPF\_Interfaces resource module
* [ios\_ospfv2](ios_ospfv2_module#ansible-collections-cisco-ios-ios-ospfv2-module) β OSPFv2 resource module
* [ios\_ospfv3](ios_ospfv3_module#ansible-collections-cisco-ios-ios-ospfv3-module) β OSPFv3 resource module
* [ios\_ping](ios_ping_module#ansible-collections-cisco-ios-ios-ping-module) β Tests reachability using ping from Cisco IOS network devices
* [ios\_prefix\_lists](ios_prefix_lists_module#ansible-collections-cisco-ios-ios-prefix-lists-module) β Prefix Lists resource module
* [ios\_route\_maps](ios_route_maps_module#ansible-collections-cisco-ios-ios-route-maps-module) β Route maps resource module
* [ios\_static\_route](ios_static_route_module#ansible-collections-cisco-ios-ios-static-route-module) β (deprecated, removed after 2022-06-01) Manage static IP routes on Cisco IOS network devices
* [ios\_static\_routes](ios_static_routes_module#ansible-collections-cisco-ios-ios-static-routes-module) β Static routes resource module
* [ios\_system](ios_system_module#ansible-collections-cisco-ios-ios-system-module) β Manage the system attributes on Cisco IOS devices
* [ios\_user](ios_user_module#ansible-collections-cisco-ios-ios-user-module) β Manage the aggregate of local users on Cisco IOS device
* [ios\_vlan](ios_vlan_module#ansible-collections-cisco-ios-ios-vlan-module) β (deprecated, removed after 2022-06-01) Manage VLANs on IOS network devices
* [ios\_vlans](ios_vlans_module#ansible-collections-cisco-ios-ios-vlans-module) β VLANs resource module
* [ios\_vrf](ios_vrf_module#ansible-collections-cisco-ios-ios-vrf-module) β Manage the collection of VRF definitions on Cisco IOS devices
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible cisco.ios.ios_l3_interface β (deprecated, removed after 2022-06-01) Manage Layer-3 interfaces on Cisco IOS network devices. cisco.ios.ios\_l3\_interface β (deprecated, removed after 2022-06-01) Manage Layer-3 interfaces on Cisco IOS network devices.
=============================================================================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_l3_interface`.
New in version 1.0.0: of cisco.ios
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Newer and updated modules released with more functionality in Ansible 2.9
Alternative
ios\_l3\_interfaces
Synopsis
--------
* This module provides declarative management of Layer-3 interfaces on IOS network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** list / elements=dictionary | | List of Layer-3 interfaces definitions. Each of the entry in aggregate list should define name of interface `name` and a optional `ipv4` or `ipv6` address. |
| | **ipv4** string | | IPv4 address to be set for the Layer-3 interface mentioned in *name* option. The address format is <ipv4 address>/<mask>, the mask is number in range 0-32 eg. 192.168.0.1/24 |
| | **ipv6** string | | IPv6 address to be set for the Layer-3 interface mentioned in *name* option. The address format is <ipv6 address>/<mask>, the mask is number in range 0-128 eg. fd5d:12c9:2201:1::1/64 |
| | **name** string / required | | Name of the Layer-3 interface to be configured eg. GigabitEthernet0/2 |
| | **state** string | **Choices:*** present
* absent
| State of the Layer-3 interface configuration. It indicates if the configuration should be present or absent on remote device. |
| **ipv4** string | | IPv4 address to be set for the Layer-3 interface mentioned in *name* option. The address format is <ipv4 address>/<mask>, the mask is number in range 0-32 eg. 192.168.0.1/24 |
| **ipv6** string | | IPv6 address to be set for the Layer-3 interface mentioned in *name* option. The address format is <ipv6 address>/<mask>, the mask is number in range 0-128 eg. fd5d:12c9:2201:1::1/64 |
| **name** string | | Name of the Layer-3 interface to be configured eg. GigabitEthernet0/2 |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **state** string | **Choices:*** **present** β
* absent
| State of the Layer-3 interface configuration. It indicates if the configuration should be present or absent on remote device. |
Notes
-----
Note
* Tested against IOS 15.2
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: Remove GigabitEthernet0/3 IPv4 and IPv6 address
cisco.ios.ios_l3_interface:
name: GigabitEthernet0/3
state: absent
- name: Set GigabitEthernet0/3 IPv4 address
cisco.ios.ios_l3_interface:
name: GigabitEthernet0/3
ipv4: 192.168.0.1/24
- name: Set GigabitEthernet0/3 IPv6 address
cisco.ios.ios_l3_interface:
name: GigabitEthernet0/3
ipv6: fd5d:12c9:2201:1::1/64
- name: Set GigabitEthernet0/3 in dhcp
cisco.ios.ios_l3_interface:
name: GigabitEthernet0/3
ipv4: dhcp
ipv6: dhcp
- name: Set interface Vlan1 (SVI) IPv4 address
cisco.ios.ios_l3_interface:
name: Vlan1
ipv4: 192.168.0.5/24
- name: Set IP addresses on aggregate
cisco.ios.ios_l3_interface:
aggregate:
- name: GigabitEthernet0/3
ipv4: 192.168.2.10/24
- name: GigabitEthernet0/3
ipv4: 192.168.3.10/24
ipv6: fd5d:12c9:2201:1::1/64
- name: Remove IP addresses on aggregate
cisco.ios.ios_l3_interface:
aggregate:
- name: GigabitEthernet0/3
ipv4: 192.168.2.10/24
- name: GigabitEthernet0/3
ipv4: 192.168.3.10/24
ipv6: fd5d:12c9:2201:1::1/64
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['interface GigabitEthernet0/2', 'ip address 192.168.0.1 255.255.255.0', 'ipv6 address fd5d:12c9:2201:1::1/64'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ganesh Nalawade (@ganeshrn)
| programming_docs |
ansible cisco.ios.ios_logging_global β Logging resource module cisco.ios.ios\_logging\_global β Logging resource module
========================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_logging_global`.
New in version 2.2.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module manages the logging attributes of Cisco IOS network devices
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** dictionary | | A dictionary of logging options |
| | **buffered** dictionary | | Set buffered logging parameters |
| | | **discriminator** string | | Establish MD-Buffer association |
| | | **filtered** boolean | **Choices:*** no
* yes
| Enable filtered logging |
| | | **severity** string | **Choices:*** alerts
* critical
* debugging
* emergencies
* errors
* informational
* notifications
* warnings
| Logging severity level |
| | | **size** integer | | Logging buffer size |
| | | **xml** boolean | **Choices:*** no
* yes
| Enable logging in XML to XML logging buffer |
| | **buginf** boolean | **Choices:*** no
* yes
| Enable buginf logging for debugging |
| | **cns\_events** string | **Choices:*** alerts
* critical
* debugging
* emergencies
* errors
* informational
* notifications
* warnings
| Set CNS Event logging level |
| | **console** dictionary | | Set console logging parameters |
| | | **discriminator** string | | Establish MD-Buffer association |
| | | **filtered** boolean | **Choices:*** no
* yes
| Enable filtered logging |
| | | **severity** string | **Choices:*** alerts
* critical
* debugging
* emergencies
* errors
* informational
* notifications
* warnings
* guaranteed
| Logging severity level |
| | | **xml** boolean | **Choices:*** no
* yes
| Enable logging in XML to XML logging buffer |
| | **count** boolean | **Choices:*** no
* yes
| Count every log message and timestamp last occurrence |
| | **delimiter** dictionary | | Append delimiter to syslog messages |
| | | **tcp** boolean | **Choices:*** no
* yes
| Append delimiter to syslog messages over TCP |
| | **discriminator** list / elements=string | | Create or modify a message discriminator |
| | **dmvpn** dictionary | | DMVPN Configuration |
| | | **rate\_limit** integer | | rate in messages/minute, default is 600 messages/minute (1-10000) |
| | **esm** dictionary | | Set ESM filter restrictions |
| | | **config** boolean | **Choices:*** no
* yes
| Permit/Deny configuration changes from ESM filters |
| | **exception** integer | | Limit size of exception flush output (4096-2147483647) |
| | **facility** string | **Choices:*** auth
* cron
* daemon
* kern
* local0
* local1
* local2
* local3
* local4
* local5
* local6
* local7
* lpr
* mail
* news
* sys10
* sys11
* sys12
* sys13
* sys14
* sys9
* syslog
* user
* uucp
| Facility parameter for syslog messages |
| | **filter** list / elements=dictionary | | Specify logging filter |
| | | **args** string | | Arguments passed to filter module. |
| | | **order** integer | | Order of filter execution |
| | | **url** string | | Filter Uniform Resource Locator |
| | **history** dictionary | | Configure syslog history table |
| | | **severity** string | **Choices:*** alerts
* critical
* debugging
* emergencies
* errors
* informational
* notifications
* warnings
| Logging severity level |
| | | **size** integer | | Logging buffer size |
| | **hosts** list / elements=dictionary | | Set syslog server IP address and parameters |
| | | **discriminator** string | | Establish MD-Buffer association |
| | | **filtered** boolean | **Choices:*** no
* yes
| Enable filtered logging |
| | | **hostname** string | | IP address of the syslog server |
| | | **ipv6** string | | Configure IPv6 syslog server |
| | | **sequence\_num\_session** boolean | **Choices:*** no
* yes
| Include session sequence number tag in syslog message |
| | | **session\_id** dictionary | | Specify syslog message session ID tagging |
| | | | **tag** string | **Choices:*** hostname
* ipv4
* ipv6
| Include hostname in session ID tag |
| | | | **text** string | | Include custom string in session ID tag |
| | | **stream** integer | | This server should only receive messages from a numbered stream |
| | | **transport** dictionary | | Specify the transport protocol (default=UDP) |
| | | | **tcp** dictionary | | Transport Control Protocol |
| | | | | **audit** boolean | **Choices:*** no
* yes
| Set this host for IOS firewall audit logging |
| | | | | **discriminator** string | | Establish MD-Buffer association |
| | | | | **filtered** boolean | **Choices:*** no
* yes
| Enable filtered logging |
| | | | | **port** integer | | Specify the TCP port number (default=601) (1 - 65535) |
| | | | | **sequence\_num\_session** boolean | **Choices:*** no
* yes
| Include session sequence number tag in syslog message |
| | | | | **session\_id** dictionary | | Specify syslog message session ID tagging |
| | | | | | **tag** string | **Choices:*** hostname
* ipv4
* ipv6
| Include hostname in session ID tag |
| | | | | | **text** string | | Include custom string in session ID tag |
| | | | | **stream** integer | | This server should only receive messages from a numbered stream |
| | | | | **xml** boolean | **Choices:*** no
* yes
| Enable logging in XML to XML logging buffer |
| | | | **udp** dictionary | | User Datagram Protocol |
| | | | | **discriminator** string | | Establish MD-Buffer association |
| | | | | **filtered** boolean | **Choices:*** no
* yes
| Enable filtered logging |
| | | | | **port** integer | | Specify the UDP port number (default=514) (1 - 65535) |
| | | | | **sequence\_num\_session** boolean | **Choices:*** no
* yes
| Include session sequence number tag in syslog message |
| | | | | **session\_id** dictionary | | Specify syslog message session ID tagging |
| | | | | | **tag** string | **Choices:*** hostname
* ipv4
* ipv6
| Include hostname in session ID tag |
| | | | | | **text** string | | Include custom string in session ID tag |
| | | | | **stream** integer | | This server should only receive messages from a numbered stream |
| | | | | **xml** boolean | **Choices:*** no
* yes
| Enable logging in XML to XML logging buffer |
| | | **vrf** string | | Set VRF option |
| | | **xml** boolean | **Choices:*** no
* yes
| Enable logging in XML to XML logging buffer |
| | **logging\_on** string | **Choices:*** enable
* disable
| Enable logging to all enabled destinations |
| | **message\_counter** list / elements=string | **Choices:*** log
* debug
* syslog
| Configure log message to include certain counter value |
| | **monitor** dictionary | | Set terminal line (monitor) logging parameters |
| | | **discriminator** string | | Establish MD-Buffer association |
| | | **filtered** boolean | **Choices:*** no
* yes
| Enable filtered logging |
| | | **severity** string | **Choices:*** alerts
* critical
* debugging
* emergencies
* errors
* informational
* notifications
* warnings
| Logging severity level |
| | | **xml** boolean | **Choices:*** no
* yes
| Enable logging in XML to XML logging buffer |
| | **origin\_id** dictionary | | Add origin ID to syslog messages |
| | | **tag** string | **Choices:*** hostname
* ip
* ipv6
| Include hostname in session ID tag |
| | | **text** string | | Include custom string in session ID tag |
| | **persistent** dictionary | | Set persistent logging parameters |
| | | **batch** integer | | Set batch size for writing to persistent storage (4096-2142715904) |
| | | **filesize** integer | | Set size of individual log files (4096-2142715904) |
| | | **immediate** boolean | **Choices:*** no
* yes
| Write log entry to storage immediately (no buffering). |
| | | **notify** boolean | **Choices:*** no
* yes
| Notify when show logging [persistent] is activated. |
| | | **protected** boolean | **Choices:*** no
* yes
| Eliminates manipulation on logging-persistent files. |
| | | **size** integer | | Set disk space for writing log messages (4096-2142715904) |
| | | **threshold** integer | | Set threshold for logging persistent |
| | | **url** string | | URL to store logging messages |
| | **policy\_firewall** dictionary | | Firewall configuration |
| | | **rate\_limit** integer | | (0-3600) value in seconds, default is 30 Sec. |
| | **queue\_limit** dictionary | | Set logger message queue size |
| | | **esm** integer | | (100-2147483647) set new queue size |
| | | **size** integer | | (100-2147483647) set new queue size |
| | | **trap** integer | | (100-2147483647) set new queue size |
| | **rate\_limit** dictionary | | Set messages per second limit |
| | | **all** boolean | **Choices:*** no
* yes
| (1-10000) message per second |
| | | **console** boolean | **Choices:*** no
* yes
| (1-10000) message per second |
| | | **except\_severity** string | **Choices:*** alerts
* critical
* debugging
* emergencies
* errors
* informational
* notifications
* warnings
| Messages of this severity or higher |
| | | **size** integer / required | | (1-10000) message per second |
| | **reload** dictionary | | Set reload logging level |
| | | **message\_limit** integer | | Number of messages (1-4294967295) |
| | | **severity** string | **Choices:*** alerts
* critical
* debugging
* emergencies
* errors
* informational
* notifications
* warnings
| Logging severity level |
| | **server\_arp** boolean | **Choices:*** no
* yes
| Enable sending ARP requests for syslog servers when first configured |
| | **snmp\_trap** list / elements=string | **Choices:*** alerts
* critical
* debugging
* emergencies
* errors
* informational
* notifications
* warnings
| Set syslog level for sending snmp trap |
| | **source\_interface** list / elements=dictionary | | Specify interface for source address in logging transactions |
| | | **interface** string | | Interface name with number |
| | | **vrf** string | | VPN Routing/Forwarding instance name |
| | **trap** string | **Choices:*** alerts
* critical
* debugging
* emergencies
* errors
* informational
* notifications
* warnings
| Set syslog server logging level |
| | **userinfo** boolean | **Choices:*** no
* yes
| Enable logging of user info on privileged mode enabling |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **show running-config | include logging**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* gathered
* parsed
* rendered
| The state the configuration should be left in With state *replaced*, for the listed logging configurations, that are in running-config and can have multiple set of commands but not in the task are negated. With state *overridden*, all configurations that are in running-config but not in the task are negated. Please refer to examples for more details. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.6
* This module works with connection `network_cli`. See [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios)
* The Configuration defaults of the Cisco IOS network devices are supposed to hinder idempotent behavior of plays
Examples
--------
```
# Using state: merged
# Before state:
# -------------
# router-ios#show running-config | section logging
# no logging exception
# no logging buffered
# no logging reload
# no logging rate-limit
# no logging console
# no logging monitor
# no logging cns-events
# no logging trap
- name: Apply the provided configuration
cisco.ios.ios_logging_global:
config:
buffered:
severity: notifications
size: 5099
xml: True
console:
severity: critical
xml: True
facility: local5
hosts:
- hostname: 172.16.1.12
- hostname: 172.16.1.11
xml: True
- hostname: 172.16.1.10
filtered: True
stream: 10
- hostname: 172.16.1.13
transport:
tcp:
port: 514
monitor:
severity: warnings
message_counter: log
snmp_trap:
- errors
trap: errors
userinfo: True
policy_firewall:
rate_limit: 10
logging_on: True
exception: 4099
dmvpn:
rate_limit: 10
cns_events: warnings
state: merged
# Commands Fired:
# ---------------
# "commands": [
# "logging buffered xml 5099 notifications",
# "logging cns-events warnings",
# "logging console xml critical",
# "logging dmvpn rate-limit 10",
# "logging exception 4099",
# "logging facility local5",
# "logging monitor warnings",
# "logging on",
# "logging policy-firewall rate-limit 10",
# "logging trap errors",
# "logging userinfo",
# "logging host 172.16.1.12",
# "logging host 172.16.1.10 filtered stream 10",
# "logging host 172.16.1.13 transport tcp port 514",
# "logging message-counter log",
# "logging snmp-trap errors",
# "logging host 172.16.1.11 xml"
# ],
# After state:
# ------------
# router-ios#show running-config | section logging
# logging exception 4099
# logging message-counter log
# logging userinfo
# logging buffered xml 5099 notifications
# no logging reload
# no logging rate-limit
# logging console xml critical
# logging monitor warnings
# logging cns-events warnings
# logging policy-firewall rate-limit 10
# logging dmvpn rate-limit 10
# logging trap errors
# logging facility local5
# logging snmp-trap errors
# logging snmp-trap warnings
# logging host 172.16.1.13 transport tcp port 514
# logging host 172.16.1.11 xml
# logging host 172.16.1.12
# logging host 172.16.1.10 filtered stream 10
# Using state: deleted
# Before state:
# -------------
# router-ios#show running-config | section logging
# logging exception 4099
# logging message-counter log
# logging userinfo
# logging buffered xml 5099 notifications
# no logging reload
# no logging rate-limit
# logging console xml critical
# logging monitor warnings
# logging cns-events warnings
# logging policy-firewall rate-limit 10
# logging dmvpn rate-limit 10
# logging trap errors
# logging facility local5
# logging snmp-trap errors
# logging host 172.16.1.13 transport tcp port 514
# logging host 172.16.1.11 xml
# logging host 172.16.1.12
# logging host 172.16.1.10 filtered stream 10
- name: Remove all existing configuration
cisco.ios.ios_logging_global:
state: deleted
# Commands Fired:
# ---------------
# "commands": [
# "no logging message-counter log",
# "no logging snmp-trap errors",
# "no logging host 172.16.1.13",
# "no logging host 172.16.1.11",
# "no logging host 172.16.1.12",
# "no logging host 172.16.1.10",
# "no logging exception 4099",
# "no logging userinfo",
# "no logging buffered xml 5099 notifications",
# "no logging console xml critical",
# "no logging monitor warnings",
# "no logging cns-events warnings",
# "no logging policy-firewall rate-limit 10",
# "no logging dmvpn rate-limit 10",
# "no logging trap errors",
# "no logging facility local5"
# ],
# After state:
# ------------
# router-ios#show running-config | section logging
# no logging exception
# no logging buffered
# no logging reload
# no logging rate-limit
# no logging console
# no logging monitor
# no logging cns-events
# no logging trap
# Using state: overridden
# Before state:
# -------------
# router-ios#show running-config | section logging
# logging exception 4099
# logging message-counter log
# logging userinfo
# logging buffered 6000 critical
# no logging reload
# no logging rate-limit
# logging console xml critical
# logging monitor warnings
# logging cns-events warnings
# logging policy-firewall rate-limit 10
# logging dmvpn rate-limit 10
# logging trap errors
# logging facility local6
# logging host 172.16.1.13 transport tcp port 514
# logging host 172.16.1.12
# logging host 172.16.1.10 filtered stream 10
# logging host 172.16.1.25 filtered
- name: Override commands with provided configuration
cisco.ios.ios_logging_global:
config:
hosts:
- hostname: 172.16.1.27
filtered: True
state: overridden
# Commands Fired:
# ---------------
# "commands": [
# "no logging message-counter log",
# "no logging host 172.16.1.12",
# "no logging host 172.16.1.10",
# "no logging host 172.16.1.13",
# "no logging exception 4099",
# "no logging userinfo",
# "no logging console xml critical",
# "no logging monitor warnings",
# "no logging cns-events warnings",
# "no logging policy-firewall rate-limit 10",
# "no logging dmvpn rate-limit 10",
# "no logging trap errors",
# "no logging buffered 6000 critical",
# "no logging facility local6",
# "logging host 172.16.1.27 filtered",
# ],
# After state:
# ------------
# router-ios#show running-config | section logging
# no logging exception
# no logging buffered
# no logging reload
# no logging rate-limit
# no logging console
# no logging monitor
# no logging cns-events
# no logging trap
# logging host 172.16.1.27 filtered
# Using state: replaced
# Before state:
# -------------
# router-ios#show running-config | section logging
# logging exception 4099
# logging message-counter log
# logging userinfo
# logging buffered xml 5099 notifications
# no logging reload
# no logging rate-limit
# logging console xml critical
# logging monitor warnings
# logging cns-events warnings
# logging policy-firewall rate-limit 10
# logging dmvpn rate-limit 10
# logging trap errors
# logging facility local5
# logging snmp-trap errors
# logging host 172.16.1.13 transport tcp port 514
# logging host 172.16.1.11 xml
# logging host 172.16.1.12
# logging host 172.16.1.10 filtered stream 10
- name: Replace commands with provided configuration
cisco.ios.ios_logging_global:
config:
buffered:
severity: alerts
size: 6025
facility: local6
hosts:
- hostname: 172.16.1.19
- hostname: 172.16.1.10
filtered: true
stream: 15
state: replaced
# Commands Fired:
# ---------------
# "commands": [
# "no logging host 172.16.1.13",
# "no logging host 172.16.1.11",
# "no logging host 172.16.1.12",
# "no logging host 172.16.1.10",
# "logging host 172.16.1.19",
# "logging host 172.16.1.10 filtered stream 15",
# "logging buffered 6025 alerts",
# "logging facility local6"
# ],
# After state:
# ------------
# router-ios#show running-config | section logging
# logging exception 4099
# logging message-counter log
# logging userinfo
# logging buffered 6025 alerts
# no logging reload
# no logging rate-limit
# logging console xml critical
# logging monitor warnings
# logging cns-events warnings
# logging policy-firewall rate-limit 10
# logging dmvpn rate-limit 10
# logging trap errors
# logging facility local6
# logging snmp-trap errors
# logging host 172.16.1.19
# Using state: gathered
# Before state:
# -------------
#router-ios#show running-config | section logging
# logging exception 4099
# logging message-counter log
# logging userinfo
# logging buffered xml 5099 notifications
# no logging reload
# no logging rate-limit
# logging console xml critical
# logging monitor warnings
# logging cns-events warnings
# logging policy-firewall rate-limit 10
# logging dmvpn rate-limit 10
# logging trap errors
# logging facility local5
# logging snmp-trap errors
# logging host 172.16.1.13 transport tcp port 514
# logging host 172.16.1.11 xml
# logging host 172.16.1.12
# logging host 172.16.1.10 filtered stream 10
# logging host 172.16.1.25 filtered
- name: Gather listed logging config
cisco.ios.ios_logging_global:
state: gathered
# Module Execution Result:
# ------------------------
# "gathered": {
# "buffered": {
# "severity": "notifications",
# "size": 5099,
# "xml": true
# },
# "cns_events": "warnings",
# "console": {
# "severity": "critical",
# "xml": true
# },
# "dmvpn": {
# "rate_limit": 10
# },
# "exception": 4099,
# "facility": "local5",
# "hosts": [
# {
# "hostname": "172.16.1.11",
# "xml": true
# },
# {
# "hostname": "172.16.1.12"
# },
# {
# "filtered": true,
# "hostname": "172.16.1.10",
# "stream": 10
# },
# {
# "hostname": "172.16.1.13",
# "transport": {
# "tcp": {
# "port": 514
# }
# }
# },
# {
# "filtered": true,
# "hostname": "172.16.1.25"
# }
# ],
# "message_counter": [
# "log"
# ],
# "monitor": {
# "severity": "warnings"
# },
# "policy_firewall": {
# "rate_limit": 10
# },
# "snmp_trap": [
# "errors"
# ],
# "trap": "errors",
# "userinfo": true
# },
# After state:
# -------------
# router-ios#show running-config | section logging
# logging exception 4099
# logging message-counter log
# logging userinfo
# logging buffered xml 5099 notifications
# no logging reload
# no logging rate-limit
# logging console xml critical
# logging monitor warnings
# logging cns-events warnings
# logging policy-firewall rate-limit 10
# logging dmvpn rate-limit 10
# logging trap errors
# logging facility local5
# logging snmp-trap errors
# logging host 172.16.1.13 transport tcp port 514
# logging host 172.16.1.11 xml
# logging host 172.16.1.12
# logging host 172.16.1.10 filtered stream 10
# logging host 172.16.1.25 filtered
# Using state: rendered
- name: Render the commands for provided configuration
cisco.ios.ios_logging_global:
config:
buffered:
severity: notifications
size: 5099
xml: True
console:
severity: critical
xml: True
facility: local5
hosts:
- hostname: 172.16.1.12
- hostname: 172.16.1.11
xml: True
- hostname: 172.16.1.10
filtered: True
stream: 10
- hostname: 172.16.1.13
transport:
tcp:
port: 514
monitor:
severity: warnings
message_counter: log
snmp_trap: errors
trap: errors
userinfo: True
policy_firewall:
rate_limit: 10
logging_on: True
exception: 10
dmvpn:
rate_limit: 10
cns_events: warnings
state: rendered
# Module Execution Result:
# ------------------------
# "rendered": [
# "logging host 172.16.1.12",
# "logging host 172.16.1.11 xml",
# "logging host 172.16.1.10 filtered stream 10",
# "logging host 172.16.1.13 transport tcp port 514",
# "logging message-counter log",
# "logging snmp-trap errors",
# "logging buffered xml 5099 notifications",
# "logging console xml critical",
# "logging facility local5",
# "logging monitor warnings",
# "logging trap errors",
# "logging userinfo",
# "logging policy-firewall rate-limit 10",
# "logging on",
# "logging exception 10",
# "logging dmvpn rate-limit 10",
# "logging cns-events warnings"
# ]
# Using state: parsed
# File: parsed.cfg
# ----------------
# logging on
# logging count
# logging userinfo
# logging trap errors
# logging reload alerts
# logging host 172.16.1.1
# logging exception 4099
# logging history alerts
# logging facility local5
# logging snmp-trap errors
# logging monitor warnings
# logging origin-id hostname
# logging host 172.16.1.11 xml
# logging cns-events warnings
# logging dmvpn rate-limit 10
# logging message-counter log
# logging console xml critical
# logging message-counter debug
# logging persistent batch 4444
# logging host 172.16.1.25 filtered
# logging source-interface GBit1/0
# logging source-interface CTunnel2
# logging policy-firewall rate-limit 10
# logging buffered xml 5099 notifications
# logging rate-limit all 2 except warnings
# logging host 172.16.1.10 filtered stream 10
# logging host 172.16.1.13 transport tcp port 514
# logging discriminator msglog01 severity includes 5
# logging filter tftp://172.16.2.18/ESM/elate.tcl args TESTInst2
# logging filter tftp://172.16.2.14/ESM/escalate.tcl args TESTInst
- name: Parse the provided configuration with the existing running configuration
cisco.ios.ios_logging_global:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
# "parsed": {
# "buffered": {
# "severity": "notifications",
# "size": 5099,
# "xml": true
# },
# "cns_events": "warnings",
# "console": {
# "severity": "critical",
# "xml": true
# },
# "count": true,
# "discriminator": [
# "msglog01 severity includes 5"
# ],
# "dmvpn": {
# "rate_limit": 10
# },
# "exception": 4099,
# "facility": "local5",
# "filter": [
# {
# "args": "TESTInst2",
# "url": "tftp://172.16.2.18/ESM/elate.tcl"
# },
# {
# "args": "TESTInst",
# "url": "tftp://172.16.2.14/ESM/escalate.tcl"
# }
# ],
# "history": {
# "severity": "alerts"
# },
# "hosts": [
# {
# "hostname": "172.16.1.1"
# },
# {
# "hostname": "172.16.1.11",
# "xml": true
# },
# {
# "filtered": true,
# "hostname": "172.16.1.25"
# },
# {
# "filtered": true,
# "hostname": "172.16.1.10",
# "stream": 10
# },
# {
# "hostname": "172.16.1.13",
# "transport": {
# "tcp": {
# "port": 514
# }
# }
# }
# ],
# "logging_on": "enable",
# "message_counter": [
# "log",
# "debug"
# ],
# "monitor": {
# "severity": "warnings"
# },
# "origin_id": {
# "tag": "hostname"
# },
# "persistent": {
# "batch": 4444
# },
# "policy_firewall": {
# "rate_limit": 10
# },
# "rate_limit": {
# "all": true,
# "except_severity": "warnings",
# "size": 2
# },
# "reload": {
# "severity": "alerts"
# },
# "snmp_trap": [
# "errors"
# ],
# "source_interface": [
# {
# "interface": "GBit1/0"
# },
# {
# "interface": "CTunnel2"
# }
# ],
# "trap": "errors",
# "userinfo": true
# }
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** dictionary | when changed | The resulting configuration model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** dictionary | always | The configuration prior to the model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device. **Sample:** ['logging on', 'logging userinfo', 'logging trap errors', 'logging host 172.16.1.12', 'logging console xml critical', 'logging message-counter log', 'logging policy-firewall rate-limit 10'] |
### Authors
* Sagar Paul (@KB-perByte)
| programming_docs |
ansible cisco.ios.ios_logging β (deprecated, removed after 2023-06-01) Manage logging on network devices cisco.ios.ios\_logging β (deprecated, removed after 2023-06-01) Manage logging on network devices
=================================================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_logging`.
New in version 1.0.0: of cisco.ios
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2023-06-01
Why
Newer and updated modules released with more functionality.
Alternative
ios\_logging\_global
Synopsis
--------
* This module provides declarative management of logging on Cisco Ios devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** list / elements=dictionary | | List of logging definitions. |
| | **dest** string | **Choices:*** on
* host
* console
* monitor
* buffered
* trap
| Destination of the logs. On dest has to be quoted as 'on' or else pyyaml will convert to True before it gets to Ansible. |
| | **facility** string | | Set logging facility. |
| | **level** string | **Choices:*** emergencies
* alerts
* critical
* errors
* warnings
* notifications
* informational
* debugging
| Set logging severity levels. |
| | **name** string | | The hostname or IP address of the destination. Required when *dest=host*. |
| | **size** integer | | Size of buffer. The acceptable value is in range from 4096 to 4294967295 bytes. |
| | **state** string | **Choices:*** present
* absent
| State of the logging configuration. |
| **dest** string | **Choices:*** on
* host
* console
* monitor
* buffered
* trap
| Destination of the logs. On dest has to be quoted as 'on' or else pyyaml will convert to True before it gets to Ansible. |
| **facility** string | | Set logging facility. |
| **level** string | **Choices:*** emergencies
* alerts
* critical
* errors
* warnings
* notifications
* informational
* **debugging** β
| Set logging severity levels. |
| **name** string | | The hostname or IP address of the destination. Required when *dest=host*. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **size** integer | | Size of buffer. The acceptable value is in range from 4096 to 4294967295 bytes. |
| **state** string | **Choices:*** **present** β
* absent
| State of the logging configuration. |
Notes
-----
Note
* Tested against IOS 15.6
* The βDefault System Message Logging Configurationβ of the ios device like facility Local7 or logging on is not subjected to idempotency causes
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: configure host logging
cisco.ios.ios_logging:
dest: host
name: 172.16.0.1
state: present
- name: remove host logging configuration
cisco.ios.ios_logging:
dest: host
name: 172.16.0.1
state: absent
- name: configure console logging level and facility
cisco.ios.ios_logging:
dest: console
facility: local7
level: debugging
state: present
- name: enable logging to all
cisco.ios.ios_logging:
dest: on
- name: configure buffer size
cisco.ios.ios_logging:
dest: buffered
size: 5000
- name: Configure logging using aggregate
cisco.ios.ios_logging:
aggregate:
- {dest: console, level: notifications}
- {dest: buffered, size: 9000}
- name: remove logging using aggregate
cisco.ios.ios_logging:
aggregate:
- {dest: console, level: notifications}
- {dest: buffered, size: 9000}
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['logging facility local7', 'logging host 172.16.0.1'] |
Status
------
* This module will be removed in a major release after 2023-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Trishna Guha (@trishnaguha)
ansible cisco.ios.ios_interfaces β Interfaces resource module cisco.ios.ios\_interfaces β Interfaces resource module
======================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_interfaces`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module manages the interface attributes of Cisco IOS network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A dictionary of interface options |
| | **description** string | | Interface description. |
| | **duplex** string | **Choices:*** full
* half
* auto
| Interface link status. Applicable for Ethernet interfaces only, either in half duplex, full duplex or in automatic state which negotiates the duplex automatically. |
| | **enabled** boolean | **Choices:*** no
* **yes** β
| Administrative state of the interface. Set the value to `true` to administratively enable the interface or `false` to disable it. |
| | **mtu** integer | | MTU for a specific interface. Applicable for Ethernet interfaces only. Refer to vendor documentation for valid values. |
| | **name** string / required | | Full name of interface, e.g. GigabitEthernet0/2, loopback999. |
| | **speed** string | | Interface link speed. Applicable for Ethernet interfaces only. |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **show running-config | section ^interface**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* rendered
* gathered
* parsed
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL
Examples
--------
```
# Using merged
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# no ip address
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description This is test
# no ip address
# duplex auto
# speed 1000
# interface GigabitEthernet0/3
# no ip address
# duplex auto
# speed auto
- name: Merge provided configuration with device configuration
cisco.ios.ios_interfaces:
config:
- name: GigabitEthernet0/2
description: Configured and Merged by Ansible Network
enabled: true
- name: GigabitEthernet0/3
description: Configured and Merged by Ansible Network
mtu: 2800
enabled: false
speed: 100
duplex: full
state: merged
# After state:
# ------------
#
# vios#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# no ip address
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description Configured and Merged by Ansible Network
# no ip address
# duplex auto
# speed 1000
# interface GigabitEthernet0/3
# description Configured and Merged by Ansible Network
# mtu 2800
# no ip address
# shutdown
# duplex full
# speed 100
# Using replaced
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface GigabitEthernet0/1
# no ip address
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description Configured by Ansible Network
# no ip address
# duplex auto
# speed 1000
# interface GigabitEthernet0/3
# mtu 2000
# no ip address
# shutdown
# duplex full
# speed 100
- name: Replaces device configuration of listed interfaces with provided configuration
cisco.ios.ios_interfaces:
config:
- name: GigabitEthernet0/3
description: Configured and Replaced by Ansible Network
enabled: false
duplex: auto
mtu: 2500
speed: 1000
state: replaced
# After state:
# -------------
#
# vios#show running-config | section ^interface
# interface GigabitEthernet0/1
# no ip address
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description Configured by Ansible Network
# no ip address
# duplex auto
# speed 1000
# interface GigabitEthernet0/3
# description Configured and Replaced by Ansible Network
# mtu 2500
# no ip address
# shutdown
# duplex auto
# speed 1000
# Using overridden
# Before state:
# -------------
#
# vios#show running-config | section ^interface#
# interface GigabitEthernet0/1
# description Configured by Ansible
# no ip address
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description This is test
# no ip address
# duplex auto
# speed 1000
# interface GigabitEthernet0/3
# description Configured by Ansible
# mtu 2800
# no ip address
# shutdown
# duplex full
# speed 100
- name: Override device configuration of all interfaces with provided configuration
cisco.ios.ios_interfaces:
config:
- name: GigabitEthernet0/2
description: Configured and Overridden by Ansible Network
speed: 1000
- name: GigabitEthernet0/3
description: Configured and Overridden by Ansible Network
enabled: false
duplex: full
mtu: 2000
state: overridden
# After state:
# -------------
#
# vios#show running-config | section ^interface
# interface GigabitEthernet0/1
# no ip address
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description Configured and Overridden by Ansible Network
# no ip address
# duplex auto
# speed 1000
# interface GigabitEthernet0/3
# description Configured and Overridden by Ansible Network
# mtu 2000
# no ip address
# shutdown
# duplex full
# speed auto
# Using Deleted
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface GigabitEthernet0/1
# no ip address
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description Configured by Ansible Network
# no ip address
# duplex auto
# speed 1000
# interface GigabitEthernet0/3
# description Configured by Ansible Network
# mtu 2500
# no ip address
# shutdown
# duplex full
# speed 1000
- name: "Delete module attributes of given interfaces (Note: This won't delete the interface itself)"
cisco.ios.ios_interfaces:
config:
- name: GigabitEthernet0/2
state: deleted
# After state:
# -------------
#
# vios#show running-config | section ^interface
# interface GigabitEthernet0/1
# no ip address
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# no ip address
# duplex auto
# speed auto
# interface GigabitEthernet0/3
# description Configured by Ansible Network
# mtu 2500
# no ip address
# shutdown
# duplex full
# speed 1000
# Using Deleted without any config passed
#"(NOTE: This will delete all of configured resource module attributes from each configured interface)"
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface GigabitEthernet0/1
# no ip address
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description Configured by Ansible Network
# no ip address
# duplex auto
# speed 1000
# interface GigabitEthernet0/3
# description Configured by Ansible Network
# mtu 2500
# no ip address
# shutdown
# duplex full
# speed 1000
- name: "Delete module attributes of all interfaces (Note: This won't delete the interface itself)"
cisco.ios.ios_interfaces:
state: deleted
# After state:
# -------------
#
# vios#show running-config | section ^interface
# interface GigabitEthernet0/1
# no ip address
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# no ip address
# duplex auto
# speed auto
# interface GigabitEthernet0/3
# no ip address
# duplex auto
# speed auto
# Using Gathered
# Before state:
# -------------
#
# vios#sh running-config | section ^interface
# interface GigabitEthernet0/1
# description this is interface1
# mtu 65
# duplex auto
# speed 10
# interface GigabitEthernet0/2
# description this is interface2
# mtu 110
# shutdown
# duplex auto
# speed 100
- name: Gather listed interfaces with provided configurations
cisco.ios.ios_interfaces:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "description": "this is interface1",
# "duplex": "auto",
# "enabled": true,
# "mtu": 65,
# "name": "GigabitEthernet0/1",
# "speed": "10"
# },
# {
# "description": "this is interface2",
# "duplex": "auto",
# "enabled": false,
# "mtu": 110,
# "name": "GigabitEthernet0/2",
# "speed": "100"
# }
# ]
# After state:
# ------------
#
# vios#sh running-config | section ^interface
# interface GigabitEthernet0/1
# description this is interface1
# mtu 65
# duplex auto
# speed 10
# interface GigabitEthernet0/2
# description this is interface2
# mtu 110
# shutdown
# duplex auto
# speed 100
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_interfaces:
config:
- name: GigabitEthernet0/1
description: Configured by Ansible-Network
mtu: 110
enabled: true
duplex: half
- name: GigabitEthernet0/2
description: Configured by Ansible-Network
mtu: 2800
enabled: false
speed: 100
duplex: full
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "interface GigabitEthernet0/1",
# "description Configured by Ansible-Network",
# "mtu 110",
# "duplex half",
# "no shutdown",
# "interface GigabitEthernet0/2",
# "description Configured by Ansible-Network",
# "mtu 2800",
# "speed 100",
# "duplex full",
# "shutdown"
# Using Parsed
# File: parsed.cfg
# ----------------
#
# interface GigabitEthernet0/1
# description interfaces 0/1
# mtu 110
# duplex half
# no shutdown
# interface GigabitEthernet0/2
# description interfaces 0/2
# mtu 2800
# speed 100
# duplex full
# shutdown
- name: Parse the commands for provided configuration
cisco.ios.ios_interfaces:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "description": "interfaces 0/1",
# "duplex": "half",
# "enabled": true,
# "mtu": 110,
# "name": "GigabitEthernet0/1"
# },
# {
# "description": "interfaces 0/2",
# "duplex": "full",
# "enabled": true,
# "mtu": 2800,
# "name": "GigabitEthernet0/2",
# "speed": "100"
# }
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device **Sample:** ['interface GigabitEthernet 0/1', 'description This is test', 'speed 100'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ios.ios_prefix_lists β Prefix Lists resource module cisco.ios.ios\_prefix\_lists β Prefix Lists resource module
===========================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_prefix_lists`.
New in version 2.2.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module configures and manages the attributes of prefix list on Cisco IOS.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A list of configurations for Prefix lists. |
| | **afi** string | **Choices:*** ipv4
* ipv6
| The Address Family Indicator (AFI) for the prefix list. |
| | **prefix\_lists** list / elements=dictionary | | List of Prefix-lists. |
| | | **description** string | | Prefix-list specific description |
| | | **entries** list / elements=dictionary | | Prefix-lists supported params. |
| | | | **action** string | **Choices:*** deny
* permit
| Specify packets to be rejected or forwarded |
| | | | **description** string | | Prefix-list specific description Description param at entries level is DEPRECATED New Description is introduced at prefix\_lists level, please use the Description param defined at prefix\_lists level instead of Description param at entries level, as at this level description option will get removed in a future release. |
| | | | **ge** integer | | Minimum prefix length to be matched |
| | | | **le** integer | | Maximum prefix length to be matched |
| | | | **prefix** string | | IPv4 prefix <network>/<length>, e.g., A.B.C.D/nn IPv6 prefix <network>/<length>, e.g., X:X:X:X::X/<0-128> |
| | | | **sequence** integer | | sequence number of an entry |
| | | **name** string | | Name of a prefix-list |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **sh bgp**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* gathered
* parsed
* rendered
| The state the configuration should be left in The states *merged* is the default state which merges the want and have config, but for Prefix-List module as the IOS platform doesn't allow update of Prefix-List over an pre-existing Prefix-List, same way Prefix-Lists resource module will error out for respective scenario and only addition of new Prefix-List over new sequence will be allowed with merge state. The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *sh running-config | section ^ip prefix-list|^ipv6 prefix-list* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL
* This module works with connection `network_cli`. See [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios)
Examples
--------
```
# Using deleted by Name
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Delete provided Prefix lists config by Prefix name
cisco.ios.ios_prefix_lists:
config:
- afi: ipv4
prefix_lists:
- name: 10
- name: test_prefix
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "no ip prefix-list 10",
# "no ip prefix-list test_prefix"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
# Using deleted by AFI
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Delete provided Prefix lists config by AFI
cisco.ios.ios_prefix_lists:
config:
- afi: ipv4
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "no ip prefix-list test",
# "no ip prefix-list 10",
# "no ip prefix-list test_prefix"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
# Using deleted without any config passed (NOTE: This will delete all Prefix lists configuration from device)
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Delete all Prefix lists config
cisco.ios.ios_prefix_lists:
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "no ip prefix-list test",
# "no ip prefix-list 10",
# "no ip prefix-list test_prefix",
# "no ipv6 prefix-list test_ipv6"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# router-ios#
# Using merged
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ipv6 prefix-list test_ipv6 description this is ipv6
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Merge provided Prefix lists configuration
cisco.ios.ios_prefix_lists:
config:
- afi: ipv6
prefix_lists:
- name: test_ipv6
description: this is ipv6 merge test
entries:
- action: deny
prefix: 2001:DB8:0:4::/64
ge: 80
le: 100
sequence: 10
state: merged
# After state:
# -------------
#
# Play Execution fails, with error:
# Cannot update existing sequence 10 of Prefix Lists test_ipv6 with state merged.
# Please use state replaced or overridden.
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ipv6 prefix-list test_ipv6 description this is ipv6
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Merge provided Prefix lists configuration
cisco.ios.ios_prefix_lists:
config:
- afi: ipv4
prefix_lists:
- name: 10
description: this is new merge test
entries:
- action: deny
prefix: 1.0.0.0/8
le: 15
sequence: 5
- action: deny
prefix: 35.0.0.0/8
ge: 10
sequence: 10
- action: deny
prefix: 12.0.0.0/8
ge: 15
sequence: 15
- action: deny
prefix: 14.0.0.0/8
ge: 20
le: 21
sequence: 20
- name: test
description: this is merge test
entries:
- action: deny
prefix: 12.0.0.0/8
ge: 15
sequence: 50
- name: test_prefix
description: this is for prefix-list
entries:
- action: deny
prefix: 35.0.0.0/8
ge: 10
le: 15
sequence: 5
- action: deny
prefix: 35.0.0.0/8
ge: 20
sequence: 10
- afi: ipv6
prefix_lists:
- name: test_ipv6
description: this is ipv6 merge test
entries:
- action: deny
prefix: 2001:DB8:0:4::/64
ge: 80
le: 100
sequence: 20
state: merged
# Commands Fired:
# ---------------
#
# "commands": [
# "ip prefix-list test description this is merge test",
# "ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15",
# "ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15",
# "ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10",
# "ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15",
# "ip prefix-list 10 description this is new merge test",
# "ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21",
# "ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20",
# "ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15",
# "ip prefix-list test_prefix description this is for prefix-list",
# "ipv6 prefix-list test_ipv6 seq 20 deny 2001:DB8:0:4::/64 ge 80 le 100",
# "ipv6 prefix-list test_ipv6 description this is ipv6 merge test"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is new merge test
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is merge test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 merge test
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100
# Using overridden
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Override provided Prefix lists configuration
cisco.ios.ios_prefix_lists:
config:
- afi: ipv4
prefix_lists:
- name: 10
description: this is override test
entries:
- action: deny
prefix: 12.0.0.0/8
ge: 15
sequence: 15
- action: deny
prefix: 14.0.0.0/8
ge: 20
le: 21
sequence: 20
- name: test_override
description: this is override test
entries:
- action: deny
prefix: 35.0.0.0/8
ge: 20
sequence: 10
- afi: ipv6
prefix_lists:
- name: test_ipv6
description: this is ipv6 override test
entries:
- action: deny
prefix: 2001:DB8:0:4::/64
ge: 80
le: 100
sequence: 10
state: overridden
# Commands Fired:
# ---------------
#
# "commands": [
# "no ip prefix-list test",
# "no ip prefix-list test_prefix",
# "ip prefix-list 10 description this is override test",
# "no ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10",
# "no ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15",
# "ip prefix-list test_override seq 10 deny 35.0.0.0/8 ge 20",
# "ip prefix-list test_override description this is override test",
# "no ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80",
# "ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100",
# "ipv6 prefix-list test_ipv6 description this is ipv6 override test"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is override test
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test_override description this is override test
# ip prefix-list test_override seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 override test
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100
# Using replaced
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Replaced provided Prefix lists configuration
cisco.ios.ios_prefix_lists:
config:
- afi: ipv4
prefix_lists:
- name: 10
description: this is replace test
entries:
- action: deny
prefix: 12.0.0.0/8
ge: 15
sequence: 15
- action: deny
prefix: 14.0.0.0/8
ge: 20
le: 21
sequence: 20
- name: test_replace
description: this is replace test
entries:
- action: deny
prefix: 35.0.0.0/8
ge: 20
sequence: 10
- afi: ipv6
prefix_lists:
- name: test_ipv6
description: this is ipv6 replace test
entries:
- action: deny
prefix: 2001:DB8:0:4::/64
ge: 80
le: 100
sequence: 10
state: replaced
# Commands Fired:
# ---------------
# "commands": [
# "ip prefix-list 10 description this is replace test",
# "no ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10",
# "no ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15",
# "ip prefix-list test_replace seq 10 deny 35.0.0.0/8 ge 20",
# "ip prefix-list test_replace description this is replace test",
# "no ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80",
# "ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100",
# "ipv6 prefix-list test_ipv6 description this is ipv6 replace test"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is replace test
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ip prefix-list test_replace description this is replace test
# ip prefix-list test_replace seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 replace test
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 le 100
# Using Gathered
# Before state:
# -------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Gather Prefix lists provided configurations
cisco.ios.ios_prefix_lists:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "afi": "ipv4",
# "prefix_lists": [
# {
# "description": "this is test description"
# "entries": [
# {
# "action": "deny",
# "le": 15,
# "prefix": "1.0.0.0/8",
# "sequence": 5
# },
# {
# "action": "deny",
# "ge": 10,
# "prefix": "35.0.0.0/8",
# "sequence": 10
# },
# {
# "action": "deny",
# "ge": 15,
# "prefix": "12.0.0.0/8",
# "sequence": 15
# },
# {
# "action": "deny",
# "ge": 20,
# "le": 21,
# "prefix": "14.0.0.0/8",
# "sequence": 20
# }
# ],
# "name": "10"
# },
# {
# "description": "this is test"
# "entries": [
# {
# "action": "deny",
# "ge": 15,
# "prefix": "12.0.0.0/8",
# "sequence": 50
# }
# ],
# "name": "test"
# },
# {
# "description": "this is for prefix-list"
# "entries": [
# {
# "action": "deny",
# "ge": 10,
# "le": 15,
# "prefix": "35.0.0.0/8",
# "sequence": 5
# },
# {
# "action": "deny",
# "ge": 20,
# "prefix": "35.0.0.0/8",
# "sequence": 10
# }
# ],
# "name": "test_prefix"
# }
# ]
# },
# {
# "afi": "ipv6",
# "prefix_lists": [
# {
# "description": "this is ipv6 prefix-list"
# "entries": [
# {
# "action": "deny",
# "ge": 80,
# "prefix": "2001:DB8:0:4::/64",
# "sequence": 10
# }
# ],
# "name": "test_ipv6"
# }
# ]
# }
# ]
# After state:
# ------------
#
# router-ios#sh running-config | section ^ip prefix-list|^ipv6 prefix-list
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_prefix_lists:
config:
- afi: ipv4
prefix_lists:
- name: 10
description: this is new merge test
entries:
- action: deny
prefix: 1.0.0.0/8
le: 15
sequence: 5
- action: deny
prefix: 35.0.0.0/8
ge: 10
sequence: 10
- action: deny
prefix: 12.0.0.0/8
ge: 15
sequence: 15
- action: deny
prefix: 14.0.0.0/8
ge: 20
le: 21
sequence: 20
- name: test
description: this is merge test
entries:
- action: deny
prefix: 12.0.0.0/8
ge: 15
sequence: 50
- name: test_prefix
description: this is for prefix-list
entries:
- action: deny
prefix: 35.0.0.0/8
ge: 10
le: 15
sequence: 5
- action: deny
prefix: 35.0.0.0/8
ge: 20
sequence: 10
- afi: ipv6
prefix_lists:
- name: test_ipv6
description: this is ipv6 merge test
entries:
- action: deny
prefix: 2001:DB8:0:4::/64
ge: 80
le: 100
sequence: 10
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "ip prefix-list test description this is test",
# "ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15",
# "ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15",
# "ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10",
# "ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15",
# "ip prefix-list 10 description this is test description",
# "ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21",
# "ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20",
# "ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15",
# "ip prefix-list test_prefix description this is for prefix-list",
# "ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80 l2 100",
# "ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# ip prefix-list 10 description this is test description
# ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15
# ip prefix-list 10 seq 10 deny 35.0.0.0/8 ge 10
# ip prefix-list 10 seq 15 deny 12.0.0.0/8 ge 15
# ip prefix-list 10 seq 20 deny 14.0.0.0/8 ge 20 le 21
# ip prefix-list test description this is test
# ip prefix-list test seq 50 deny 12.0.0.0/8 ge 15
# ip prefix-list test_prefix description this is for prefix-list
# ip prefix-list test_prefix seq 5 deny 35.0.0.0/8 ge 10 le 15
# ip prefix-list test_prefix seq 10 deny 35.0.0.0/8 ge 20
# ipv6 prefix-list test_ipv6 description this is ipv6 prefix-list
# ipv6 prefix-list test_ipv6 seq 10 deny 2001:DB8:0:4::/64 ge 80
- name: Parse the provided configuration with the existing running configuration
cisco.ios.ios_prefix_lists:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "afi": "ipv4",
# "prefix_lists": [
# {
# "description": "this is test description"
# "entries": [
# {
# "action": "deny",
# "le": 15,
# "prefix": "1.0.0.0/8",
# "sequence": 5
# },
# {
# "action": "deny",
# "ge": 10,
# "prefix": "35.0.0.0/8",
# "sequence": 10
# },
# {
# "action": "deny",
# "ge": 15,
# "prefix": "12.0.0.0/8",
# "sequence": 15
# },
# {
# "action": "deny",
# "ge": 20,
# "le": 21,
# "prefix": "14.0.0.0/8",
# "sequence": 20
# }
# ],
# "name": "10"
# },
# {
# "description": "this is test"
# "entries": [
# {
# "action": "deny",
# "ge": 15,
# "prefix": "12.0.0.0/8",
# "sequence": 50
# }
# ],
# "name": "test"
# },
# {
# "description": "this is for prefix-list"
# "entries": [
# {
# "action": "deny",
# "ge": 10,
# "le": 15,
# "prefix": "35.0.0.0/8",
# "sequence": 5
# },
# {
# "action": "deny",
# "ge": 20,
# "prefix": "35.0.0.0/8",
# "sequence": 10
# }
# ],
# "name": "test_prefix"
# }
# ]
# },
# {
# "afi": "ipv6",
# "prefix_lists": [
# {
# "description": "this is ipv6 prefix-list"
# "entries": [
# {
# "action": "deny",
# "ge": 80,
# "prefix": "2001:DB8:0:4::/64",
# "sequence": 10
# }
# ],
# "name": "test_ipv6"
# }
# ]
# }
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The resulting configuration model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration prior to the model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device. **Sample:** ['ip prefix-list 10 description this is test description', 'ip prefix-list 10 seq 5 deny 1.0.0.0/8 le 15'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ios.ios_bgp β Configure global BGP protocol settings on Cisco IOS. cisco.ios.ios\_bgp β Configure global BGP protocol settings on Cisco IOS.
=========================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_bgp`.
New in version 1.0.0: of cisco.ios
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2023-08-24
Why
Newer and updated modules released with more functionality
Alternative
ios\_bgp\_global
Synopsis
--------
* This module provides configuration management of global BGP parameters on devices running Cisco IOS
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** dictionary | | Specifies the BGP related configuration. |
| | **address\_family** list / elements=dictionary | | Specifies BGP address family related configurations. |
| | | **afi** string / required | **Choices:*** ipv4
* ipv6
| Type of address family to configure. |
| | | **auto\_summary** boolean | **Choices:*** no
* yes
| Enable/disable automatic network number summarization. |
| | | **neighbors** list / elements=dictionary | | Specifies BGP neighbor related configurations in Address Family configuration mode. |
| | | | **activate** boolean | **Choices:*** no
* yes
| Enable the Address Family for this Neighbor. |
| | | | **advertisement\_interval** integer | | Minimum interval between sending BGP routing updates for this neighbor. |
| | | | **maximum\_prefix** integer | | Maximum number of prefixes to accept from this peer. The range is from 1 to 2147483647. |
| | | | **neighbor** string / required | | Neighbor router address. |
| | | | **next\_hop\_self** boolean | **Choices:*** no
* yes
| Enable/disable the next hop calculation for this neighbor. |
| | | | **next\_hop\_unchanged** boolean | **Choices:*** no
* yes
| Propagate next hop unchanged for iBGP paths to this neighbor. |
| | | | **prefix\_list\_in** string | | Name of ip prefix-list to apply to incoming prefixes. |
| | | | **prefix\_list\_out** string | | Name of ip prefix-list to apply to outgoing prefixes. |
| | | | **remove\_private\_as** boolean | **Choices:*** no
* yes
| Remove the private AS number from outbound updates. |
| | | | **route\_reflector\_client** boolean | **Choices:*** no
* yes
| Specify a neighbor as a route reflector client. |
| | | | **route\_server\_client** boolean | **Choices:*** no
* yes
| Specify a neighbor as a route server client. |
| | | **networks** list / elements=dictionary | | Specify Networks to announce via BGP. For operation replace, this option is mutually exclusive with root level networks option. |
| | | | **masklen** integer | | Subnet mask length for the Network to announce(e.g, 8, 16, 24, etc.). |
| | | | **prefix** string / required | | Network ID to announce via BGP. |
| | | | **route\_map** string | | Route map to modify the attributes. |
| | | **redistribute** list / elements=dictionary | | Specifies the redistribute information from another routing protocol. |
| | | | **id** string | | Identifier for the routing protocol for configuring redistribute information. Valid for protocols 'ospf', 'ospfv3' and 'eigrp'. |
| | | | **metric** integer | | Specifies the metric for redistributed routes. |
| | | | **protocol** string / required | **Choices:*** ospf
* ospfv3
* eigrp
* isis
* static
* connected
* odr
* lisp
* mobile
* rip
| Specifies the protocol for configuring redistribute information. |
| | | | **route\_map** string | | Specifies the route map reference. |
| | | **safi** string | **Choices:*** flowspec
* **unicast** β
* multicast
* labeled-unicast
| Specifies the type of cast for the address family. |
| | | **synchronization** boolean | **Choices:*** no
* yes
| Enable/disable IGP synchronization. |
| | **bgp\_as** integer / required | | Specifies the BGP Autonomous System (AS) number to configure on the device. |
| | **log\_neighbor\_changes** boolean | **Choices:*** no
* yes
| Enable/disable logging neighbor up/down and reset reason. |
| | **neighbors** list / elements=dictionary | | Specifies BGP neighbor related configurations. |
| | | **description** string | | Neighbor specific description. |
| | | **ebgp\_multihop** integer | | Specifies the maximum hop count for EBGP neighbors not on directly connected networks. The range is from 1 to 255. |
| | | **enabled** boolean | **Choices:*** no
* yes
| Administratively shutdown or enable a neighbor. |
| | | **local\_as** integer | | The local AS number for the neighbor. |
| | | **neighbor** string / required | | Neighbor router address. |
| | | **password** string | | Password to authenticate the BGP peer connection. |
| | | **peer\_group** string | | Name of the peer group that the neighbor is a member of. |
| | | **remote\_as** integer / required | | Remote AS of the BGP neighbor to configure. |
| | | **timers** dictionary | | Specifies BGP neighbor timer related configurations. |
| | | | **holdtime** integer / required | | Interval (in seconds) after not receiving a keepalive message that IOS declares a peer dead. The range is from 0 to 65535. |
| | | | **keepalive** integer / required | | Frequency (in seconds) with which the device sends keepalive messages to its peer. The range is from 0 to 65535. |
| | | | **min\_neighbor\_holdtime** integer | | Interval (in seconds) specifying the minimum acceptable hold-time from a BGP neighbor. The minimum acceptable hold-time must be less than, or equal to, the interval specified in the holdtime argument. The range is from 0 to 65535. |
| | | **update\_source** string | | Source of the routing updates. |
| | **networks** list / elements=dictionary | | Specify Networks to announce via BGP. For operation replace, this option is mutually exclusive with networks option under address\_family. For operation replace, if the device already has an address family activated, this option is not allowed. |
| | | **masklen** integer | | Subnet mask length for the Network to announce(e.g, 8, 16, 24, etc.). |
| | | **prefix** string / required | | Network ID to announce via BGP. |
| | | **route\_map** string | | Route map to modify the attributes. |
| | **router\_id** string | | Configures the BGP routing process router-id value. |
| **operation** string | **Choices:*** **merge** β
* replace
* override
* delete
| Specifies the operation to be performed on the BGP process configured on the device. In case of merge, the input configuration will be merged with the existing BGP configuration on the device. In case of replace, if there is a diff between the existing configuration and the input configuration, the existing configuration will be replaced by the input configuration for every option that has the diff. In case of override, all the existing BGP configuration will be removed from the device and replaced with the input configuration. In case of delete the existing BGP configuration will be removed from the device. |
Notes
-----
Note
* Tested against Cisco IOS Version 15.6(3)M2
Examples
--------
```
- name: configure global bgp as 64496
cisco.ios.ios_bgp:
config:
bgp_as: 64496
router_id: 192.0.2.1
log_neighbor_changes: true
neighbors:
- neighbor: 203.0.113.5
remote_as: 64511
timers:
keepalive: 300
holdtime: 360
min_neighbor_holdtime: 360
- neighbor: 198.51.100.2
remote_as: 64498
networks:
- prefix: 198.51.100.0
route_map: RMAP_1
- prefix: 192.0.2.0
masklen: 23
address_family:
- afi: ipv4
safi: unicast
redistribute:
- protocol: ospf
id: 223
metric: 10
operation: merge
- name: Configure BGP neighbors
cisco.ios.ios_bgp:
config:
bgp_as: 64496
neighbors:
- neighbor: 192.0.2.10
remote_as: 64496
password: ansible
description: IBGP_NBR_1
ebgp_multihop: 100
timers:
keepalive: 300
holdtime: 360
min_neighbor_holdtime: 360
- neighbor: 192.0.2.15
remote_as: 64496
description: IBGP_NBR_2
ebgp_multihop: 150
operation: merge
- name: Configure root-level networks for BGP
cisco.ios.ios_bgp:
config:
bgp_as: 64496
networks:
- prefix: 203.0.113.0
masklen: 27
route_map: RMAP_1
- prefix: 203.0.113.32
masklen: 27
route_map: RMAP_2
operation: merge
- name: Configure BGP neighbors under address family mode
cisco.ios.ios_bgp:
config:
bgp_as: 64496
address_family:
- afi: ipv4
safi: unicast
neighbors:
- neighbor: 203.0.113.10
activate: yes
maximum_prefix: 250
advertisement_interval: 120
- neighbor: 192.0.2.15
activate: yes
route_reflector_client: true
operation: merge
- name: remove bgp as 64496 from config
cisco.ios.ios_bgp:
config:
bgp_as: 64496
operation: delete
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['router bgp 64496', 'bgp router-id 192.0.2.1', 'bgp log-neighbor-changes', 'neighbor 203.0.113.5 remote-as 64511', 'neighbor 203.0.113.5 timers 300 360 360', 'neighbor 198.51.100.2 remote-as 64498', 'network 198.51.100.0 route-map RMAP\_1', 'network 192.0.2.0 mask 255.255.254.0', 'address-family ipv4', 'redistribute ospf 223 metric 70', 'exit-address-family'] |
Status
------
* This module will be removed in a major release after 2023-08-24. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Nilashish Chakraborty (@NilashishC)
ansible cisco.ios.ios_ospf_interfaces β OSPF_Interfaces resource module cisco.ios.ios\_ospf\_interfaces β OSPF\_Interfaces resource module
==================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_ospf_interfaces`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module configures and manages the Open Shortest Path First (OSPF) version 2 on IOS platforms.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A dictionary of OSPF interfaces options. |
| | **address\_family** list / elements=dictionary | | OSPF interfaces settings on the interfaces in address-family context. |
| | | **adjacency** boolean | **Choices:*** no
* yes
| Adjacency staggering |
| | | **afi** string / required | **Choices:*** ipv4
* ipv6
| Address Family Identifier (AFI) for OSPF interfaces settings on the interfaces. |
| | | **authentication** dictionary | | Enable authentication |
| | | | **key\_chain** string | | Use a key-chain for cryptographic authentication keys |
| | | | **message\_digest** boolean | **Choices:*** no
* yes
| Use message-digest authentication |
| | | | **null** boolean | **Choices:*** no
* yes
| Use no authentication |
| | | **bfd** boolean | **Choices:*** no
* yes
| BFD configuration commands Enable/Disable BFD on this interface |
| | | **cost** dictionary | | Interface cost |
| | | | **dynamic\_cost** dictionary | | Specify dynamic cost options Valid only with IPv6 OSPF config |
| | | | | **default** integer | | Specify default link metric value |
| | | | | **hysteresis** dictionary | | Specify hysteresis value for LSA dampening |
| | | | | | **percent** integer | | Specify hysteresis percent changed. Please refer vendor documentation of Valid values. |
| | | | | | **threshold** integer | | Specify hysteresis threshold value. Please refer vendor documentation of Valid values. |
| | | | | **weight** dictionary | | Specify weight to be placed on individual metrics |
| | | | | | **l2\_factor** integer | | Specify weight to be given to L2-factor metric Percentage weight of L2-factor metric. Please refer vendor documentation of Valid values. |
| | | | | | **latency** integer | | Specify weight to be given to latency metric. Percentage weight of latency metric. Please refer vendor documentation of Valid values. |
| | | | | | **oc** boolean | **Choices:*** no
* yes
| Specify weight to be given to cdr/mdr for oc Give 100 percent weightage for current data rate(0 for maxdatarate) |
| | | | | | **resources** integer | | Specify weight to be given to resources metric Percentage weight of resources metric. Please refer vendor documentation of Valid values. |
| | | | | | **throughput** integer | | Specify weight to be given to throughput metric Percentage weight of throughput metric. Please refer vendor documentation of Valid values. |
| | | | **interface\_cost** integer | | Interface cost or Route cost of this interface |
| | | **database\_filter** boolean | **Choices:*** no
* yes
| Filter OSPF LSA during synchronization and flooding |
| | | **dead\_interval** dictionary | | Interval after which a neighbor is declared dead |
| | | | **minimal** integer | | Set to 1 second and set multiplier for Hellos Number of Hellos sent within 1 second. Please refer vendor documentation of Valid values. Valid only with IP OSPF config |
| | | | **time** integer | | time in seconds |
| | | **demand\_circuit** dictionary | | OSPF Demand Circuit, enable or disable the demand circuit' |
| | | | **disable** boolean | **Choices:*** no
* yes
| Disable demand circuit on this interface Valid only with IPv6 OSPF config |
| | | | **enable** boolean | **Choices:*** no
* yes
| Enable Demand Circuit |
| | | | **ignore** boolean | **Choices:*** no
* yes
| Ignore demand circuit auto-negotiation requests |
| | | **flood\_reduction** boolean | **Choices:*** no
* yes
| OSPF Flood Reduction |
| | | **hello\_interval** integer | | Time between HELLO packets Please refer vendor documentation of Valid values. |
| | | **lls** boolean | **Choices:*** no
* yes
| Link-local Signaling (LLS) support Valid only with IP OSPF config |
| | | **manet** dictionary | | Mobile Adhoc Networking options MANET Peering options Valid only with IPv6 OSPF config |
| | | | **cost** dictionary | | Redundant path cost improvement required to peer |
| | | | | **percent** integer | | Relative incremental path cost. Please refer vendor documentation of Valid values. |
| | | | | **threshold** integer | | Absolute incremental path cost. Please refer vendor documentation of Valid values. |
| | | | **link\_metrics** dictionary | | Redundant path cost improvement required to peer |
| | | | | **cost\_threshold** integer | | Minimum link cost threshold. Please refer vendor documentation of Valid values. |
| | | | | **set** boolean | **Choices:*** no
* yes
| Enable link-metrics |
| | | **mtu\_ignore** boolean | **Choices:*** no
* yes
| Ignores the MTU in DBD packets |
| | | **multi\_area** dictionary | | Set the OSPF multi-area ID Valid only with IP OSPF config |
| | | | **cost** integer | | Interface cost |
| | | | **id** integer | | OSPF multi-area ID as a decimal value. Please refer vendor documentation of Valid values. OSPF multi-area ID in IP address format(e.g. A.B.C.D) |
| | | **neighbor** dictionary | | OSPF neighbor link-local IPv6 address (X:X:X:X::X) Valid only with IPv6 OSPF config |
| | | | **address** string | | Neighbor link-local IPv6 address |
| | | | **cost** integer | | OSPF cost for point-to-multipoint neighbor |
| | | | **database\_filter** boolean | **Choices:*** no
* yes
| Filter OSPF LSA during synchronization and flooding for point-to-multipoint neighbor |
| | | | **poll\_interval** integer | | OSPF dead-router polling interval |
| | | | **priority** integer | | OSPF priority of non-broadcast neighbor |
| | | **network** dictionary | | Network type |
| | | | **broadcast** boolean | **Choices:*** no
* yes
| Specify OSPF broadcast multi-access network |
| | | | **manet** boolean | **Choices:*** no
* yes
| Specify MANET OSPF interface type Valid only with IPv6 OSPF config |
| | | | **non\_broadcast** boolean | **Choices:*** no
* yes
| Specify OSPF NBMA network |
| | | | **point\_to\_multipoint** boolean | **Choices:*** no
* yes
| Specify OSPF point-to-multipoint network |
| | | | **point\_to\_point** boolean | **Choices:*** no
* yes
| Specify OSPF point-to-point network |
| | | **prefix\_suppression** boolean | **Choices:*** no
* yes
| Enable/Disable OSPF prefix suppression |
| | | **priority** integer | | Router priority. Please refer vendor documentation of Valid values. |
| | | **process** dictionary | | OSPF interfaces process config |
| | | | **area\_id** string | | OSPF interfaces area ID as a decimal value. Please refer vendor documentation of Valid values. OSPF interfaces area ID in IP address format(e.g. A.B.C.D) |
| | | | **id** integer | | Address Family Identifier (AFI) for OSPF interfaces settings on the interfaces. Please refer vendor documentation of Valid values. |
| | | | **instance\_id** integer | | Set the OSPF instance based on ID Valid only with IPv6 OSPF config |
| | | | **secondaries** boolean | **Choices:*** no
* yes
| Include or exclude secondary IP addresses. Valid only with IPv4 config |
| | | **resync\_timeout** integer | | Interval after which adjacency is reset if oob-resync is not started. Please refer vendor documentation of Valid values. |
| | | **retransmit\_interval** integer | | Time between retransmitting lost link state advertisements. Please refer vendor documentation of Valid values. |
| | | **shutdown** boolean | **Choices:*** no
* yes
| Set OSPF protocol's state to disable under current interface |
| | | **transmit\_delay** integer | | Link state transmit delay. Please refer vendor documentation of Valid values. |
| | | **ttl\_security** dictionary | | TTL security check Valid only with IPV4 OSPF config |
| | | | **hops** integer | | Maximum number of IP hops allowed Please refer vendor documentation of Valid values. |
| | | | **set** boolean | **Choices:*** no
* yes
| Enable TTL Security on all interfaces |
| | **name** string / required | | Full name of the interface excluding any logical unit number, i.e. GigabitEthernet0/1. |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **sh running-config | section ^interface**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* gathered
* rendered
* parsed
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL.
Examples
--------
```
# Using deleted
# Before state:
# -------------
#
# router-ios#sh running-config | section ^interface
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ipv6 ospf 55 area 105
# ipv6 ospf priority 20
# ipv6 ospf transmit-delay 30
# ipv6 ospf adjacency stagger disable
# interface GigabitEthernet0/2
# ip ospf priority 40
# ip ospf adjacency stagger disable
# ip ospf ttl-security hops 50
# ip ospf 10 area 20
# ip ospf cost 30
- name: Delete provided OSPF Interface config
cisco.ios.ios_ospf_interfaces:
config:
- name: GigabitEthernet0/1
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "interface GigabitEthernet0/1",
# "no ipv6 ospf 55 area 105",
# "no ipv6 ospf adjacency stagger disable",
# "no ipv6 ospf priority 20",
# "no ipv6 ospf transmit-delay 30"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^interface
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# interface GigabitEthernet0/2
# ip ospf priority 40
# ip ospf adjacency stagger disable
# ip ospf ttl-security hops 50
# ip ospf 10 area 20
# ip ospf cost 30
# Using deleted without any config passed (NOTE: This will delete all OSPF Interfaces configuration from device)
# Before state:
# -------------
#
# router-ios#sh running-config | section ^interface
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ipv6 ospf 55 area 105
# ipv6 ospf priority 20
# ipv6 ospf transmit-delay 30
# ipv6 ospf adjacency stagger disable
# interface GigabitEthernet0/2
# ip ospf priority 40
# ip ospf adjacency stagger disable
# ip ospf ttl-security hops 50
# ip ospf 10 area 20
# ip ospf cost 30
- name: Delete all OSPF config from interfaces
cisco.ios.ios_ospf_interfaces:
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "interface GigabitEthernet0/2",
# "no ip ospf 10 area 20",
# "no ip ospf adjacency stagger disable",
# "no ip ospf cost 30",
# "no ip ospf priority 40",
# "no ip ospf ttl-security hops 50",
# "interface GigabitEthernet0/1",
# "no ipv6 ospf 55 area 105",
# "no ipv6 ospf adjacency stagger disable",
# "no ipv6 ospf priority 20",
# "no ipv6 ospf transmit-delay 30"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^interface
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# interface GigabitEthernet0/2
# Using merged
# Before state:
# -------------
#
# router-ios#sh running-config | section ^interface
# router-ios#
- name: Merge provided OSPF Interfaces configuration
cisco.ios.ios_ospf_interfaces:
config:
- name: GigabitEthernet0/1
address_family:
- afi: ipv4
process:
id: 10
area_id: 30
adjacency: true
bfd: true
cost:
interface_cost: 5
dead_interval:
time: 5
demand_circuit:
ignore: true
network:
broadcast: true
priority: 25
resync_timeout: 10
shutdown: true
ttl_security:
hops: 50
- afi: ipv6
process:
id: 35
area_id: 45
adjacency: true
database_filter: true
manet:
link_metrics:
cost_threshold: 10
priority: 55
transmit_delay: 45
state: merged
# Commands Fired:
# ---------------
#
# "commands": [
# "interface GigabitEthernet0/1",
# "ip ospf 10 area 30",
# "ip ospf adjacency stagger disable",
# "ip ospf bfd",
# "ip ospf cost 5",
# "ip ospf dead-interval 5",
# "ip ospf demand-circuit ignore",
# "ip ospf network broadcast",
# "ip ospf priority 25",
# "ip ospf resync-timeout 10",
# "ip ospf shutdown",
# "ip ospf ttl-security hops 50",
# "ipv6 ospf 35 area 45",
# "ipv6 ospf adjacency stagger disable",
# "ipv6 ospf database-filter all out",
# "ipv6 ospf manet peering link-metrics 10",
# "ipv6 ospf priority 55",
# "ipv6 ospf transmit-delay 45"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^interface
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip ospf network broadcast
# ip ospf resync-timeout 10
# ip ospf dead-interval 5
# ip ospf priority 25
# ip ospf demand-circuit ignore
# ip ospf bfd
# ip ospf adjacency stagger disable
# ip ospf ttl-security hops 50
# ip ospf shutdown
# ip ospf 10 area 30
# ip ospf cost 5
# ipv6 ospf 35 area 45
# ipv6 ospf priority 55
# ipv6 ospf transmit-delay 45
# ipv6 ospf database-filter all out
# ipv6 ospf adjacency stagger disable
# ipv6 ospf manet peering link-metrics 10
# interface GigabitEthernet0/2
# Using overridden
# Before state:
# -------------
#
# router-ios#sh running-config | section ^interface
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip ospf network broadcast
# ip ospf resync-timeout 10
# ip ospf dead-interval 5
# ip ospf priority 25
# ip ospf demand-circuit ignore
# ip ospf bfd
# ip ospf adjacency stagger disable
# ip ospf ttl-security hops 50
# ip ospf shutdown
# ip ospf 10 area 30
# ip ospf cost 5
# ipv6 ospf 35 area 45
# ipv6 ospf priority 55
# ipv6 ospf transmit-delay 45
# ipv6 ospf database-filter all out
# ipv6 ospf adjacency stagger disable
# ipv6 ospf manet peering link-metrics 10
# interface GigabitEthernet0/2
- name: Override provided OSPF Interfaces configuration
cisco.ios.ios_ospf_interfaces:
config:
- name: GigabitEthernet0/1
address_family:
- afi: ipv6
process:
id: 55
area_id: 105
adjacency: true
priority: 20
transmit_delay: 30
- name: GigabitEthernet0/2
address_family:
- afi: ipv4
process:
id: 10
area_id: 20
adjacency: true
cost:
interface_cost: 30
priority: 40
ttl_security:
hops: 50
state: overridden
# Commands Fired:
# ---------------
#
# "commands": [
# "interface GigabitEthernet0/2",
# "ip ospf 10 area 20",
# "ip ospf adjacency stagger disable",
# "ip ospf cost 30",
# "ip ospf priority 40",
# "ip ospf ttl-security hops 50",
# "interface GigabitEthernet0/1",
# "ipv6 ospf 55 area 105",
# "no ipv6 ospf database-filter all out",
# "no ipv6 ospf manet peering link-metrics 10",
# "ipv6 ospf priority 20",
# "ipv6 ospf transmit-delay 30",
# "no ip ospf 10 area 30",
# "no ip ospf adjacency stagger disable",
# "no ip ospf bfd",
# "no ip ospf cost 5",
# "no ip ospf dead-interval 5",
# "no ip ospf demand-circuit ignore",
# "no ip ospf network broadcast",
# "no ip ospf priority 25",
# "no ip ospf resync-timeout 10",
# "no ip ospf shutdown",
# "no ip ospf ttl-security hops 50"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^interface
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ipv6 ospf 55 area 105
# ipv6 ospf priority 20
# ipv6 ospf transmit-delay 30
# ipv6 ospf adjacency stagger disable
# interface GigabitEthernet0/2
# ip ospf priority 40
# ip ospf adjacency stagger disable
# ip ospf ttl-security hops 50
# ip ospf 10 area 20
# ip ospf cost 30
# Using replaced
# Before state:
# -------------
#
# router-ios#sh running-config | section ^interface
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip ospf network broadcast
# ip ospf resync-timeout 10
# ip ospf dead-interval 5
# ip ospf priority 25
# ip ospf demand-circuit ignore
# ip ospf bfd
# ip ospf adjacency stagger disable
# ip ospf ttl-security hops 50
# ip ospf shutdown
# ip ospf 10 area 30
# ip ospf cost 5
# ipv6 ospf 35 area 45
# ipv6 ospf priority 55
# ipv6 ospf transmit-delay 45
# ipv6 ospf database-filter all out
# ipv6 ospf adjacency stagger disable
# ipv6 ospf manet peering link-metrics 10
# interface GigabitEthernet0/2
- name: Replaced provided OSPF Interfaces configuration
cisco.ios.ios_ospf_interfaces:
config:
- name: GigabitEthernet0/2
address_family:
- afi: ipv6
process:
id: 55
area_id: 105
adjacency: true
priority: 20
transmit_delay: 30
state: replaced
# Commands Fired:
# ---------------
# "commands": [
# "interface GigabitEthernet0/2",
# "ipv6 ospf 55 area 105",
# "ipv6 ospf adjacency stagger disable",
# "ipv6 ospf priority 20",
# "ipv6 ospf transmit-delay 30"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^interface
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip ospf network broadcast
# ip ospf resync-timeout 10
# ip ospf dead-interval 5
# ip ospf priority 25
# ip ospf demand-circuit ignore
# ip ospf bfd
# ip ospf adjacency stagger disable
# ip ospf ttl-security hops 50
# ip ospf shutdown
# ip ospf 10 area 30
# ip ospf cost 5
# ipv6 ospf 35 area 45
# ipv6 ospf priority 55
# ipv6 ospf transmit-delay 45
# ipv6 ospf database-filter all out
# ipv6 ospf adjacency stagger disable
# ipv6 ospf manet peering link-metrics 10
# interface GigabitEthernet0/2
# ipv6 ospf 55 area 105
# ipv6 ospf priority 20
# ipv6 ospf transmit-delay 30
# ipv6 ospf adjacency stagger disable
# Using Gathered
# Before state:
# -------------
#
# router-ios#sh running-config | section ^interface
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip ospf network broadcast
# ip ospf resync-timeout 10
# ip ospf dead-interval 5
# ip ospf priority 25
# ip ospf demand-circuit ignore
# ip ospf bfd
# ip ospf adjacency stagger disable
# ip ospf ttl-security hops 50
# ip ospf shutdown
# ip ospf 10 area 30
# ip ospf cost 5
# ipv6 ospf 35 area 45
# ipv6 ospf priority 55
# ipv6 ospf transmit-delay 45
# ipv6 ospf database-filter all out
# ipv6 ospf adjacency stagger disable
# ipv6 ospf manet peering link-metrics 10
# interface GigabitEthernet0/2
- name: Gather OSPF Interfaces provided configurations
cisco.ios.ios_ospf_interfaces:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "name": "GigabitEthernet0/2"
# },
# {
# "address_family": [
# {
# "adjacency": true,
# "afi": "ipv4",
# "bfd": true,
# "cost": {
# "interface_cost": 5
# },
# "dead_interval": {
# "time": 5
# },
# "demand_circuit": {
# "ignore": true
# },
# "network": {
# "broadcast": true
# },
# "priority": 25,
# "process": {
# "area_id": "30",
# "id": 10
# },
# "resync_timeout": 10,
# "shutdown": true,
# "ttl_security": {
# "hops": 50
# }
# },
# {
# "adjacency": true,
# "afi": "ipv6",
# "database_filter": true,
# "manet": {
# "link_metrics": {
# "cost_threshold": 10
# }
# },
# "priority": 55,
# "process": {
# "area_id": "45",
# "id": 35
# },
# "transmit_delay": 45
# }
# ],
# "name": "GigabitEthernet0/1"
# },
# {
# "name": "GigabitEthernet0/0"
# }
# ]
# After state:
# ------------
#
# router-ios#sh running-config | section ^interface
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip ospf network broadcast
# ip ospf resync-timeout 10
# ip ospf dead-interval 5
# ip ospf priority 25
# ip ospf demand-circuit ignore
# ip ospf bfd
# ip ospf adjacency stagger disable
# ip ospf ttl-security hops 50
# ip ospf shutdown
# ip ospf 10 area 30
# ip ospf cost 5
# ipv6 ospf 35 area 45
# ipv6 ospf priority 55
# ipv6 ospf transmit-delay 45
# ipv6 ospf database-filter all out
# ipv6 ospf adjacency stagger disable
# ipv6 ospf manet peering link-metrics 10
# interface GigabitEthernet0/2
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_ospf_interfaces:
config:
- name: GigabitEthernet0/1
address_family:
- afi: ipv4
process:
id: 10
area_id: 30
adjacency: true
bfd: true
cost:
interface_cost: 5
dead_interval:
time: 5
demand_circuit:
ignore: true
network:
broadcast: true
priority: 25
resync_timeout: 10
shutdown: true
ttl_security:
hops: 50
- afi: ipv6
process:
id: 35
area_id: 45
adjacency: true
database_filter: true
manet:
link_metrics:
cost_threshold: 10
priority: 55
transmit_delay: 45
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "interface GigabitEthernet0/1",
# "ip ospf 10 area 30",
# "ip ospf adjacency stagger disable",
# "ip ospf bfd",
# "ip ospf cost 5",
# "ip ospf dead-interval 5",
# "ip ospf demand-circuit ignore",
# "ip ospf network broadcast",
# "ip ospf priority 25",
# "ip ospf resync-timeout 10",
# "ip ospf shutdown",
# "ip ospf ttl-security hops 50",
# "ipv6 ospf 35 area 45",
# "ipv6 ospf adjacency stagger disable",
# "ipv6 ospf database-filter all out",
# "ipv6 ospf manet peering link-metrics 10",
# "ipv6 ospf priority 55",
# "ipv6 ospf transmit-delay 45"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# interface GigabitEthernet0/2
# interface GigabitEthernet0/1
# ip ospf network broadcast
# ip ospf resync-timeout 10
# ip ospf dead-interval 5
# ip ospf priority 25
# ip ospf demand-circuit ignore
# ip ospf bfd
# ip ospf adjacency stagger disable
# ip ospf ttl-security hops 50
# ip ospf shutdown
# ip ospf 10 area 30
# ip ospf cost 5
# ipv6 ospf 35 area 45
# ipv6 ospf priority 55
# ipv6 ospf transmit-delay 45
# ipv6 ospf database-filter all out
# ipv6 ospf adjacency stagger disable
# ipv6 ospf manet peering link-metrics 10
# interface GigabitEthernet0/0
- name: Parse the provided configuration with the existing running configuration
cisco.ios.ios_ospf_interfaces:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# },
# {
# "name": "GigabitEthernet0/2"
# },
# {
# "address_family": [
# {
# "adjacency": true,
# "afi": "ipv4",
# "bfd": true,
# "cost": {
# "interface_cost": 5
# },
# "dead_interval": {
# "time": 5
# },
# "demand_circuit": {
# "ignore": true
# },
# "network": {
# "broadcast": true
# },
# "priority": 25,
# "process": {
# "area_id": "30",
# "id": 10
# },
# "resync_timeout": 10,
# "shutdown": true,
# "ttl_security": {
# "hops": 50
# }
# },
# {
# "adjacency": true,
# "afi": "ipv6",
# "database_filter": true,
# "manet": {
# "link_metrics": {
# "cost_threshold": 10
# }
# },
# "priority": 55,
# "process": {
# "area_id": "45",
# "id": 35
# },
# "transmit_delay": 45
# }
# ],
# "name": "GigabitEthernet0/1"
# },
# {
# "name": "GigabitEthernet0/0"
# }
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** dictionary | when changed | The resulting configuration model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** dictionary | always | The configuration prior to the model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device. **Sample:** ['interface GigabitEthernet0/1', 'ip ospf 10 area 30', 'ip ospf cost 5', 'ip ospf priority 25'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ios.ios_acl_interfaces β ACL interfaces resource module cisco.ios.ios\_acl\_interfaces β ACL interfaces resource module
===============================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_acl_interfaces`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module configures and manages the access-control (ACL) attributes of interfaces on IOS platforms.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A dictionary of ACL interfaces options |
| | **access\_groups** list / elements=dictionary | | Specify access-group for IP access list (standard or extended). |
| | | **acls** list / elements=dictionary | | Specifies the ACLs for the provided AFI. |
| | | | **direction** string / required | **Choices:*** in
* out
| Specifies the direction of packets that the ACL will be applied on. With one direction already assigned, other acl direction cannot be same. |
| | | | **name** string / required | | Specifies the name of the IPv4/IPv4 ACL for the interface. |
| | | **afi** string / required | **Choices:*** ipv4
* ipv6
| Specifies the AFI for the ACLs to be configured on this interface. |
| | **name** string / required | | Full name of the interface excluding any logical unit number, i.e. GigabitEthernet0/1. |
| **running\_config** string | | The module, by default, will connect to the remote device and retrieve the current running-config to use as a base for comparing against the contents of source. There are times when it is not desirable to have the task get the current running-config for every task in a playbook. The *running\_config* argument allows the implementer to pass in the configuration to use as the base config for comparison. This value of this option should be the output received from device by executing command. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* gathered
* parsed
* rendered
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL
Examples
--------
```
# Using Merged
# Before state:
# -------------
#
# vios#sh running-config | include interface|ip access-group|ipv6 traffic-filter
# interface Loopback888
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# interface GigabitEthernet0/2
# ip access-group 123 out
- name: Merge module attributes of given access-groups
cisco.ios.ios_acl_interfaces:
config:
- name: GigabitEthernet0/1
access_groups:
- afi: ipv4
acls:
- name: 110
direction: in
- name: 123
direction: out
- afi: ipv6
acls:
- name: test_v6
direction: out
- name: temp_v6
direction: in
- name: GigabitEthernet0/2
access_groups:
- afi: ipv4
acls:
- name: 100
direction: in
state: merged
# Commands Fired:
# ---------------
#
# interface GigabitEthernet0/1
# ip access-group 110 in
# ip access-group 123 out
# ipv6 traffic-filter test_v6 out
# ipv6 traffic-filter temp_v6 in
# interface GigabitEthernet0/2
# ip access-group 100 in
# After state:
# -------------
#
# vios#sh running-config | include interface|ip access-group|ipv6 traffic-filter
# interface Loopback888
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip access-group 110 in
# ip access-group 123 out
# ipv6 traffic-filter test_v6 out
# ipv6 traffic-filter temp_v6 in
# interface GigabitEthernet0/2
# ip access-group 110 in
# ip access-group 123 out
# Using Replaced
# Before state:
# -------------
#
# vios#sh running-config | include interface|ip access-group|ipv6 traffic-filter
# interface Loopback888
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip access-group 110 in
# ip access-group 123 out
# ipv6 traffic-filter test_v6 out
# ipv6 traffic-filter temp_v6 in
# interface GigabitEthernet0/2
# ip access-group 110 in
# ip access-group 123 out
- name: Replace module attributes of given access-groups
cisco.ios.ios_acl_interfaces:
config:
- name: GigabitEthernet0/1
access_groups:
- afi: ipv4
acls:
- name: 100
direction: out
- name: 110
direction: in
state: replaced
# Commands Fired:
# ---------------
#
# interface GigabitEthernet0/1
# no ip access-group 123 out
# no ipv6 traffic-filter temp_v6 in
# no ipv6 traffic-filter test_v6 out
# ip access-group 100 out
# After state:
# -------------
#
# vios#sh running-config | include interface|ip access-group|ipv6 traffic-filter
# interface Loopback888
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip access-group 100 out
# ip access-group 110 in
# interface GigabitEthernet0/2
# ip access-group 110 in
# ip access-group 123 out
# Using Overridden
# Before state:
# -------------
#
# vios#sh running-config | include interface|ip access-group|ipv6 traffic-filter
# interface Loopback888
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip access-group 110 in
# ip access-group 123 out
# ipv6 traffic-filter test_v6 out
# ipv6 traffic-filter temp_v6 in
# interface GigabitEthernet0/2
# ip access-group 110 in
# ip access-group 123 out
- name: Overridden module attributes of given access-groups
cisco.ios.ios_acl_interfaces:
config:
- name: GigabitEthernet0/1
access_groups:
- afi: ipv4
acls:
- name: 100
direction: out
- name: 110
direction: in
state: overridden
# Commands Fired:
# ---------------
#
# interface GigabitEthernet0/1
# no ip access-group 123 out
# no ipv6 traffic-filter test_v6 out
# no ipv6 traffic-filter temp_v6 in
# ip access-group 100 out
# interface GigabitEthernet0/2
# no ip access-group 110 in
# no ip access-group 123 out
# After state:
# -------------
#
# vios#sh running-config | include interface|ip access-group|ipv6 traffic-filter
# interface Loopback888
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip access-group 100 out
# ip access-group 110 in
# interface GigabitEthernet0/2
# Using Deleted
# Before state:
# -------------
#
# vios#sh running-config | include interface|ip access-group|ipv6 traffic-filter
# interface Loopback888
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip access-group 110 in
# ip access-group 123 out
# ipv6 traffic-filter test_v6 out
# ipv6 traffic-filter temp_v6 in
# interface GigabitEthernet0/2
# ip access-group 110 in
# ip access-group 123 out
- name: Delete module attributes of given Interface
cisco.ios.ios_acl_interfaces:
config:
- name: GigabitEthernet0/1
state: deleted
# Commands Fired:
# ---------------
#
# interface GigabitEthernet0/1
# no ip access-group 110 in
# no ip access-group 123 out
# no ipv6 traffic-filter test_v6 out
# no ipv6 traffic-filter temp_v6 in
# After state:
# -------------
#
# vios#sh running-config | include interface|ip access-group|ipv6 traffic-filter
# interface Loopback888
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# interface GigabitEthernet0/2
# ip access-group 110 in
# ip access-group 123 out
# Using DELETED without any config passed
#"(NOTE: This will delete all of configured resource module attributes from each configured interface)"
# Before state:
# -------------
#
# vios#sh running-config | include interface|ip access-group|ipv6 traffic-filter
# interface Loopback888
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip access-group 110 in
# ip access-group 123 out
# ipv6 traffic-filter test_v6 out
# ipv6 traffic-filter temp_v6 in
# interface GigabitEthernet0/2
# ip access-group 110 in
# ip access-group 123 out
- name: Delete module attributes of given access-groups from ALL Interfaces
cisco.ios.ios_acl_interfaces:
config:
state: deleted
# Commands Fired:
# ---------------
#
# interface GigabitEthernet0/1
# no ip access-group 110 in
# no ip access-group 123 out
# no ipv6 traffic-filter test_v6 out
# no ipv6 traffic-filter temp_v6 in
# interface GigabitEthernet0/2
# no ip access-group 110 out
# no ip access-group 123 out
# After state:
# -------------
#
# vios#sh running-config | include interface|ip access-group|ipv6 traffic-filter
# interface Loopback888
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# interface GigabitEthernet0/2
# Using Gathered
# Before state:
# -------------
#
# vios#sh running-config | include interface|ip access-group|ipv6 traffic-filter
# interface Loopback888
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip access-group 110 in
# ip access-group 123 out
# ipv6 traffic-filter test_v6 out
# ipv6 traffic-filter temp_v6 in
# interface GigabitEthernet0/2
# ip access-group 110 in
# ip access-group 123 out
- name: Gather listed acl interfaces with provided configurations
cisco.ios.ios_acl_interfaces:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "name": "Loopback888"
# },
# {
# "name": "GigabitEthernet0/0"
# },
# {
# "access_groups": [
# {
# "acls": [
# {
# "direction": "in",
# "name": "110"
# },
# {
# "direction": "out",
# "name": "123"
# }
# ],
# "afi": "ipv4"
# },
# {
# "acls": [
# {
# "direction": "in",
# "name": "temp_v6"
# },
# {
# "direction": "out",
# "name": "test_v6"
# }
# ],
# "afi": "ipv6"
# }
# ],
# "name": "GigabitEthernet0/1"
# },
# {
# "access_groups": [
# {
# "acls": [
# {
# "direction": "in",
# "name": "100"
# },
# {
# "direction": "out",
# "name": "123"
# }
# ],
# "afi": "ipv4"
# }
# ],
# "name": "GigabitEthernet0/2"
# }
# ]
# After state:
# ------------
#
# vios#sh running-config | include interface|ip access-group|ipv6 traffic-filter
# interface Loopback888
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# ip access-group 110 in
# ip access-group 123 out
# ipv6 traffic-filter test_v6 out
# ipv6 traffic-filter temp_v6 in
# interface GigabitEthernet0/2
# ip access-group 110 in
# ip access-group 123 out
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_acl_interfaces:
config:
- name: GigabitEthernet0/1
access_groups:
- afi: ipv4
acls:
- name: 110
direction: in
- name: 123
direction: out
- afi: ipv6
acls:
- name: test_v6
direction: out
- name: temp_v6
direction: in
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "interface GigabitEthernet0/1",
# "ip access-group 110 in",
# "ip access-group 123 out",
# "ipv6 traffic-filter temp_v6 in",
# "ipv6 traffic-filter test_v6 out"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# interface GigabitEthernet0/1
# ip access-group 110 in
# ip access-group 123 out
# ipv6 traffic-filter temp_v6 in
# ipv6 traffic-filter test_v6 out
- name: Parse the commands for provided configuration
cisco.ios.ios_acl_interfaces:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "access_groups": [
# {
# "acls": [
# {
# "direction": "in",
# "name": "110"
# }
# ],
# "afi": "ipv4"
# },
# {
# "acls": [
# {
# "direction": "in",
# "name": "temp_v6"
# }
# ],
# "afi": "ipv6"
# }
# ],
# "name": "GigabitEthernet0/1"
# }
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device **Sample:** ['interface GigabitEthernet0/1', 'ip access-group 110 in', 'ipv6 traffic-filter test\_v6 out'] |
### Authors
* Sumit Jaiswal (@justjais)
ansible cisco.ios.ios_static_routes β Static routes resource module cisco.ios.ios\_static\_routes β Static routes resource module
=============================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_static_routes`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module configures and manages the static routes on IOS platforms.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A dictionary of static route options |
| | **address\_families** list / elements=dictionary | | Address family to use for the static routes |
| | | **afi** string / required | **Choices:*** ipv4
* ipv6
| Top level address family indicator. |
| | | **routes** list / elements=dictionary | | Configuring static route |
| | | | **dest** string / required | | Destination prefix with its subnet mask |
| | | | **next\_hops** list / elements=dictionary | | next hop address or interface |
| | | | | **dhcp** boolean | **Choices:*** no
* yes
| Default gateway obtained from DHCP |
| | | | | **distance\_metric** integer | | Distance metric for this route |
| | | | | **forward\_router\_address** string | | Forwarding router's address |
| | | | | **global** boolean | **Choices:*** no
* yes
| Next hop address is global |
| | | | | **interface** string | | Interface for directly connected static routes |
| | | | | **multicast** boolean | **Choices:*** no
* yes
| multicast route |
| | | | | **name** string | | Specify name of the next hop |
| | | | | **permanent** boolean | **Choices:*** no
* yes
| permanent route |
| | | | | **tag** integer | | Set tag for this route Refer to vendor documentation for valid values. |
| | | | | **track** integer | | Install route depending on tracked item with tracked object number. Tracking does not support multicast Refer to vendor documentation for valid values. |
| | | | **topology** string | | Configure static route for a Topology Routing/Forwarding instance NOTE, VRF and Topology can be used together only with Multicast and Topology should pre-exist before it can be used |
| | **vrf** string | | IP VPN Routing/Forwarding instance name. NOTE, In case of IPV4/IPV6 VRF routing table should pre-exist before configuring. NOTE, if the vrf information is not provided then the routes shall be configured under global vrf. |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **show running-config | include ip route|ipv6 route**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* gathered
* rendered
* parsed
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL.
Examples
--------
```
# Using merged
# Before state:
# -------------
#
# vios#show running-config | include ip route|ipv6 route
- name: Merge provided configuration with device configuration
cisco.ios.ios_static_routes:
config:
- vrf: blue
address_families:
- afi: ipv4
routes:
- dest: 192.0.2.0/24
next_hops:
- forward_router_address: 192.0.2.1
name: merged_blue
tag: 50
track: 150
- address_families:
- afi: ipv4
routes:
- dest: 198.51.100.0/24
next_hops:
- forward_router_address: 198.51.101.1
name: merged_route_1
distance_metric: 110
tag: 40
multicast: true
- forward_router_address: 198.51.101.2
name: merged_route_2
distance_metric: 30
- forward_router_address: 198.51.101.3
name: merged_route_3
- afi: ipv6
routes:
- dest: 2001:DB8:0:3::/64
next_hops:
- forward_router_address: 2001:DB8:0:3::2
name: merged_v6
tag: 105
state: merged
# Commands fired:
# ---------------
# ip route vrf blue 192.0.2.0 255.255.255.0 10.0.0.8 name merged_blue track 150 tag 50
# ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name merged_route_1 tag 40
# ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name merged_route_2
# ip route 198.51.100.0 255.255.255.0 198.51.101.3 name merged_route_3
# ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name merged_v6 tag 105
# After state:
# ------------
#
# vios#show running-config | include ip route|ipv6 route
# ip route vrf blue 192.0.2.0 255.255.255.0 192.0.2.1 tag 50 name merged_blue track 150
# ip route 198.51.100.0 255.255.255.0 198.51.101.3 name merged_route_3
# ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name merged_route_2
# ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 tag 40 name merged_route_1 multicast
# ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 tag 105 name merged_v6
# Using replaced
# Before state:
# -------------
#
# vios#show running-config | include ip route|ipv6 route
# ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50
# ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40
# ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2
# ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3
# ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name test_v6 tag 105
- name: Replace provided configuration with device configuration
cisco.ios.ios_static_routes:
config:
- address_families:
- afi: ipv4
routes:
- dest: 198.51.100.0/24
next_hops:
- forward_router_address: 198.51.101.1
name: replaced_route
distance_metric: 175
tag: 70
multicast: true
state: replaced
# Commands fired:
# ---------------
# no ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40
# no ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2
# no ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3
# ip route 198.51.100.0 255.255.255.0 198.51.101.1 175 name replaced_route track 150 tag 70
# After state:
# ------------
#
# vios#show running-config | include ip route|ipv6 route
# ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50
# ip route 198.51.100.0 255.255.255.0 198.51.101.1 175 name replaced_route track 150 tag 70
# ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 tag 105 name test_v6
# Using overridden
# Before state:
# -------------
#
# vios#show running-config | include ip route|ipv6 route
# ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50
# ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40
# ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2
# ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3
# ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name test_v6 tag 105
- name: Override provided configuration with device configuration
cisco.ios.ios_static_routes:
config:
- vrf: blue
address_families:
- afi: ipv4
routes:
- dest: 192.0.2.0/24
next_hops:
- forward_router_address: 192.0.2.1
name: override_vrf
tag: 50
track: 150
state: overridden
# Commands fired:
# ---------------
# no ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40
# no ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2
# no ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3
# no ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 198.51.101.8 name test_vrf track 150 tag 50
# no ipv6 route FD5D:12C9:2201:1::/64 FD5D:12C9:2202::2 name test_v6 tag 105
# ip route vrf blue 192.0.2.0 255.255.255.0 198.51.101.4 name override_vrf track 150 tag 50
# After state:
# ------------
#
# vios#show running-config | include ip route|ipv6 route
# ip route vrf blue 192.0.2.0 255.255.255.0 192.0.2.1 tag 50 name override_vrf track 150
# Using Deleted
# Example 1:
# ----------
# To delete the exact static routes, with all the static routes explicitly mentioned in want
# Before state:
# -------------
#
# vios#show running-config | include ip route|ipv6 route
# ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50
# ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40
# ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2
# ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3
# ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name test_v6 tag 105
- name: Delete provided configuration from the device configuration
cisco.ios.ios_static_routes:
config:
- vrf: ansible_temp_vrf
address_families:
- afi: ipv4
routes:
- dest: 192.0.2.0/24
next_hops:
- forward_router_address: 192.0.2.1
name: test_vrf
tag: 50
track: 150
- address_families:
- afi: ipv4
routes:
- dest: 198.51.100.0/24
next_hops:
- forward_router_address: 198.51.101.1
name: route_1
distance_metric: 110
tag: 40
multicast: true
- forward_router_address: 198.51.101.2
name: route_2
distance_metric: 30
- forward_router_address: 198.51.101.3
name: route_3
- afi: ipv6
routes:
- dest: 2001:DB8:0:3::/64
next_hops:
- forward_router_address: 2001:DB8:0:3::2
name: test_v6
tag: 105
state: deleted
# Commands fired:
# ---------------
# no ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 198.51.101.8 name test_vrf track 150 tag 50
# no ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40
# no ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2
# no ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3
# no ipv6 route FD5D:12C9:2201:1::/64 FD5D:12C9:2202::2 name test_v6 tag 105
# After state:
# ------------
#
# vios#show running-config | include ip route|ipv6 route
# Example 2:
# ----------
# To delete the destination specific static routes
# Before state:
# -------------
#
# vios#show running-config | include ip route|ipv6 route
# ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50
# ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40
# ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2
# ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3
# ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name test_v6 tag 105
- name: Delete provided configuration from the device configuration
cisco.ios.ios_static_routes:
config:
- address_families:
- afi: ipv4
routes:
- dest: 198.51.100.0/24
state: deleted
# Commands fired:
# ---------------
# no ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3
# no ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2
# no ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 tag 40 name route_1 multicast
# After state:
# ------------
#
# vios#show running-config | include ip route|ipv6 route
# ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 tag 50 name test_vrf track 150
# ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 tag 105 name test_v6
# Example 3:
# ----------
# To delete the vrf specific static routes
# Before state:
# -------------
#
# vios#show running-config | include ip route|ipv6 route
# ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50
# ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40
# ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2
# ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3
# ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name test_v6 tag 105
- name: Delete provided configuration from the device configuration
cisco.ios.ios_static_routes:
config:
- vrf: ansible_temp_vrf
state: deleted
# Commands fired:
# ---------------
# no ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50
# After state:
# ------------
#
# vios#show running-config | include ip route|ipv6 route
# ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3
# ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2
# ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 tag 40 name route_1 multicast
# ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 tag 105 name test_v6
# Using Deleted without any config passed
#"(NOTE: This will delete all of configured resource module attributes from each configured interface)"
# Before state:
# -------------
#
# vios#show running-config | include ip route|ipv6 route
# ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50
# ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40
# ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2
# ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3
# ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name test_v6 tag 105
- name: Delete ALL configured IOS static routes
cisco.ios.ios_static_routes:
state: deleted
# Commands fired:
# ---------------
# no ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 tag 50 name test_vrf track 150
# no ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3
# no ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2
# no ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 tag 40 name route_1 multicast
# no ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 tag 105 name test_v6
# After state:
# -------------
#
# vios#show running-config | include ip route|ipv6 route
#
# Using gathered
# Before state:
# -------------
#
# vios#show running-config | include ip route|ipv6 route
# ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50
# ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40
# ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2
# ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3
# ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name test_v6 tag 105
- name: Gather listed static routes with provided configurations
cisco.ios.ios_static_routes:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "address_families": [
# {
# "afi": "ipv4",
# "routes": [
# {
# "dest": "192.0.2.0/24",
# "next_hops": [
# {
# "forward_router_address": "192.0.2.1",
# "name": "test_vrf",
# "tag": 50,
# "track": 150
# }
# ]
# }
# ]
# }
# ],
# "vrf": "ansible_temp_vrf"
# },
# {
# "address_families": [
# {
# "afi": "ipv6",
# "routes": [
# {
# "dest": "2001:DB8:0:3::/64",
# "next_hops": [
# {
# "forward_router_address": "2001:DB8:0:3::2",
# "name": "test_v6",
# "tag": 105
# }
# ]
# }
# ]
# },
# {
# "afi": "ipv4",
# "routes": [
# {
# "dest": "198.51.100.0/24",
# "next_hops": [
# {
# "distance_metric": 110,
# "forward_router_address": "198.51.101.1",
# "multicast": true,
# "name": "route_1",
# "tag": 40
# },
# {
# "distance_metric": 30,
# "forward_router_address": "198.51.101.2",
# "name": "route_2"
# },
# {
# "forward_router_address": "198.51.101.3",
# "name": "route_3"
# }
# ]
# }
# ]
# }
# ]
# }
# ]
# After state:
# ------------
#
# vios#show running-config | include ip route|ipv6 route
# ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50
# ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40
# ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2
# ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3
# ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name test_v6 tag 105
# Using rendered
- name: Render the commands for provided configuration
cisco.ios.ios_static_routes:
config:
- vrf: ansible_temp_vrf
address_families:
- afi: ipv4
routes:
- dest: 192.0.2.0/24
next_hops:
- forward_router_address: 192.0.2.1
name: test_vrf
tag: 50
track: 150
- address_families:
- afi: ipv4
routes:
- dest: 198.51.100.0/24
next_hops:
- forward_router_address: 198.51.101.1
name: route_1
distance_metric: 110
tag: 40
multicast: true
- forward_router_address: 198.51.101.2
name: route_2
distance_metric: 30
- forward_router_address: 198.51.101.3
name: route_3
- afi: ipv6
routes:
- dest: 2001:DB8:0:3::/64
next_hops:
- forward_router_address: 2001:DB8:0:3::2
name: test_v6
tag: 105
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "ip route vrf ansible_temp_vrf 192.0.2.0 255.255.255.0 192.0.2.1 name test_vrf track 150 tag 50",
# "ip route 198.51.100.0 255.255.255.0 198.51.101.1 110 multicast name route_1 tag 40",
# "ip route 198.51.100.0 255.255.255.0 198.51.101.2 30 name route_2",
# "ip route 198.51.100.0 255.255.255.0 198.51.101.3 name route_3",
# "ipv6 route 2001:DB8:0:3::/64 2001:DB8:0:3::2 name test_v6 tag 105"
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device **Sample:** ['ip route vrf test 172.31.10.0 255.255.255.0 10.10.10.2 name new\_test multicast'] |
| **gathered** list / elements=string | When `state` is *gathered* | The configuration as structured data transformed for the running configuration fetched from remote host **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **parsed** list / elements=string | When `state` is *parsed* | The configuration as structured data transformed for the value of `running_config` option **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **rendered** list / elements=string | When `state` is *rendered* | The set of CLI commands generated from the value in `config` option **Sample:** ['interface Ethernet1/1', 'mtu 1800'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ios.ios_lldp β Manage LLDP configuration on Cisco IOS network devices. cisco.ios.ios\_lldp β Manage LLDP configuration on Cisco IOS network devices.
=============================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_lldp`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of LLDP service on Cisco IOS network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **state** string | **Choices:*** **present** β
* absent
* enabled
* disabled
| State of the LLDP configuration. If value is *present* lldp will be enabled else if it is *absent* it will be disabled. |
Notes
-----
Note
* Tested against IOS 15.2
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: Enable LLDP service
cisco.ios.ios_lldp:
state: present
- name: Disable LLDP service
cisco.ios.ios_lldp:
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['lldp run'] |
### Authors
* Ganesh Nalawade (@ganeshrn)
ansible cisco.ios.ios_config β Manage Cisco IOS configuration sections cisco.ios.ios\_config β Manage Cisco IOS configuration sections
===============================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_config`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Cisco IOS configurations use a simple block indent file syntax for segmenting configuration into sections. This module provides an implementation for working with IOS configuration sections in a deterministic way.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **after** list / elements=string | | The ordered set of commands to append to the end of the command stack if a change needs to be made. Just like with *before* this allows the playbook designer to append a set of commands to be executed after the command set. |
| **backup** boolean | **Choices:*** **no** β
* yes
| This argument will cause the module to create a full backup of the current `running-config` from the remote device before any changes are made. If the `backup_options` value is not given, the backup file is written to the `backup` folder in the playbook root directory or role root directory, if playbook is part of an ansible role. If the directory does not exist, it is created. |
| **backup\_options** dictionary | | This is a dict object containing configurable options related to backup file path. The value of this option is read only when `backup` is set to *yes*, if `backup` is set to *no* this option will be silently ignored. |
| | **dir\_path** path | | This option provides the path ending with directory name in which the backup configuration file will be stored. If the directory does not exist it will be first created and the filename is either the value of `filename` or default filename as described in `filename` options description. If the path value is not given in that case a *backup* directory will be created in the current working directory and backup configuration will be copied in `filename` within *backup* directory. |
| | **filename** string | | The filename to be used to store the backup configuration. If the filename is not given it will be generated based on the hostname, current time and date in format defined by <hostname>\_config.<current-date>@<current-time> |
| **before** list / elements=string | | The ordered set of commands to push on to the command stack if a change needs to be made. This allows the playbook designer the opportunity to perform configuration commands prior to pushing any changes without affecting how the set of commands are matched against the system. |
| **defaults** boolean | **Choices:*** **no** β
* yes
| This argument specifies whether or not to collect all defaults when getting the remote device running config. When enabled, the module will get the current config by issuing the command `show running-config all`. |
| **diff\_against** string | **Choices:*** running
* startup
* intended
| When using the `ansible-playbook --diff` command line argument the module can generate diffs against different sources. When this option is configure as *startup*, the module will return the diff of the running-config against the startup-config. When this option is configured as *intended*, the module will return the diff of the running-config against the configuration provided in the `intended_config` argument. When this option is configured as *running*, the module will return the before and after diff of the running-config with respect to any changes made to the device configuration. |
| **diff\_ignore\_lines** list / elements=string | | Use this argument to specify one or more lines that should be ignored during the diff. This is used for lines in the configuration that are automatically updated by the system. This argument takes a list of regular expressions or exact line matches. |
| **intended\_config** string | | The `intended_config` provides the master configuration that the node should conform to and is used to check the final running-config against. This argument will not modify any settings on the remote device and is strictly used to check the compliance of the current device's configuration against. When specifying this argument, the task should also modify the `diff_against` value and set it to *intended*. The configuration lines for this value should be similar to how it will appear if present in the running-configuration of the device including the indentation to ensure correct diff. |
| **lines** list / elements=string | | The ordered set of commands that should be configured in the section. The commands must be the exact same commands as found in the device running-config to ensure idempotency and correct diff. Be sure to note the configuration command syntax as some commands are automatically modified by the device config parser.
aliases: commands |
| **match** string | **Choices:*** **line** β
* strict
* exact
* none
| Instructs the module on the way to perform the matching of the set of commands against the current device config. If match is set to *line*, commands are matched line by line. If match is set to *strict*, command lines are matched with respect to position. If match is set to *exact*, command lines must be an equal match. Finally, if match is set to *none*, the module will not attempt to compare the source configuration with the running configuration on the remote device. |
| **multiline\_delimiter** string | **Default:**"@" | This argument is used when pushing a multiline configuration element to the IOS device. It specifies the character to use as the delimiting character. This only applies to the configuration action. |
| **parents** list / elements=string | | The ordered set of parents that uniquely identify the section or hierarchy the commands should be checked against. If the parents argument is omitted, the commands are checked against the set of top level or global commands. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **replace** string | **Choices:*** **line** β
* block
| Instructs the module on the way to perform the configuration on the device. If the replace argument is set to *line* then the modified lines are pushed to the device in configuration mode. If the replace argument is set to *block* then the entire command block is pushed to the device in configuration mode if any line is not correct. |
| **running\_config** string | | The module, by default, will connect to the remote device and retrieve the current running-config to use as a base for comparing against the contents of source. There are times when it is not desirable to have the task get the current running-config for every task in a playbook. The *running\_config* argument allows the implementer to pass in the configuration to use as the base config for comparison. The configuration lines for this option should be similar to how it will appear if present in the running-configuration of the device including the indentation to ensure idempotency and correct diff.
aliases: config |
| **save\_when** string | **Choices:*** always
* **never** β
* modified
* changed
| When changes are made to the device running-configuration, the changes are not copied to non-volatile storage by default. Using this argument will change that before. If the argument is set to *always*, then the running-config will always be copied to the startup-config and the *modified* flag will always be set to True. If the argument is set to *modified*, then the running-config will only be copied to the startup-config if it has changed since the last save to startup-config. If the argument is set to *never*, the running-config will never be copied to the startup-config. If the argument is set to *changed*, then the running-config will only be copied to the startup-config if the task has made a change. *changed* was added in Ansible 2.5. |
| **src** string | | Specifies the source path to the file that contains the configuration or configuration template to load. The path to the source file can either be the full path on the Ansible control host or a relative path from the playbook or role root directory. This argument is mutually exclusive with *lines*, *parents*. The configuration lines in the source file should be similar to how it will appear if present in the running-configuration of the device including the indentation to ensure idempotency and correct diff. |
Notes
-----
Note
* Tested against IOS 15.6
* Abbreviated commands are NOT idempotent, see [https://docs.ansible.com/ansible/latest/network/user\_guide/faq.html#why-do-the-config-modules-always-return-changed-true-with-abbreviated-commands](../../../network/user_guide/faq#why-do-the-config-modules-always-return-changed-true-with-abbreviated-commands)
* To ensure idempotency and correct diff the configuration lines in the relevant module options should be similar to how they appear if present in the running configuration on device including the indentation.
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: configure top level configuration
cisco.ios.ios_config:
lines: hostname {{ inventory_hostname }}
- name: configure interface settings
cisco.ios.ios_config:
lines:
- description test interface
- ip address 172.31.1.1 255.255.255.0
parents: interface Ethernet1
- name: configure ip helpers on multiple interfaces
cisco.ios.ios_config:
lines:
- ip helper-address 172.26.1.10
- ip helper-address 172.26.3.8
parents: '{{ item }}'
with_items:
- interface Ethernet1
- interface Ethernet2
- interface GigabitEthernet1
- name: configure policer in Scavenger class
cisco.ios.ios_config:
lines:
- conform-action transmit
- exceed-action drop
parents:
- policy-map Foo
- class Scavenger
- police cir 64000
- name: load new acl into device
cisco.ios.ios_config:
lines:
- 10 permit ip host 192.0.2.1 any log
- 20 permit ip host 192.0.2.2 any log
- 30 permit ip host 192.0.2.3 any log
- 40 permit ip host 192.0.2.4 any log
- 50 permit ip host 192.0.2.5 any log
parents: ip access-list extended test
before: no ip access-list extended test
match: exact
- name: check the running-config against master config
cisco.ios.ios_config:
diff_against: intended
intended_config: "{{ lookup('file', 'master.cfg') }}"
- name: check the startup-config against the running-config
cisco.ios.ios_config:
diff_against: startup
diff_ignore_lines:
- ntp clock .*
- name: save running to startup when modified
cisco.ios.ios_config:
save_when: modified
- name: for idempotency, use full-form commands
cisco.ios.ios_config:
lines:
# - shut
- shutdown
# parents: int gig1/0/11
parents: interface GigabitEthernet1/0/11
# Set boot image based on comparison to a group_var (version) and the version
# that is returned from the `ios_facts` module
- name: SETTING BOOT IMAGE
cisco.ios.ios_config:
lines:
- no boot system
- boot system flash bootflash:{{new_image}}
host: '{{ inventory_hostname }}'
when: ansible_net_version != version
- name: render a Jinja2 template onto an IOS device
cisco.ios.ios_config:
backup: yes
src: ios_template.j2
- name: configurable backup path
cisco.ios.ios_config:
src: ios_template.j2
backup: yes
backup_options:
filename: backup.cfg
dir_path: /home/user
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **backup\_path** string | when backup is yes | The full path to the backup file **Sample:** /playbooks/ansible/backup/ios\_config.2016-07-16@22:28:34 |
| **commands** list / elements=string | always | The set of commands that will be pushed to the remote device **Sample:** ['hostname foo', 'router ospf 1', 'router-id 192.0.2.1'] |
| **date** string | when backup is yes | The date extracted from the backup file name **Sample:** 2016-07-16 |
| **filename** string | when backup is yes and filename is not specified in backup options | The name of the backup file **Sample:** ios\_config.2016-07-16@22:28:34 |
| **shortname** string | when backup is yes and filename is not specified in backup options | The full path to the backup file excluding the timestamp **Sample:** /playbooks/ansible/backup/ios\_config |
| **time** string | when backup is yes | The time extracted from the backup file name **Sample:** 22:28:34 |
| **updates** list / elements=string | always | The set of commands that will be pushed to the remote device **Sample:** ['hostname foo', 'router ospf 1', 'router-id 192.0.2.1'] |
### Authors
* Peter Sprygada (@privateip)
| programming_docs |
ansible cisco.ios.ios_ospfv3 β OSPFv3 resource module cisco.ios.ios\_ospfv3 β OSPFv3 resource module
==============================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_ospfv3`.
New in version 1.1.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module configures and manages the Open Shortest Path First (OSPF) version 3 on IOS platforms.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** dictionary | | A list of configurations for ospfv3. |
| | **processes** list / elements=dictionary | | List of OSPF instance configurations. |
| | | **address\_family** list / elements=dictionary | | Enter Address Family command mode |
| | | | **adjacency** dictionary | | Control adjacency formation |
| | | | | **disable** boolean | **Choices:*** no
* yes
| Disable adjacency staggering |
| | | | | **max\_adjacency** integer | | Maximum number of adjacencies allowed to be forming Please refer vendor documentation for valid values |
| | | | | **min\_adjacency** integer | | Initial number of adjacencies allowed to be forming in an area Please refer vendor documentation for valid values |
| | | | | **none** boolean | **Choices:*** no
* yes
| No initial |
| | | | **afi** string | **Choices:*** ipv4
* ipv6
| Enter Address Family command mode |
| | | | **areas** list / elements=dictionary | | OSPF area parameters |
| | | | | **area\_id** string | | OSPF area ID as a decimal value. Please refer vendor documentation of Valid values. OSPF area ID in IP address format(e.g. A.B.C.D) |
| | | | | **authentication** dictionary | | Authentication parameters |
| | | | | | **key\_chain** string | | Use a key-chain for cryptographic authentication keys |
| | | | | | **null** boolean | **Choices:*** no
* yes
| Use no authentication |
| | | | | **default\_cost** integer | | Set the summary default-cost of a NSSA/stub area Stub's advertised external route metric Note, please refer vendor documentation for respective valid values |
| | | | | **filter\_list** list / elements=dictionary | | Filter networks between OSPFv3 areas |
| | | | | | **direction** string / required | **Choices:*** in
* out
| The direction to apply on the filter networks sent to and from this area. |
| | | | | | **name** string | | Name of an IP prefix-list |
| | | | | **normal** boolean | **Choices:*** no
* yes
| Specify a normal area type |
| | | | | **nssa** dictionary | | Specify a NSSA area |
| | | | | | **default\_information\_originate** dictionary | | Originate Type 7 default into NSSA area |
| | | | | | | **metric** integer | | OSPF default metric |
| | | | | | | **metric\_type** integer | **Choices:*** 1
* 2
| OSPF metric type for default routes OSPF Link State type |
| | | | | | | **nssa\_only** boolean | **Choices:*** no
* yes
| Limit default advertisement to this NSSA area |
| | | | | | **no\_redistribution** boolean | **Choices:*** no
* yes
| No redistribution into this NSSA area |
| | | | | | **no\_summary** boolean | **Choices:*** no
* yes
| Do not send summary LSA into NSSA |
| | | | | | **set** boolean | **Choices:*** no
* yes
| Enable a NSSA area |
| | | | | | **translate** string | **Choices:*** always
* suppress-fa
| Translate LSA Always translate LSAs on this ABR Suppress forwarding address in translated LSAs |
| | | | | **ranges** list / elements=dictionary | | Summarize routes matching address/mask (border routers only) |
| | | | | | **address** string | | IP address to match |
| | | | | | **advertise** boolean | **Choices:*** no
* yes
| Advertise this range (default) Since, advertise when enabled is not shown in running-config idempotency won't be maintained for the play in the second or next run of the play. |
| | | | | | **cost** integer | | User specified metric for this range |
| | | | | | **netmask** string | | IP mask for address |
| | | | | | **not\_advertise** boolean | **Choices:*** no
* yes
| DoNotAdvertise this range |
| | | | | **sham\_link** dictionary | | Define a sham link and its parameters |
| | | | | | **authentication** dictionary | | Authentication parameters |
| | | | | | | **key\_chain** string | | Use a key-chain for cryptographic authentication keys |
| | | | | | | **null** boolean | **Choices:*** no
* yes
| Use no authentication |
| | | | | | **cost** integer | | Associate a cost with the sham-link Cost of the sham-link |
| | | | | | **destination** string | | IPv6 address associated with sham-link destination (X:X:X:X::X) |
| | | | | | **source** string | | IPv6 address associated with sham-link source (X:X:X:X::X) |
| | | | | | **ttl\_security** integer | | TTL security check maximum number of hops allowed |
| | | | | **stub** dictionary | | Specify a stub area Backbone can not be configured as stub area |
| | | | | | **no\_summary** boolean | **Choices:*** no
* yes
| Do not send summary LSA into stub area |
| | | | | | **set** boolean | **Choices:*** no
* yes
| Enable a stub area |
| | | | **authentication** dictionary | | Authentication parameters Authentication operation mode |
| | | | | **deployment** boolean | **Choices:*** no
* yes
| Deployment mode of operation |
| | | | | **normal** boolean | **Choices:*** no
* yes
| Normal mode of operation |
| | | | **auto\_cost** dictionary | | Calculate OSPF interface cost according to bandwidth |
| | | | | **reference\_bandwidth** integer | | Use reference bandwidth method to assign OSPF cost Note, refer vendor documentation for respective valid values |
| | | | | **set** boolean | **Choices:*** no
* yes
| Enable OSPF auto-cost |
| | | | **bfd** dictionary | | BFD configuration commands |
| | | | | **all\_interfaces** boolean | **Choices:*** no
* yes
| Enable BFD on all interfaces |
| | | | | **disable** boolean | **Choices:*** no
* yes
| Disable BFD on all interfaces |
| | | | **capability** boolean | **Choices:*** no
* yes
| Enable a specific feature Do not perform PE specific checks |
| | | | **compatible** dictionary | | OSPFv3 router compatibility list |
| | | | | **rfc1583** boolean | **Choices:*** no
* yes
| compatible with RFC 1583 |
| | | | | **rfc1587** boolean | **Choices:*** no
* yes
| compatible with RFC 1587 |
| | | | | **rfc5243** boolean | **Choices:*** no
* yes
| supports DBD exchange optimization |
| | | | **default\_information** dictionary | | Control distribution of default information |
| | | | | **always** boolean | **Choices:*** no
* yes
| Always advertise default route |
| | | | | **metric** integer | | OSPF default metric Note, refer vendor documentation for respective valid values |
| | | | | **metric\_type** integer | | OSPF metric type for default routes Note, please refer vendor documentation for respective valid range |
| | | | | **originate** boolean | **Choices:*** no
* yes
| Distribute a default route |
| | | | | **route\_map** string | | Route-map reference name |
| | | | **default\_metric** integer | | Set metric of redistributed routes |
| | | | **discard\_route** dictionary | | Enable or disable discard-route installation |
| | | | | **external** boolean | **Choices:*** no
* yes
| Discard route for summarised redistributed routes |
| | | | | **internal** boolean | **Choices:*** no
* yes
| Discard route for summarised inter-area routes |
| | | | | **sham\_link** boolean | **Choices:*** no
* yes
| Discard route for sham-link routes |
| | | | **distance** integer | | Define an administrative distance Note, please refer vendor documentation for respective valid range |
| | | | **distribute\_list** dictionary | | Filter networks in routing updates |
| | | | | **acls** list / elements=dictionary | | IP access list |
| | | | | | **direction** string / required | **Choices:*** in
* out
| Filter incoming and outgoing routing updates. |
| | | | | | **interface** string | | Interface configuration (GigabitEthernet A/B) Valid with incoming traffic |
| | | | | | **name** string / required | | IP access list name/number |
| | | | | | **protocol** string | | Protocol config (bgp 1). Valid with outgoing traffic |
| | | | | **prefix** dictionary | | Filter prefixes in routing updates |
| | | | | | **direction** string / required | **Choices:*** in
* out
| Filter incoming and outgoing routing updates. |
| | | | | | **gateway\_name** string | | Gateway name for filtering incoming updates based on gateway |
| | | | | | **interface** string | | Interface configuration (GigabitEthernet A/B) Valid with incoming traffic |
| | | | | | **name** string / required | | Name of an IP prefix-list |
| | | | | | **protocol** string | | Protocol config (bgp 1). Valid with outgoing traffic |
| | | | | **route\_map** dictionary | | Filter prefixes in routing updates |
| | | | | | **name** string / required | | Route-map name |
| | | | **event\_log** dictionary | | Event Logging |
| | | | | **enable** boolean | **Choices:*** no
* yes
| Enable event Logging |
| | | | | **one\_shot** boolean | **Choices:*** no
* yes
| Disable Logging When Log Buffer Becomes Full |
| | | | | **pause** boolean | **Choices:*** no
* yes
| Pause Event Logging |
| | | | | **size** integer | | Maximum Number of Events Stored in the Event Log Note, refer vendor documentation for respective valid values |
| | | | **graceful\_restart** dictionary | | Graceful-restart options helper support |
| | | | | **disable** boolean | **Choices:*** no
* yes
| disable helper support |
| | | | | **enable** boolean | **Choices:*** no
* yes
| helper support enabled |
| | | | | **strict\_lsa\_checking** boolean | **Choices:*** no
* yes
| enable helper strict LSA checking |
| | | | **interface\_id** dictionary | | Source of the interface ID |
| | | | | **ios\_if\_index** boolean | **Choices:*** no
* yes
| IOS interface number |
| | | | | **snmp\_if\_index** boolean | **Choices:*** no
* yes
| SNMP MIB ifIndex |
| | | | **limit** dictionary | | Limit a specific OSPF feature |
| | | | | **dc** dictionary | | Demand circuit retransmissions |
| | | | | | **disable** boolean | **Choices:*** no
* yes
| Disble the feature |
| | | | | | **number** integer | | The maximum number of retransmissions |
| | | | | **non\_dc** dictionary | | Non-demand-circuit retransmissions |
| | | | | | **disable** boolean | **Choices:*** no
* yes
| Disble the feature |
| | | | | | **number** integer | | The maximum number of retransmissions |
| | | | **local\_rib\_criteria** dictionary | | Enable or disable usage of local RIB as route criteria |
| | | | | **enable** boolean | **Choices:*** no
* yes
| Enable usage of local RIB as route criteria |
| | | | | **forwarding\_address** boolean | **Choices:*** no
* yes
| Local RIB used to validate external/NSSA forwarding addresses |
| | | | | **inter\_area\_summary** boolean | **Choices:*** no
* yes
| Local RIB used as criteria for inter-area summaries |
| | | | | **nssa\_translation** boolean | **Choices:*** no
* yes
| Local RIB used as criteria for NSSA translation |
| | | | **log\_adjacency\_changes** dictionary | | Log changes in adjacency state |
| | | | | **detail** boolean | **Choices:*** no
* yes
| Log all state changes |
| | | | | **set** boolean | **Choices:*** no
* yes
| Log changes in adjacency state |
| | | | **manet** dictionary | | Specify MANET OSPF parameters |
| | | | | **cache** dictionary | | Specify MANET cache sizes |
| | | | | | **acknowledgement** integer | | Specify MANET acknowledgement cache size Maximum number of acknowledgements in cache |
| | | | | | **update** integer | | Specify MANET LSA cache size Maximum number of LSAs in cache |
| | | | | **hello** dictionary | | Unicast Hellos rather than multicast |
| | | | | | **multicast** boolean | **Choices:*** no
* yes
| Multicast Hello requests and responses rather than unicast |
| | | | | | **unicast** boolean | **Choices:*** no
* yes
| Unicast Hello requests and responses rather than multicast |
| | | | | **peering** dictionary | | MANET OSPF Smart Peering |
| | | | | | **disable** boolean | **Choices:*** no
* yes
| Disable selective peering |
| | | | | | **per\_interface** boolean | **Choices:*** no
* yes
| Select peers per interface rather than per node |
| | | | | | **redundancy** integer | | Redundant paths Number of redundant OSPF paths |
| | | | | | **set** boolean | **Choices:*** no
* yes
| Enable selective peering |
| | | | | **willingness** integer | | Specify and Relay willingness value |
| | | | **max\_lsa** dictionary | | Maximum number of non self-generated LSAs to accept |
| | | | | **ignore\_count** integer | | Maximum number of times adjacencies can be suppressed Note, refer vendor documentation for respective valid values |
| | | | | **ignore\_time** integer | | Number of minutes during which all adjacencies are suppressed Note, refer vendor documentation for respective valid values |
| | | | | **number** integer | | Maximum number of non self-generated LSAs to accept Note, refer vendor documentation for respective valid values |
| | | | | **reset\_time** integer | | Number of minutes after which ignore-count is reset to zero Note, refer vendor documentation for respective valid values |
| | | | | **threshold\_value** integer | | Threshold value (%) at which to generate a warning msg Note, refer vendor documentation for respective valid values |
| | | | | **warning\_only** boolean | **Choices:*** no
* yes
| Only give a warning message when limit is exceeded |
| | | | **max\_metric** dictionary | | Set maximum metric Maximum metric in self-originated router-LSAs |
| | | | | **disable** boolean | **Choices:*** no
* yes
| disable maximum metric in self-originated router-LSAs |
| | | | | **external\_lsa** integer | | Override external-lsa metric with max-metric value Overriding metric in external-LSAs Note, refer vendor documentation for respective valid values |
| | | | | **inter\_area\_lsas** integer | | Override inter-area-lsas metric with max-metric value Overriding metric in inter-area-LSAs Note, refer vendor documentation for respective valid values |
| | | | | **on\_startup** dictionary | | Set maximum metric temporarily after reboot |
| | | | | | **time** integer | | Time, in seconds, router-LSAs are originated with max-metric Note, please refer vendor documentation for respective valid range |
| | | | | | **wait\_for\_bgp** boolean | **Choices:*** no
* yes
| Let BGP decide when to originate router-LSA with normal metric |
| | | | | **stub\_prefix\_lsa** boolean | **Choices:*** no
* yes
| Set maximum metric for stub links in prefix LSAs |
| | | | **maximum\_paths** integer | | Forward packets over multiple paths Number of paths |
| | | | **passive\_interface** string | | Suppress routing updates on an interface |
| | | | **prefix\_suppression** dictionary | | Prefix suppression |
| | | | | **disable** boolean | **Choices:*** no
* yes
| Disable prefix suppression |
| | | | | **enable** boolean | **Choices:*** no
* yes
| Enable prefix suppression |
| | | | **queue\_depth** dictionary | | Hello/Router process queue depth |
| | | | | **hello** dictionary | | OSPF Hello process queue depth |
| | | | | | **max\_packets** integer | | maximum number of packets in the queue |
| | | | | | **unlimited** boolean | **Choices:*** no
* yes
| Unlimited queue depth |
| | | | | **update** dictionary | | OSPF Router process queue depth |
| | | | | | **max\_packets** integer | | maximum number of packets in the queue |
| | | | | | **unlimited** boolean | **Choices:*** no
* yes
| Unlimited queue depth |
| | | | **router\_id** string | | Router-id address for this OSPF process OSPF router-id in IP address format (A.B.C.D) |
| | | | **shutdown** dictionary | | Shutdown the router process |
| | | | | **disable** boolean | **Choices:*** no
* yes
| Disable Shutdown |
| | | | | **enable** boolean | **Choices:*** no
* yes
| Shutdown the router process |
| | | | **summary\_prefix** dictionary | | Configure IP address summaries |
| | | | | **address** string | | IP summary address (A.B.C.D) IP prefix <network>/<length> (A.B.C.D/nn) |
| | | | | **mask** string | | IP Summary mask |
| | | | | **not\_advertise** boolean | **Choices:*** no
* yes
| Do not advertise or translate |
| | | | | **nssa\_only** boolean | **Choices:*** no
* yes
| Limit summary to NSSA areas |
| | | | | **tag** integer | | Set tag |
| | | | **timers** dictionary | | Adjust routing timers |
| | | | | **lsa** integer | | OSPF LSA timers, arrival timer The minimum interval in milliseconds between accepting the same LSA Note, refer vendor documentation for respective valid values |
| | | | | **manet** dictionary | | OSPF MANET timers |
| | | | | | **cache** dictionary | | Specify MANET cache sizes |
| | | | | | | **acknowledgement** integer | | Specify MANET acknowledgement cache size |
| | | | | | | **redundancy** integer | | Specify MANET LSA cache size |
| | | | | | **hello** boolean | **Choices:*** no
* yes
| Unicast Hellos rather than multicast Unicast Hello requests and responses rather than multicast |
| | | | | | **peering** dictionary | | MANET OSPF Smart Peering |
| | | | | | | **per\_interface** boolean | **Choices:*** no
* yes
| Select peers per interface rather than per node |
| | | | | | | **redundancy** integer | | Redundant paths Number of redundant OSPF paths |
| | | | | | | **set** boolean | **Choices:*** no
* yes
| Enable selective peering |
| | | | | | **willingness** integer | | Specify and Relay willingness value |
| | | | | **pacing** dictionary | | OSPF pacing timers |
| | | | | | **flood** integer | | OSPF flood pacing timer The minimum interval in msec to pace limit flooding on interface Note, refer vendor documentation for respective valid values |
| | | | | | **lsa\_group** integer | | OSPF LSA group pacing timer Interval in sec between group of LSA being refreshed or maxaged Note, refer vendor documentation for respective valid values |
| | | | | | **retransmission** integer | | OSPF retransmission pacing timer The minimum interval in msec between neighbor retransmissions Note, refer vendor documentation for respective valid values |
| | | | | **throttle** dictionary | | OSPF throttle timers |
| | | | | | **lsa** dictionary | | OSPF LSA throttle timers |
| | | | | | | **first\_delay** integer | | Delay to generate first occurrence of LSA in milliseconds Note, refer vendor documentation for respective valid values |
| | | | | | | **max\_delay** integer | | Maximum delay between originating the same LSA in milliseconds Note, refer vendor documentation for respective valid values |
| | | | | | | **min\_delay** integer | | Minimum delay between originating the same LSA in milliseconds Note, refer vendor documentation for respective valid values |
| | | | | | **spf** dictionary | | OSPF SPF throttle timers - Delay between receiving a change to SPF calculation in milliseconds - Note, refer vendor documentation for respective valid values |
| | | | | | | **between\_delay** integer | | Delay between first and second SPF calculation in milliseconds Note, refer vendor documentation for respective valid values |
| | | | | | | **max\_delay** integer | | Maximum wait time in milliseconds for SPF calculations Note, refer vendor documentation for respective valid values |
| | | | | | | **receive\_delay** integer | | Delay between receiving a change to SPF calculation in milliseconds Note, refer vendor documentation for respective valid values |
| | | | **unicast** boolean | **Choices:*** no
* yes
| Address Family modifier |
| | | | **vrf** string | | Specify parameters for a VPN Routing/Forwarding instance |
| | | **adjacency** dictionary | | Control adjacency formation |
| | | | **max\_adjacency** integer | | Maximum number of adjacencies allowed to be forming Please refer vendor documentation for valid values |
| | | | **min\_adjacency** integer | | Initial number of adjacencies allowed to be forming in an area Please refer vendor documentation for valid values |
| | | | **none** boolean | **Choices:*** no
* yes
| No initial |
| | | **areas** list / elements=dictionary | | OSPF area parameters |
| | | | **area\_id** string | | OSPF area ID as a decimal value. Please refer vendor documentation of Valid values. OSPF area ID in IP address format(e.g. A.B.C.D) |
| | | | **authentication** dictionary | | Authentication parameters |
| | | | | **ipsec** dictionary | | Use IPsec authentication |
| | | | | | **hex\_string** string | | SHA-1 key (40 chars) |
| | | | | | **md5** integer | | Use MD5 authentication |
| | | | | | **sha1** integer | | Use SHA-1 authentication |
| | | | | | **spi** integer | | Set the SPI (Security Parameters Index) |
| | | | | **key\_chain** string | | Use a key-chain for cryptographic authentication keys |
| | | | **default\_cost** integer | | Set the summary default-cost of a NSSA/stub area Stub's advertised external route metric Note, please refer vendor documentation for respective valid values |
| | | | **nssa** dictionary | | Specify a NSSA area |
| | | | | **default\_information\_originate** dictionary | | Originate Type 7 default into NSSA area |
| | | | | | **metric** integer | | OSPF default metric |
| | | | | | **metric\_type** integer | **Choices:*** 1
* 2
| OSPF metric type for default routes OSPF Link State type |
| | | | | | **nssa\_only** boolean | **Choices:*** no
* yes
| Limit default advertisement to this NSSA area |
| | | | | **no\_redistribution** boolean | **Choices:*** no
* yes
| No redistribution into this NSSA area |
| | | | | **no\_summary** boolean | **Choices:*** no
* yes
| Do not send summary LSA into NSSA |
| | | | | **set** boolean | **Choices:*** no
* yes
| Enable a NSSA area |
| | | | | **translate** string | **Choices:*** always
* suppress-fa
| Translate LSA Always translate LSAs on this ABR Suppress forwarding address in translated LSAs |
| | | | **stub** dictionary | | Specify a stub area Backbone can not be configured as stub area |
| | | | | **no\_summary** boolean | **Choices:*** no
* yes
| Do not send summary LSA into stub area |
| | | | | **set** boolean | **Choices:*** no
* yes
| Enable a stub area |
| | | **authentication** boolean | **Choices:*** no
* yes
| Authentication parameter mode Deployment mode of operation |
| | | **auto\_cost** dictionary | | Calculate OSPF interface cost according to bandwidth |
| | | | **reference\_bandwidth** integer | | Use reference bandwidth method to assign OSPF cost Note, refer vendor documentation for respective valid values |
| | | | **set** boolean | **Choices:*** no
* yes
| Enable OSPF auto-cost |
| | | **bfd** boolean | **Choices:*** no
* yes
| BFD configuration commands Enable BFD on all interfaces |
| | | **compatible** dictionary | | OSPFv3 router compatibility list |
| | | | **rfc1583** boolean | **Choices:*** no
* yes
| compatible with RFC 1583 |
| | | | **rfc1587** boolean | **Choices:*** no
* yes
| compatible with RFC 1587 |
| | | | **rfc5243** boolean | **Choices:*** no
* yes
| supports DBD exchange optimization |
| | | **event\_log** dictionary | | Event Logging |
| | | | **enable** boolean | **Choices:*** no
* yes
| Enable event Logging |
| | | | **one\_shot** boolean | **Choices:*** no
* yes
| Disable Logging When Log Buffer Becomes Full |
| | | | **pause** boolean | **Choices:*** no
* yes
| Pause Event Logging |
| | | | **size** integer | | Maximum Number of Events Stored in the Event Log Note, refer vendor documentation for respective valid values |
| | | **graceful\_restart** dictionary | | Graceful-restart options for helper support |
| | | | **disable** boolean | **Choices:*** no
* yes
| disable helper support |
| | | | **strict\_lsa\_checking** boolean | **Choices:*** no
* yes
| enable helper strict LSA checking |
| | | **help** boolean | **Choices:*** no
* yes
| Description of the interactive help system |
| | | **interface\_id** boolean | **Choices:*** no
* yes
| Source of the interface ID SNMP MIB ifIndex |
| | | **limit** dictionary | | Limit a specific OSPF feature and LS update, DBD, and LS request retransmissions |
| | | | **dc** dictionary | | Demand circuit retransmissions |
| | | | | **disable** boolean | **Choices:*** no
* yes
| Disble the feature |
| | | | | **number** integer | | The maximum number of retransmissions |
| | | | **non\_dc** dictionary | | Non-demand-circuit retransmissions |
| | | | | **disable** boolean | **Choices:*** no
* yes
| Disble the feature |
| | | | | **number** integer | | The maximum number of retransmissions |
| | | **local\_rib\_criteria** dictionary | | Enable or disable usage of local RIB as route criteria |
| | | | **enable** boolean | **Choices:*** no
* yes
| Enable usage of local RIB as route criteria |
| | | | **forwarding\_address** boolean | **Choices:*** no
* yes
| Local RIB used to validate external/NSSA forwarding addresses |
| | | | **inter\_area\_summary** boolean | **Choices:*** no
* yes
| Local RIB used as criteria for inter-area summaries |
| | | | **nssa\_translation** boolean | **Choices:*** no
* yes
| Local RIB used as criteria for NSSA translation |
| | | **log\_adjacency\_changes** dictionary | | Log changes in adjacency state |
| | | | **detail** boolean | **Choices:*** no
* yes
| Log all state changes |
| | | | **set** boolean | **Choices:*** no
* yes
| Log changes in adjacency state |
| | | **manet** dictionary | | Specify MANET OSPF parameters |
| | | | **cache** dictionary | | Specify MANET cache sizes |
| | | | | **acknowledgement** integer | | Specify MANET acknowledgement cache size |
| | | | | **redundancy** integer | | Specify MANET LSA cache size |
| | | | **hello** boolean | **Choices:*** no
* yes
| Unicast Hellos rather than multicast Unicast Hello requests and responses rather than multicast |
| | | | **peering** dictionary | | MANET OSPF Smart Peering |
| | | | | **per\_interface** boolean | **Choices:*** no
* yes
| Select peers per interface rather than per node |
| | | | | **redundancy** integer | | Redundant paths Number of redundant OSPF paths |
| | | | | **set** boolean | **Choices:*** no
* yes
| Enable selective peering |
| | | | **willingness** integer | | Specify and Relay willingness value |
| | | **max\_lsa** dictionary | | Maximum number of non self-generated LSAs to accept |
| | | | **ignore\_count** integer | | Maximum number of times adjacencies can be suppressed Note, refer vendor documentation for respective valid values |
| | | | **ignore\_time** integer | | Number of minutes during which all adjacencies are suppressed Note, refer vendor documentation for respective valid values |
| | | | **number** integer | | Maximum number of non self-generated LSAs to accept Note, refer vendor documentation for respective valid values |
| | | | **reset\_time** integer | | Number of minutes after which ignore-count is reset to zero Note, refer vendor documentation for respective valid values |
| | | | **threshold\_value** integer | | Threshold value (%) at which to generate a warning msg Note, refer vendor documentation for respective valid values |
| | | | **warning\_only** boolean | **Choices:*** no
* yes
| Only give a warning message when limit is exceeded |
| | | **max\_metric** dictionary | | Set maximum metric |
| | | | **external\_lsa** integer | | Override external-lsa metric with max-metric value Overriding metric in external-LSAs Note, refer vendor documentation for respective valid values |
| | | | **include\_stub** boolean | **Choices:*** no
* yes
| Set maximum metric for stub links in router-LSAs |
| | | | **on\_startup** dictionary | | Set maximum metric temporarily after reboot |
| | | | | **time** integer | | Time, in seconds, router-LSAs are originated with max-metric Note, please refer vendor documentation for respective valid range |
| | | | | **wait\_for\_bgp** boolean | **Choices:*** no
* yes
| Let BGP decide when to originate router-LSA with normal metric |
| | | | **router\_lsa** boolean / required | **Choices:*** no
* yes
| Maximum metric in self-originated router-LSAs |
| | | | **summary\_lsa** integer | | Override summary-lsa metric with max-metric value Note, please refer vendor documentation for respective valid range |
| | | **passive\_interface** string | | Suppress routing updates on an interface |
| | | **prefix\_suppression** boolean | **Choices:*** no
* yes
| Enable prefix suppression |
| | | **process\_id** integer / required | | Process ID |
| | | **queue\_depth** dictionary | | Hello/Router process queue depth |
| | | | **hello** dictionary | | OSPF Hello process queue depth |
| | | | | **max\_packets** integer | | maximum number of packets in the queue |
| | | | | **unlimited** boolean | **Choices:*** no
* yes
| Unlimited queue depth |
| | | **router\_id** string | | Router-id address for this OSPF process OSPF router-id in IP address format (A.B.C.D) |
| | | **shutdown** boolean | **Choices:*** no
* yes
| Shutdown the router process |
| | | **timers** dictionary | | Adjust routing timers |
| | | | **lsa** integer | | OSPF LSA timers, arrival timer The minimum interval in milliseconds between accepting the same LSA Note, refer vendor documentation for respective valid values |
| | | | **manet** dictionary | | OSPF MANET timers |
| | | | | **cache** dictionary | | Specify MANET cache sizes |
| | | | | | **acknowledgement** integer | | Specify MANET acknowledgement cache size |
| | | | | | **redundancy** integer | | Specify MANET LSA cache size |
| | | | | **hello** boolean | **Choices:*** no
* yes
| Unicast Hellos rather than multicast Unicast Hello requests and responses rather than multicast |
| | | | | **peering** dictionary | | MANET OSPF Smart Peering |
| | | | | | **per\_interface** boolean | **Choices:*** no
* yes
| Select peers per interface rather than per node |
| | | | | | **redundancy** integer | | Redundant paths Number of redundant OSPF paths |
| | | | | | **set** boolean | **Choices:*** no
* yes
| Enable selective peering |
| | | | | **willingness** integer | | Specify and Relay willingness value |
| | | | **pacing** dictionary | | OSPF pacing timers |
| | | | | **flood** integer | | OSPF flood pacing timer The minimum interval in msec to pace limit flooding on interface Note, refer vendor documentation for respective valid values |
| | | | | **lsa\_group** integer | | OSPF LSA group pacing timer Interval in sec between group of LSA being refreshed or maxaged Note, refer vendor documentation for respective valid values |
| | | | | **retransmission** integer | | OSPF retransmission pacing timer The minimum interval in msec between neighbor retransmissions Note, refer vendor documentation for respective valid values |
| | | | **throttle** dictionary | | OSPF throttle timers |
| | | | | **lsa** dictionary | | OSPF LSA throttle timers |
| | | | | | **first\_delay** integer | | Delay to generate first occurrence of LSA in milliseconds Note, refer vendor documentation for respective valid values |
| | | | | | **max\_delay** integer | | Maximum delay between originating the same LSA in milliseconds Note, refer vendor documentation for respective valid values |
| | | | | | **min\_delay** integer | | Minimum delay between originating the same LSA in milliseconds Note, refer vendor documentation for respective valid values |
| | | | | **spf** dictionary | | OSPF SPF throttle timers - Delay between receiving a change to SPF calculation in milliseconds - Note, refer vendor documentation for respective valid values |
| | | | | | **between\_delay** integer | | Delay between first and second SPF calculation in milliseconds Note, refer vendor documentation for respective valid values |
| | | | | | **max\_delay** integer | | Maximum wait time in milliseconds for SPF calculations Note, refer vendor documentation for respective valid values |
| | | | | | **receive\_delay** integer | | Delay between receiving a change to SPF calculation in milliseconds Note, refer vendor documentation for respective valid values |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **sh running-config | section ^router ospfv3**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* gathered
* parsed
* rendered
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL.
Examples
--------
```
# Using deleted
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospfv3
# router ospfv3 1
# max-metric router-lsa on-startup 110
# area 10 nssa default-information-originate metric 10
# !
# address-family ipv4 unicast vrf blue
# adjacency stagger 50 50
# area 25 nssa default-information-originate metric 25 nssa-only
# exit-address-family
# router ospfv3 200
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# !
# address-family ipv4 unicast
# adjacency stagger 200 200
# exit-address-family
- name: Delete provided OSPF V3 processes
cisco.ios.ios_ospfv3:
config:
processes:
- process_id: 1
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "no router ospfv3 1"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^router ospfv3
# router ospfv3 200
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# !
# address-family ipv4 unicast
# adjacency stagger 200 200
# exit-address-family
# Using deleted without any config passed (NOTE: This will delete all OSPFV3 configuration from device)
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospfv3
# router ospfv3 1
# max-metric router-lsa on-startup 110
# area 10 nssa default-information-originate metric 10
# !
# address-family ipv4 unicast vrf blue
# adjacency stagger 50 50
# area 25 nssa default-information-originate metric 25 nssa-only
# exit-address-family
# router ospfv3 200
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# !
# address-family ipv4 unicast
# adjacency stagger 200 200
# exit-address-family
- name: Delete all OSPF processes
cisco.ios.ios_ospfv3:
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "no router ospfv3 200",
# "no router ospfv3 1"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^router ospfv3
# router-ios#
# Using merged
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospfv3
# router-ios#
- name: Merge provided OSPFV3 configuration
cisco.ios.ios_ospfv3:
config:
processes:
- process_id: 1
max_metric:
router_lsa: true
on_startup:
time: 110
address_family:
- afi: ipv4
unicast: true
vrf: blue
adjacency:
min_adjacency: 50
max_adjacency: 50
areas:
- area_id: 25
nssa:
default_information_originate:
metric: 25
nssa_only: true
areas:
- area_id: "10"
nssa:
default_information_originate:
metric: 10
timers:
throttle:
lsa:
first_delay: 12
min_delay: 14
max_delay: 16
- process_id: 200
address_family:
- afi: ipv4
unicast: true
adjacency:
min_adjacency: 200
max_adjacency: 200
max_metric:
router_lsa: true
on_startup:
time: 100
auto_cost:
reference_bandwidth: 4
state: merged
# Commands Fired:
# ---------------
#
# "commands": [
# "router ospfv3 1",
# "max-metric router-lsa on-startup 110",
# "area 10 nssa default-information-originate metric 10",
# "address-family ipv4 unicast vrf blue",
# "adjacency stagger 50 50",
# "area 25 nssa default-information-originate metric 25 nssa-only",
# "exit-address-family",
# "router ospfv3 200",
# "auto-cost reference-bandwidth 4",
# "max-metric router-lsa on-startup 100",
# "address-family ipv4 unicast",
# "adjacency stagger 200 200",
# "exit-address-family"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^router ospfv3
# router ospfv3 1
# max-metric router-lsa on-startup 110
# area 10 nssa default-information-originate metric 10
# !
# address-family ipv4 unicast vrf blue
# adjacency stagger 50 50
# area 25 nssa default-information-originate metric 25 nssa-only
# exit-address-family
# router ospfv3 200
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# !
# address-family ipv4 unicast
# adjacency stagger 200 200
# exit-address-family
# Using overridden
# Before state:
# -------------
#
# router ospfv3 1
# max-metric router-lsa on-startup 110
# area 10 nssa default-information-originate metric 10
# !
# address-family ipv4 unicast vrf blue
# adjacency stagger 50 50
# area 25 nssa default-information-originate metric 25 nssa-only
# exit-address-family
# router ospfv3 200
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# !
# address-family ipv4 unicast
# adjacency stagger 200 200
# exit-address-family
- name: Override provided OSPFV3 configuration
cisco.ios.ios_ospfv3:
config:
processes:
- process_id: 200
max_metric:
router_lsa: true
on_startup:
time: 200
address_family:
- afi: ipv4
unicast: true
adjacency:
min_adjacency: 50
max_adjacency: 50
areas:
- area_id: 200
nssa:
default_information_originate:
metric: 200
nssa_only: true
areas:
- area_id: "10"
nssa:
default_information_originate:
metric: 10
state: overridden
# Commands Fired:
# ---------------
#
# "commands": [
# "no router ospfv3 1",
# "router ospfv3 200",
# "no auto-cost reference-bandwidth 4",
# "max-metric router-lsa on-startup 200",
# "area 10 nssa default-information-originate metric 10",
# "address-family ipv4 unicast",
# "adjacency stagger 50 50",
# "area 200 nssa default-information-originate metric 200 nssa-only",
# "exit-address-family"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^router ospfv3
# router ospfv3 200
# max-metric router-lsa on-startup 200
# area 10 nssa default-information-originate metric 10
# !
# address-family ipv4 unicast
# adjacency stagger 50 50
# area 200 nssa default-information-originate metric 200 nssa-only
# exit-address-family
# Using replaced
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospfv3
# router ospfv3 1
# max-metric router-lsa on-startup 110
# area 10 nssa default-information-originate metric 10
# !
# address-family ipv4 unicast vrf blue
# adjacency stagger 50 50
# area 25 nssa default-information-originate metric 25 nssa-only
# exit-address-family
# router ospfv3 200
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# !
# address-family ipv4 unicast
# adjacency stagger 200 200
# exit-address-family
- name: Replaced provided OSPFV3 configuration
cisco.ios.ios_ospfv3:
config:
processes:
- process_id: 200
max_metric:
router_lsa: true
on_startup:
time: 200
address_family:
- afi: ipv4
unicast: true
adjacency:
min_adjacency: 50
max_adjacency: 50
areas:
- area_id: 200
nssa:
default_information_originate:
metric: 200
nssa_only: true
areas:
- area_id: "10"
nssa:
default_information_originate:
metric: 10
state: replaced
# Commands Fired:
# ---------------
# "commands": [
# "router ospfv3 200",
# "no auto-cost reference-bandwidth 4",
# "max-metric router-lsa on-startup 200",
# "area 10 nssa default-information-originate metric 10",
# "address-family ipv4 unicast",
# "adjacency stagger 50 50",
# "area 200 nssa default-information-originate metric 200 nssa-only",
# "exit-address-family"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^router ospfv3
# router ospfv3 1
# max-metric router-lsa on-startup 110
# area 10 nssa default-information-originate metric 10
# !
# address-family ipv4 unicast vrf blue
# adjacency stagger 50 50
# area 25 nssa default-information-originate metric 25 nssa-only
# exit-address-family
# router ospfv3 200
# max-metric router-lsa on-startup 200
# area 10 nssa default-information-originate metric 10
# !
# address-family ipv4 unicast
# adjacency stagger 50 50
# area 200 nssa default-information-originate metric 200 nssa-only
# exit-address-family
# Using Gathered
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospfv3
# router ospfv3 1
# max-metric router-lsa on-startup 110
# area 10 nssa default-information-originate metric 10
# !
# address-family ipv4 unicast vrf blue
# adjacency stagger 50 50
# area 25 nssa default-information-originate metric 25 nssa-only
# exit-address-family
# router ospfv3 200
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# !
# address-family ipv4 unicast
# adjacency stagger 200 200
# exit-address-family
- name: Gather OSPFV3 provided configurations
cisco.ios.ios_ospfv3:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": {
# "processes": [
# {
# "address_family": [
# {
# "adjacency": {
# "max_adjacency": 50,
# "min_adjacency": 50
# },
# "afi": "ipv4",
# "areas": [
# {
# "area_id": "25",
# "nssa": {
# "default_information_originate": {
# "metric": 25,
# "nssa_only": true
# }
# }
# }
# ],
# "unicast": true,
# "vrf": "blue"
# }
# ],
# "areas": [
# {
# "area_id": "10",
# "nssa": {
# "default_information_originate": {
# "metric": 10
# }
# }
# }
# ],
# "max_metric": {
# "on_startup": {
# "time": 110
# },
# "router_lsa": true
# },
# "process_id": 1
# },
# {
# "address_family": [
# {
# "adjacency": {
# "max_adjacency": 200,
# "min_adjacency": 200
# },
# "afi": "ipv4",
# "unicast": true
# }
# ],
# "auto_cost": {
# "reference_bandwidth": 4
# },
# "max_metric": {
# "on_startup": {
# "time": 100
# },
# "router_lsa": true
# },
# "process_id": 200
# }
# ]
# }
# After state:
# ------------
#
# router-ios#sh running-config | section ^router ospfv3
# router ospfv3 1
# max-metric router-lsa on-startup 110
# area 10 nssa default-information-originate metric 10
# !
# address-family ipv4 unicast vrf blue
# adjacency stagger 50 50
# area 25 nssa default-information-originate metric 25 nssa-only
# exit-address-family
# router ospfv3 200
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# !
# address-family ipv4 unicast
# adjacency stagger 200 200
# exit-address-family
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_ospfv3:
config:
processes:
- process_id: 1
max_metric:
router_lsa: true
on_startup:
time: 110
address_family:
- afi: ipv4
unicast: true
vrf: blue
adjacency:
min_adjacency: 50
max_adjacency: 50
areas:
- area_id: 25
nssa:
default_information_originate:
metric: 25
nssa_only: true
areas:
- area_id: "10"
nssa:
default_information_originate:
metric: 10
timers:
throttle:
lsa:
first_delay: 12
min_delay: 14
max_delay: 16
- process_id: 200
address_family:
- afi: ipv4
unicast: true
adjacency:
min_adjacency: 200
max_adjacency: 200
max_metric:
router_lsa: true
on_startup:
time: 100
auto_cost:
reference_bandwidth: 4
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "router ospfv3 1",
# "max-metric router-lsa on-startup 110",
# "area 10 nssa default-information-originate metric 10",
# "address-family ipv4 unicast vrf blue",
# "adjacency stagger 50 50",
# "area 25 nssa default-information-originate metric 25 nssa-only",
# "exit-address-family",
# "router ospfv3 200",
# "auto-cost reference-bandwidth 4",
# "max-metric router-lsa on-startup 100",
# "address-family ipv4 unicast",
# "adjacency stagger 200 200",
# "exit-address-family"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# router ospfv3 1
# max-metric router-lsa on-startup 110
# area 10 nssa default-information-originate metric 10
# !
# address-family ipv4 unicast vrf blue
# adjacency stagger 50 50
# area 25 nssa default-information-originate metric 25 nssa-only
# exit-address-family
# router ospfv3 200
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# !
# address-family ipv4 unicast
# adjacency stagger 200 200
# exit-address-family
- name: Parse the provided configuration with the existing running configuration
cisco.ios.ios_ospfv3:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": {
# "processes": [
# {
# "address_family": [
# {
# "adjacency": {
# "max_adjacency": 50,
# "min_adjacency": 50
# },
# "afi": "ipv4",
# "areas": [
# {
# "area_id": "25",
# "nssa": {
# "default_information_originate": {
# "metric": 25,
# "nssa_only": true
# }
# }
# }
# ],
# "unicast": true,
# "vrf": "blue"
# }
# ],
# "areas": [
# {
# "area_id": "10",
# "nssa": {
# "default_information_originate": {
# "metric": 10
# }
# }
# }
# ],
# "max_metric": {
# "on_startup": {
# "time": 110
# },
# "router_lsa": true
# },
# "process_id": 1
# }
# ]
# }
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** dictionary | when changed | The resulting configuration model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** dictionary | always | The configuration prior to the model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device. **Sample:** ['router ospfv3 1', 'address-family ipv4 unicast vrf blue', 'adjacency stagger 50 50'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ios.ios_static_route β (deprecated, removed after 2022-06-01) Manage static IP routes on Cisco IOS network devices cisco.ios.ios\_static\_route β (deprecated, removed after 2022-06-01) Manage static IP routes on Cisco IOS network devices
==========================================================================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_static_route`.
New in version 1.0.0: of cisco.ios
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Newer and updated modules released with more functionality.
Alternative
ios\_static\_routes
Synopsis
--------
* This module provides declarative management of static IP routes on Cisco IOS network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **admin\_distance** string | | Admin distance of the static route. |
| **aggregate** list / elements=dictionary | | List of static route definitions. |
| | **admin\_distance** string | | Admin distance of the static route. |
| | **interface** string | | Interface of the static route. |
| | **mask** string | | Network prefix mask of the static route. |
| | **name** string | | Name of the static route
aliases: description |
| | **next\_hop** string | | Next hop IP of the static route. |
| | **prefix** string / required | | Network prefix of the static route. |
| | **state** string | **Choices:*** present
* absent
| State of the static route configuration. |
| | **tag** string | | Set tag of the static route. |
| | **track** string | | Tracked item to depend on for the static route. |
| | **vrf** string | | VRF of the static route. |
| **interface** string | | Interface of the static route. |
| **mask** string | | Network prefix mask of the static route. |
| **name** string | | Name of the static route
aliases: description |
| **next\_hop** string | | Next hop IP of the static route. |
| **prefix** string | | Network prefix of the static route. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **state** string | **Choices:*** **present** β
* absent
| State of the static route configuration. |
| **tag** string | | Set tag of the static route. |
| **track** string | | Tracked item to depend on for the static route. |
| **vrf** string | | VRF of the static route. |
Notes
-----
Note
* Tested against IOS 15.6
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: configure static route
cisco.ios.ios_static_route:
prefix: 192.168.2.0
mask: 255.255.255.0
next_hop: 10.0.0.1
- name: configure black hole in vrf blue depending on tracked item 10
cisco.ios.ios_static_route:
prefix: 192.168.2.0
mask: 255.255.255.0
vrf: blue
interface: null0
track: 10
- name: configure ultimate route with name and tag
cisco.ios.ios_static_route:
prefix: 192.168.2.0
mask: 255.255.255.0
interface: GigabitEthernet1
name: hello world
tag: 100
- name: remove configuration
cisco.ios.ios_static_route:
prefix: 192.168.2.0
mask: 255.255.255.0
next_hop: 10.0.0.1
state: absent
- name: Add static route aggregates
cisco.ios.ios_static_route:
aggregate:
- {prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8}
- {prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8}
- name: Remove static route aggregates
cisco.ios.ios_static_route:
aggregate:
- {prefix: 172.16.32.0, mask: 255.255.255.0, next_hop: 10.0.0.8}
- {prefix: 172.16.33.0, mask: 255.255.255.0, next_hop: 10.0.0.8}
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['ip route 192.168.2.0 255.255.255.0 10.0.0.1'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ricardo Carrillo Cruz (@rcarrillocruz)
ansible cisco.ios.ios_lacp_interfaces β LACP interfaces resource module cisco.ios.ios\_lacp\_interfaces β LACP interfaces resource module
=================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_lacp_interfaces`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of LACP on Cisco IOS network devices lacp\_interfaces.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A dictionary of LACP lacp\_interfaces option |
| | **fast\_switchover** boolean | **Choices:*** no
* yes
| LACP fast switchover supported on this port channel. |
| | **max\_bundle** integer | | LACP maximum number of ports to bundle in this port channel. Refer to vendor documentation for valid port values. |
| | **name** string / required | | Name of the Interface for configuring LACP. |
| | **port\_priority** integer | | LACP priority on this interface. Refer to vendor documentation for valid port values. |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **show running-config | section ^interface**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* rendered
* gathered
* parsed
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL.
Examples
--------
```
# Using merged
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# interface GigabitEthernet0/2
# shutdown
# interface GigabitEthernet0/3
# shutdown
- name: Merge provided configuration with device configuration
cisco.ios.ios_lacp_interfaces:
config:
- name: GigabitEthernet0/1
port_priority: 10
- name: GigabitEthernet0/2
port_priority: 20
- name: GigabitEthernet0/3
port_priority: 30
- name: Port-channel10
fast_switchover: true
max_bundle: 5
state: merged
# After state:
# ------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# lacp fast-switchover
# lacp max-bundle 5
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# lacp port-priority 10
# interface GigabitEthernet0/2
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/3
# shutdown
# lacp port-priority 30
# Using overridden
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# lacp fast-switchover
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# lacp port-priority 10
# interface GigabitEthernet0/2
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/3
# shutdown
# lacp port-priority 30
- name: Override device configuration of all lacp_interfaces with provided configuration
cisco.ios.ios_lacp_interfaces:
config:
- name: GigabitEthernet0/1
port_priority: 20
- name: Port-channel10
max_bundle: 2
state: overridden
# After state:
# ------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# lacp max-bundle 2
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/2
# shutdown
# interface GigabitEthernet0/3
# shutdown
# Using replaced
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# lacp max-bundle 5
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# lacp port-priority 10
# interface GigabitEthernet0/2
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/3
# shutdown
# lacp port-priority 30
- name: Replaces device configuration of listed lacp_interfaces with provided configuration
cisco.ios.ios_lacp_interfaces:
config:
- name: GigabitEthernet0/3
port_priority: 40
- name: Port-channel10
fast_switchover: true
max_bundle: 2
state: replaced
# After state:
# ------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# lacp fast-switchover
# lacp max-bundle 2
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# lacp port-priority 10
# interface GigabitEthernet0/2
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/3
# shutdown
# lacp port-priority 40
# Using Deleted
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# flowcontrol receive on
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# lacp port-priority 10
# interface GigabitEthernet0/2
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/3
# shutdown
# lacp port-priority 30
- name: "Delete LACP attributes of given interfaces (Note: This won't delete the interface itself)"
cisco.ios.ios_lacp_interfaces:
config:
- name: GigabitEthernet0/1
state: deleted
# After state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# interface GigabitEthernet0/2
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/3
# shutdown
# lacp port-priority 30
# Using Deleted without any config passed
# "(NOTE: This will delete all of configured LLDP module attributes)"
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# lacp fast-switchover
# interface Port-channel20
# lacp max-bundle 2
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# lacp port-priority 10
# interface GigabitEthernet0/2
# shutdown
# lacp port-priority 20
# interface GigabitEthernet0/3
# shutdown
# lacp port-priority 30
- name: "Delete LACP attributes for all configured interfaces (Note: This won't delete the interface itself)"
cisco.ios.ios_lacp_interfaces:
state: deleted
# After state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# interface GigabitEthernet0/2
# shutdown
# interface GigabitEthernet0/3
# shutdown
# Using Gathered
# Before state:
# -------------
#
# vios#sh running-config | section ^interface
# interface Port-channel10
# lacp fast-switchover
# lacp max-bundle 2
# interface Port-channel40
# lacp max-bundle 5
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# lacp port-priority 30
# interface GigabitEthernet0/2
# lacp port-priority 20
- name: Gather listed LACP interfaces with provided configurations
cisco.ios.ios_lacp_interfaces:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "fast_switchover": true,
# "max_bundle": 2,
# "name": "Port-channel10"
# },
# {
# "max_bundle": 5,
# "name": "Port-channel40"
# },
# {
# "name": "GigabitEthernet0/0"
# },
# {
# "name": "GigabitEthernet0/1",
# "port_priority": 30
# },
# {
# "name": "GigabitEthernet0/2",
# "port_priority": 20
# }
# ]
# After state:
# ------------
#
# vios#sh running-config | section ^interface
# interface Port-channel10
# lacp fast-switchover
# lacp max-bundle 2
# interface Port-channel40
# lacp max-bundle 5
# interface GigabitEthernet0/0
# interface GigabitEthernet0/1
# lacp port-priority 30
# interface GigabitEthernet0/2
# lacp port-priority 20
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_lacp_interfaces:
config:
- name: GigabitEthernet0/1
port_priority: 10
- name: GigabitEthernet0/2
port_priority: 20
- name: Port-channel10
fast_switchover: true
max_bundle: 2
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "interface GigabitEthernet0/1",
# "lacp port-priority 10",
# "interface GigabitEthernet0/2",
# "lacp port-priority 20",
# "interface Port-channel10",
# "lacp max-bundle 2",
# "lacp fast-switchover"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# interface GigabitEthernet0/1
# lacp port-priority 10
# interface GigabitEthernet0/2
# lacp port-priority 20
# interface Port-channel10
# lacp max-bundle 2 fast-switchover
- name: Parse the commands for provided configuration
cisco.ios.ios_lacp_interfaces:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "name": "GigabitEthernet0/1",
# "port_priority": 10
# },
# {
# "name": "GigabitEthernet0/2",
# "port_priority": 20
# },
# {
# "fast_switchover": true,
# "max_bundle": 2,
# "name": "Port-channel10"
# }
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device. **Sample:** ['interface GigabitEthernet 0/1', 'lacp port-priority 30'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ios.ios_interface β (deprecated, removed after 2022-06-01) Manage Interface on Cisco IOS network devices cisco.ios.ios\_interface β (deprecated, removed after 2022-06-01) Manage Interface on Cisco IOS network devices
===============================================================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_interface`.
New in version 1.0.0: of cisco.ios
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Newer and updated modules released with more functionality in Ansible 2.9
Alternative
ios\_interfaces
Synopsis
--------
* This module provides declarative management of Interfaces on Cisco IOS network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** list / elements=dictionary | | List of Interfaces definitions. |
| | **delay** integer | | Time in seconds to wait before checking for the operational state on remote device. This wait is applicable for operational state argument which are *state* with values `up`/`down`, *tx\_rate* and *rx\_rate*. |
| | **description** string | | Description of Interface. |
| | **duplex** string | **Choices:*** full
* half
* auto
| Interface link status |
| | **enabled** boolean | **Choices:*** no
* yes
| Interface link status. |
| | **mtu** string | | Maximum size of transmit packet. |
| | **name** string / required | | Name of the Interface. |
| | **neighbors** list / elements=dictionary | | Check the operational state of given interface `name` for CDP/LLDP neighbor. The following suboptions are available. |
| | | **host** string | | CDP/LLDP neighbor host for given interface `name`. |
| | | **port** string | | CDP/LLDP neighbor port to which given interface `name` is connected. |
| | **rx\_rate** string | | Receiver rate in bits per second (bps). This is state check parameter only. Supports conditionals, see [https://docs.ansible.com/ansible/latest/network/user\_guide/network\_working\_with\_command\_output.html#conditionals-in-networking-modules](../../../network/user_guide/network_working_with_command_output#conditionals-in-networking-modules)
|
| | **speed** string | | Interface link speed. |
| | **state** string | **Choices:*** present
* absent
* up
* down
| State of the Interface configuration, `up` means present and operationally up and `down` means present and operationally `down`
|
| | **tx\_rate** string | | Transmit rate in bits per second (bps). This is state check parameter only. Supports conditionals, see [https://docs.ansible.com/ansible/latest/network/user\_guide/network\_working\_with\_command\_output.html#conditionals-in-networking-modules](../../../network/user_guide/network_working_with_command_output#conditionals-in-networking-modules)
|
| **delay** integer | **Default:**10 | Time in seconds to wait before checking for the operational state on remote device. This wait is applicable for operational state argument which are *state* with values `up`/`down`, *tx\_rate* and *rx\_rate*. |
| **description** string | | Description of Interface. |
| **duplex** string | **Choices:*** full
* half
* auto
| Interface link status |
| **enabled** boolean | **Choices:*** no
* **yes** β
| Interface link status. |
| **mtu** string | | Maximum size of transmit packet. |
| **name** string | | Name of the Interface. |
| **neighbors** list / elements=dictionary | | Check the operational state of given interface `name` for CDP/LLDP neighbor. The following suboptions are available. |
| | **host** string | | CDP/LLDP neighbor host for given interface `name`. |
| | **port** string | | CDP/LLDP neighbor port to which given interface `name` is connected. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **rx\_rate** string | | Receiver rate in bits per second (bps). This is state check parameter only. Supports conditionals, see [https://docs.ansible.com/ansible/latest/network/user\_guide/network\_working\_with\_command\_output.html#conditionals-in-networking-modules](../../../network/user_guide/network_working_with_command_output#conditionals-in-networking-modules)
|
| **speed** string | | Interface link speed. |
| **state** string | **Choices:*** **present** β
* absent
* up
* down
| State of the Interface configuration, `up` means present and operationally up and `down` means present and operationally `down`
|
| **tx\_rate** string | | Transmit rate in bits per second (bps). This is state check parameter only. Supports conditionals, see [https://docs.ansible.com/ansible/latest/network/user\_guide/network\_working\_with\_command\_output.html#conditionals-in-networking-modules](../../../network/user_guide/network_working_with_command_output#conditionals-in-networking-modules)
|
Notes
-----
Note
* Tested against IOS 15.6
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: configure interface
cisco.ios.ios_interface:
name: GigabitEthernet0/2
description: test-interface
speed: 100
duplex: half
mtu: 512
- name: remove interface
cisco.ios.ios_interface:
name: Loopback9
state: absent
- name: make interface up
cisco.ios.ios_interface:
name: GigabitEthernet0/2
enabled: true
- name: make interface down
cisco.ios.ios_interface:
name: GigabitEthernet0/2
enabled: false
- name: Check intent arguments
cisco.ios.ios_interface:
name: GigabitEthernet0/2
state: up
tx_rate: ge(0)
rx_rate: le(0)
- name: Check neighbors intent arguments
cisco.ios.ios_interface:
name: Gi0/0
neighbors:
- port: eth0
host: netdev
- name: Config + intent
cisco.ios.ios_interface:
name: GigabitEthernet0/2
enabled: false
state: down
- name: Add interface using aggregate
cisco.ios.ios_interface:
aggregate:
- {name: GigabitEthernet0/1, mtu: 256, description: test-interface-1}
- {name: GigabitEthernet0/2, mtu: 516, description: test-interface-2}
duplex: full
speed: 100
state: present
- name: Delete interface using aggregate
cisco.ios.ios_interface:
aggregate:
- name: Loopback9
- name: Loopback10
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device. **Sample:** ['interface GigabitEthernet0/2', 'description test-interface', 'duplex half', 'mtu 512'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ganesh Nalawade (@ganeshrn)
ansible cisco.ios.ios_user β Manage the aggregate of local users on Cisco IOS device cisco.ios.ios\_user β Manage the aggregate of local users on Cisco IOS device
=============================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_user`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of the local usernames configured on network devices. It allows playbooks to manage either individual usernames or the aggregate of usernames in the current running config. It also supports purging usernames from the configuration that are not explicitly defined.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** list / elements=dictionary | | The set of username objects to be configured on the remote Cisco IOS device. The list entries can either be the username or a hash of username and properties. This argument is mutually exclusive with the `name` argument.
aliases: users, collection |
| | **configured\_password** string | | The password to be configured on the Cisco IOS device. The password needs to be provided in clear and it will be encrypted on the device. Please note that this option is not same as `provider password`. |
| | **hashed\_password** dictionary | | This option allows configuring hashed passwords on Cisco IOS devices. |
| | | **type** integer / required | | Specifies the type of hash (e.g., 5 for MD5, 8 for PBKDF2, etc.) For this to work, the device needs to support the desired hash type |
| | | **value** string / required | | The actual hashed password to be configured on the device |
| | **name** string / required | | The username to be configured on the Cisco IOS device. This argument accepts a string value and is mutually exclusive with the `aggregate` argument. Please note that this option is not same as `provider username`. |
| | **nopassword** boolean | **Choices:*** no
* yes
| Defines the username without assigning a password. This will allow the user to login to the system without being authenticated by a password. |
| | **password\_type** string | **Choices:*** secret
* password
| This argument determines whether a 'password' or 'secret' will be configured. |
| | **privilege** integer | | The `privilege` argument configures the privilege level of the user when logged into the system. This argument accepts integer values in the range of 1 to 15. |
| | **sshkey** list / elements=string | | Specifies one or more SSH public key(s) to configure for the given username. This argument accepts a valid SSH key value. |
| | **state** string | **Choices:*** present
* absent
| Configures the state of the username definition as it relates to the device operational configuration. When set to *present*, the username(s) should be configured in the device active configuration and when set to *absent* the username(s) should not be in the device active configuration |
| | **update\_password** string | **Choices:*** on\_create
* always
| Since passwords are encrypted in the device running config, this argument will instruct the module when to change the password. When set to `always`, the password will always be updated in the device and when set to `on_create` the password will be updated only if the username is created. |
| | **view** string | | Configures the view for the username in the device running configuration. The argument accepts a string value defining the view name. This argument does not check if the view has been configured on the device.
aliases: role |
| **configured\_password** string | | The password to be configured on the Cisco IOS device. The password needs to be provided in clear and it will be encrypted on the device. Please note that this option is not same as `provider password`. |
| **hashed\_password** dictionary | | This option allows configuring hashed passwords on Cisco IOS devices. |
| | **type** integer / required | | Specifies the type of hash (e.g., 5 for MD5, 8 for PBKDF2, etc.) For this to work, the device needs to support the desired hash type |
| | **value** string / required | | The actual hashed password to be configured on the device |
| **name** string | | The username to be configured on the Cisco IOS device. This argument accepts a string value and is mutually exclusive with the `aggregate` argument. Please note that this option is not same as `provider username`. |
| **nopassword** boolean | **Choices:*** no
* yes
| Defines the username without assigning a password. This will allow the user to login to the system without being authenticated by a password. |
| **password\_type** string | **Choices:*** **secret** β
* password
| This argument determines whether a 'password' or 'secret' will be configured. |
| **privilege** integer | | The `privilege` argument configures the privilege level of the user when logged into the system. This argument accepts integer values in the range of 1 to 15. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **purge** boolean | **Choices:*** **no** β
* yes
| Instructs the module to consider the resource definition absolute. It will remove any previously configured usernames on the device with the exception of the `admin` user (the current defined set of users). |
| **sshkey** list / elements=string | | Specifies one or more SSH public key(s) to configure for the given username. This argument accepts a valid SSH key value. |
| **state** string | **Choices:*** **present** β
* absent
| Configures the state of the username definition as it relates to the device operational configuration. When set to *present*, the username(s) should be configured in the device active configuration and when set to *absent* the username(s) should not be in the device active configuration |
| **update\_password** string | **Choices:*** on\_create
* **always** β
| Since passwords are encrypted in the device running config, this argument will instruct the module when to change the password. When set to `always`, the password will always be updated in the device and when set to `on_create` the password will be updated only if the username is created. |
| **view** string | | Configures the view for the username in the device running configuration. The argument accepts a string value defining the view name. This argument does not check if the view has been configured on the device.
aliases: role |
Notes
-----
Note
* Tested against IOS 15.6
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: create a new user
cisco.ios.ios_user:
name: ansible
nopassword: true
sshkey: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
state: present
- name: create a new user with multiple keys
cisco.ios.ios_user:
name: ansible
sshkey:
- "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
- "{{ lookup('file', '~/path/to/public_key') }}"
state: present
- name: remove all users except admin
cisco.ios.ios_user:
purge: yes
- name: remove all users except admin and these listed users
cisco.ios.ios_user:
aggregate:
- name: testuser1
- name: testuser2
- name: testuser3
purge: yes
- name: set multiple users to privilege level 15
cisco.ios.ios_user:
aggregate:
- name: netop
- name: netend
privilege: 15
state: present
- name: set user view/role
cisco.ios.ios_user:
name: netop
view: network-operator
state: present
- name: Change Password for User netop
cisco.ios.ios_user:
name: netop
configured_password: '{{ new_password }}'
update_password: always
state: present
- name: Aggregate of users
cisco.ios.ios_user:
aggregate:
- name: ansibletest2
- name: ansibletest3
view: network-admin
- name: Add a user specifying password type
cisco.ios.ios_user:
name: ansibletest4
configured_password: '{{ new_password }}'
password_type: password
- name: Add a user with MD5 hashed password
cisco.ios.ios_user:
name: ansibletest5
hashed_password:
type: 5
value: $3$8JcDilcYgFZi.yz4ApaqkHG2.8/
- name: Delete users with aggregate
cisco.ios.ios_user:
aggregate:
- name: ansibletest1
- name: ansibletest2
- name: ansibletest3
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['username ansible secret password', 'username admin secret admin'] |
### Authors
* Trishna Guha (@trishnaguha)
| programming_docs |
ansible cisco.ios.ios_acls β ACLs resource module cisco.ios.ios\_acls β ACLs resource module
==========================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_acls`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module configures and manages the named or numbered ACLs on IOS platforms.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A dictionary of ACL options. |
| | **acls** list / elements=dictionary | | A list of Access Control Lists (ACL). |
| | | **aces** list / elements=dictionary | | The entries within the ACL. |
| | | | **destination** dictionary | | Specify the packet destination. |
| | | | | **address** string | | Host address to match, or any single host address. |
| | | | | **any** boolean | **Choices:*** no
* yes
| Match any source address. |
| | | | | **host** string | | A single destination host |
| | | | | **object\_group** string | | Destination network object group |
| | | | | **port\_protocol** dictionary | | Specify the destination port along with protocol. Note, Valid with TCP/UDP protocol\_options |
| | | | | | **eq** string | | Match only packets on a given port number. |
| | | | | | **gt** string | | Match only packets with a greater port number. |
| | | | | | **lt** string | | Match only packets with a lower port number. |
| | | | | | **neq** string | | Match only packets not on a given port number. |
| | | | | | **range** dictionary | | Port group. |
| | | | | | | **end** integer | | Specify the end of the port range. |
| | | | | | | **start** integer | | Specify the start of the port range. |
| | | | | **wildcard\_bits** string | | Destination wildcard bits, valid with IPV4 address. |
| | | | **dscp** string | | Match packets with given dscp value. |
| | | | **evaluate** string | | Evaluate an access list |
| | | | **fragments** string | | Check non-initial fragments. |
| | | | **grant** string | **Choices:*** permit
* deny
| Specify the action. |
| | | | **log** dictionary | | Log matches against this entry. |
| | | | | **set** boolean | **Choices:*** no
* yes
| Enable Log matches against this entry |
| | | | | **user\_cookie** string | | User defined cookie (max of 64 char) |
| | | | **log\_input** dictionary | | Log matches against this entry, including input interface. |
| | | | | **set** boolean | **Choices:*** no
* yes
| Enable Log matches against this entry, including input interface. |
| | | | | **user\_cookie** string | | User defined cookie (max of 64 char) |
| | | | **option** dictionary | | Match packets with given IP Options value. Valid only for named acls. |
| | | | | **add\_ext** boolean | **Choices:*** no
* yes
| Match packets with Address Extension Option (147). |
| | | | | **any\_options** boolean | **Choices:*** no
* yes
| Match packets with ANY Option. |
| | | | | **com\_security** boolean | **Choices:*** no
* yes
| Match packets with Commercial Security Option (134). |
| | | | | **dps** boolean | **Choices:*** no
* yes
| Match packets with Dynamic Packet State Option (151). |
| | | | | **encode** boolean | **Choices:*** no
* yes
| Match packets with Encode Option (15). |
| | | | | **eool** boolean | **Choices:*** no
* yes
| Match packets with End of Options (0). |
| | | | | **ext\_ip** boolean | **Choices:*** no
* yes
| Match packets with Extended IP Option (145). |
| | | | | **ext\_security** boolean | **Choices:*** no
* yes
| Match packets with Extended Security Option (133). |
| | | | | **finn** boolean | **Choices:*** no
* yes
| Match packets with Experimental Flow Control Option (205). |
| | | | | **imitd** boolean | **Choices:*** no
* yes
| Match packets with IMI Traffic Desriptor Option (144). |
| | | | | **lsr** boolean | **Choices:*** no
* yes
| Match packets with Loose Source Route Option (131). |
| | | | | **mtup** boolean | **Choices:*** no
* yes
| Match packets with MTU Probe Option (11). |
| | | | | **mtur** boolean | **Choices:*** no
* yes
| Match packets with MTU Reply Option (12). |
| | | | | **no\_op** boolean | **Choices:*** no
* yes
| Match packets with No Operation Option (1). |
| | | | | **nsapa** boolean | **Choices:*** no
* yes
| Match packets with NSAP Addresses Option (150). |
| | | | | **record\_route** boolean | **Choices:*** no
* yes
| Match packets with Record Route Option (7). |
| | | | | **router\_alert** boolean | **Choices:*** no
* yes
| Match packets with Router Alert Option (148). |
| | | | | **sdb** boolean | **Choices:*** no
* yes
| Match packets with Selective Directed Broadcast Option (149). |
| | | | | **security** boolean | **Choices:*** no
* yes
| Match packets with Basic Security Option (130). |
| | | | | **ssr** boolean | **Choices:*** no
* yes
| Match packets with Strict Source Routing Option (137). |
| | | | | **stream\_id** boolean | **Choices:*** no
* yes
| Match packets with Stream ID Option (136). |
| | | | | **timestamp** boolean | **Choices:*** no
* yes
| Match packets with Time Stamp Option (68). |
| | | | | **traceroute** boolean | **Choices:*** no
* yes
| Match packets with Trace Route Option (82). |
| | | | | **ump** boolean | **Choices:*** no
* yes
| Match packets with Upstream Multicast Packet Option (152). |
| | | | | **visa** boolean | **Choices:*** no
* yes
| Match packets with Experimental Access Control Option (142). |
| | | | | **zsu** boolean | **Choices:*** no
* yes
| Match packets with Experimental Measurement Option (10). |
| | | | **precedence** integer | | Match packets with given precedence value. |
| | | | **protocol** string | | Specify the protocol to match. Refer to vendor documentation for valid values. |
| | | | **protocol\_options** dictionary | | protocol type. |
| | | | | **ahp** boolean | **Choices:*** no
* yes
| Authentication Header Protocol. |
| | | | | **eigrp** boolean | **Choices:*** no
* yes
| Cisco's EIGRP routing protocol. |
| | | | | **esp** boolean | **Choices:*** no
* yes
| Encapsulation Security Payload. |
| | | | | **gre** boolean | **Choices:*** no
* yes
| Cisco's GRE tunneling. |
| | | | | **hbh** boolean | **Choices:*** no
* yes
| Hop by Hop options header. Valid for IPV6 |
| | | | | **icmp** dictionary | | Internet Control Message Protocol. |
| | | | | | **administratively\_prohibited** boolean | **Choices:*** no
* yes
| Administratively prohibited |
| | | | | | **alternate\_address** boolean | **Choices:*** no
* yes
| Alternate address |
| | | | | | **conversion\_error** boolean | **Choices:*** no
* yes
| Datagram conversion |
| | | | | | **dod\_host\_prohibited** boolean | **Choices:*** no
* yes
| Host prohibited |
| | | | | | **dod\_net\_prohibited** boolean | **Choices:*** no
* yes
| Net prohibited |
| | | | | | **echo** boolean | **Choices:*** no
* yes
| Echo (ping) |
| | | | | | **echo\_reply** boolean | **Choices:*** no
* yes
| Echo reply |
| | | | | | **general\_parameter\_problem** boolean | **Choices:*** no
* yes
| Parameter problem |
| | | | | | **host\_isolated** boolean | **Choices:*** no
* yes
| Host isolated |
| | | | | | **host\_precedence\_unreachable** boolean | **Choices:*** no
* yes
| Host unreachable for precedence |
| | | | | | **host\_redirect** boolean | **Choices:*** no
* yes
| Host redirect |
| | | | | | **host\_tos\_redirect** boolean | **Choices:*** no
* yes
| Host redirect for TOS |
| | | | | | **host\_tos\_unreachable** boolean | **Choices:*** no
* yes
| Host unreachable for TOS |
| | | | | | **host\_unknown** boolean | **Choices:*** no
* yes
| Host unknown |
| | | | | | **host\_unreachable** boolean | **Choices:*** no
* yes
| Host unreachable |
| | | | | | **information\_reply** boolean | **Choices:*** no
* yes
| Information replies |
| | | | | | **information\_request** boolean | **Choices:*** no
* yes
| Information requests |
| | | | | | **mask\_reply** boolean | **Choices:*** no
* yes
| Mask replies |
| | | | | | **mask\_request** boolean | **Choices:*** no
* yes
| mask\_request |
| | | | | | **mobile\_redirect** boolean | **Choices:*** no
* yes
| Mobile host redirect |
| | | | | | **net\_redirect** boolean | **Choices:*** no
* yes
| Network redirect |
| | | | | | **net\_tos\_redirect** boolean | **Choices:*** no
* yes
| Net redirect for TOS |
| | | | | | **net\_tos\_unreachable** boolean | **Choices:*** no
* yes
| Network unreachable for TOS |
| | | | | | **net\_unreachable** boolean | **Choices:*** no
* yes
| Net unreachable |
| | | | | | **network\_unknown** boolean | **Choices:*** no
* yes
| Network unknown |
| | | | | | **no\_room\_for\_option** boolean | **Choices:*** no
* yes
| Parameter required but no room |
| | | | | | **option\_missing** boolean | **Choices:*** no
* yes
| Parameter required but not present |
| | | | | | **packet\_too\_big** boolean | **Choices:*** no
* yes
| Fragmentation needed and DF set |
| | | | | | **parameter\_problem** boolean | **Choices:*** no
* yes
| All parameter problems |
| | | | | | **port\_unreachable** boolean | **Choices:*** no
* yes
| Port unreachable |
| | | | | | **precedence\_unreachable** boolean | **Choices:*** no
* yes
| Precedence cutoff |
| | | | | | **protocol\_unreachable** boolean | **Choices:*** no
* yes
| Protocol unreachable |
| | | | | | **reassembly\_timeout** boolean | **Choices:*** no
* yes
| Reassembly timeout |
| | | | | | **redirect** boolean | **Choices:*** no
* yes
| All redirects |
| | | | | | **router\_advertisement** boolean | **Choices:*** no
* yes
| Router discovery advertisements |
| | | | | | **router\_solicitation** boolean | **Choices:*** no
* yes
| Router discovery solicitations |
| | | | | | **source\_quench** boolean | **Choices:*** no
* yes
| Source quenches |
| | | | | | **source\_route\_failed** boolean | **Choices:*** no
* yes
| Source route failed |
| | | | | | **time\_exceeded** boolean | **Choices:*** no
* yes
| All time exceededs |
| | | | | | **timestamp\_reply** boolean | **Choices:*** no
* yes
| Timestamp replies |
| | | | | | **timestamp\_request** boolean | **Choices:*** no
* yes
| Timestamp requests |
| | | | | | **traceroute** boolean | **Choices:*** no
* yes
| Traceroute |
| | | | | | **ttl\_exceeded** boolean | **Choices:*** no
* yes
| TTL exceeded |
| | | | | | **unreachable** boolean | **Choices:*** no
* yes
| All unreachables |
| | | | | **igmp** dictionary | | Internet Gateway Message Protocol. |
| | | | | | **dvmrp** boolean | **Choices:*** no
* yes
| Distance Vector Multicast Routing Protocol(2) |
| | | | | | **host\_query** boolean | **Choices:*** no
* yes
| IGMP Membership Query(0) |
| | | | | | **mtrace\_resp** boolean | **Choices:*** no
* yes
| Multicast Traceroute Response(7) |
| | | | | | **mtrace\_route** boolean | **Choices:*** no
* yes
| Multicast Traceroute(8) |
| | | | | | **pim** boolean | **Choices:*** no
* yes
| Protocol Independent Multicast(3) |
| | | | | | **trace** boolean | **Choices:*** no
* yes
| Multicast trace(4) |
| | | | | | **v1host\_report** boolean | **Choices:*** no
* yes
| IGMPv1 Membership Report(1) |
| | | | | | **v2host\_report** boolean | **Choices:*** no
* yes
| IGMPv2 Membership Report(5) |
| | | | | | **v2leave\_group** boolean | **Choices:*** no
* yes
| IGMPv2 Leave Group(6) |
| | | | | | **v3host\_report** boolean | **Choices:*** no
* yes
| IGMPv3 Membership Report(9) |
| | | | | **ip** boolean | **Choices:*** no
* yes
| Any Internet Protocol. |
| | | | | **ipinip** boolean | **Choices:*** no
* yes
| IP in IP tunneling. |
| | | | | **ipv6** boolean | **Choices:*** no
* yes
| Any IPv6. |
| | | | | **nos** boolean | **Choices:*** no
* yes
| KA9Q NOS compatible IP over IP tunneling. |
| | | | | **ospf** boolean | **Choices:*** no
* yes
| OSPF routing protocol. |
| | | | | **pcp** boolean | **Choices:*** no
* yes
| Payload Compression Protocol. |
| | | | | **pim** boolean | **Choices:*** no
* yes
| Protocol Independent Multicast. |
| | | | | **protocol\_number** integer | | An IP protocol number |
| | | | | **sctp** boolean | **Choices:*** no
* yes
| Stream Control Transmission Protocol. |
| | | | | **tcp** dictionary | | Match TCP packet flags |
| | | | | | **ack** boolean | **Choices:*** no
* yes
| Match on the ACK bit |
| | | | | | **established** boolean | **Choices:*** no
* yes
| Match established connections |
| | | | | | **fin** boolean | **Choices:*** no
* yes
| Match on the FIN bit |
| | | | | | **psh** boolean | **Choices:*** no
* yes
| Match on the PSH bit |
| | | | | | **rst** boolean | **Choices:*** no
* yes
| Match on the RST bit |
| | | | | | **syn** boolean | **Choices:*** no
* yes
| Match on the SYN bit |
| | | | | | **urg** boolean | **Choices:*** no
* yes
| Match on the URG bit |
| | | | | **udp** boolean | **Choices:*** no
* yes
| User Datagram Protocol. |
| | | | **sequence** integer | | Sequence Number for the Access Control Entry(ACE). Refer to vendor documentation for valid values. |
| | | | **source** dictionary | | Specify the packet source. |
| | | | | **address** string | | Source network address. |
| | | | | **any** boolean | **Choices:*** no
* yes
| Match any source address. |
| | | | | **host** string | | A single source host |
| | | | | **object\_group** string | | Source network object group |
| | | | | **port\_protocol** dictionary | | Specify the source port along with protocol. Note, Valid with TCP/UDP protocol\_options |
| | | | | | **eq** string | | Match only packets on a given port number. |
| | | | | | **gt** string | | Match only packets with a greater port number. |
| | | | | | **lt** string | | Match only packets with a lower port number. |
| | | | | | **neq** string | | Match only packets not on a given port number. |
| | | | | | **range** dictionary | | Port group. |
| | | | | | | **end** integer | | Specify the end of the port range. |
| | | | | | | **start** integer | | Specify the start of the port range. |
| | | | | **wildcard\_bits** string | | Source wildcard bits, valid with IPV4 address. |
| | | | **time\_range** string | | Specify a time-range. |
| | | | **tos** dictionary | | Match packets with given TOS value. Note, DSCP and TOS are mutually exclusive |
| | | | | **max\_reliability** boolean | **Choices:*** no
* yes
| Match packets with max reliable TOS (2). |
| | | | | **max\_throughput** boolean | **Choices:*** no
* yes
| Match packets with max throughput TOS (4). |
| | | | | **min\_delay** boolean | **Choices:*** no
* yes
| Match packets with min delay TOS (8). |
| | | | | **min\_monetary\_cost** boolean | **Choices:*** no
* yes
| Match packets with min monetary cost TOS (1). |
| | | | | **normal** boolean | **Choices:*** no
* yes
| Match packets with normal TOS (0). |
| | | | | **service\_value** integer | | Type of service value |
| | | | **ttl** dictionary | | Match packets with given TTL value. |
| | | | | **eq** integer | | Match only packets on a given TTL number. |
| | | | | **gt** integer | | Match only packets with a greater TTL number. |
| | | | | **lt** integer | | Match only packets with a lower TTL number. |
| | | | | **neq** integer | | Match only packets not on a given TTL number. |
| | | | | **range** dictionary | | Match only packets in the range of TTLs. |
| | | | | | **end** integer | | Specify the end of the port range. |
| | | | | | **start** integer | | Specify the start of the port range. |
| | | **acl\_type** string | **Choices:*** extended
* standard
| ACL type Note, it's mandatory and required for Named ACL, but for Numbered ACL it's not mandatory. |
| | | **name** string / required | | The name or the number of the ACL. |
| | **afi** string / required | **Choices:*** ipv4
* ipv6
| The Address Family Indicator (AFI) for the Access Control Lists (ACL). |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **sh access-list**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* gathered
* rendered
* parsed
| The state the configuration should be left in The states *merged* is the default state which merges the want and have config, but for ACL module as the IOS platform doesn't allow update of ACE over an pre-existing ACE sequence in ACL, same way ACLs resource module will error out for respective scenario and only addition of new ACE over new sequence will be allowed with merge state. The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL
Examples
--------
```
# Using merged
# Before state:
# -------------
#
# vios#sh access-lists
# Extended IP access list 100
# 10 deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 echo dscp ef ttl eq 10
- name: Merge provided configuration with device configuration
cisco.ios.ios_acls:
config:
- afi: ipv4
acls:
- name: 100
aces:
- sequence: 10
protocol_options:
icmp:
traceroute: true
state: merged
# After state:
# ------------
#
# Play Execution fails, with error:
# Cannot update existing sequence 10 of ACLs 100 with state merged.
# Please use state replaced or overridden.
# Before state:
# -------------
#
# vios#sh access-lists
# Extended IP access list 110
# 10 deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 echo dscp ef ttl eq 10
- name: Merge provided configuration with device configuration
cisco.ios.ios_acls:
config:
- afi: ipv4
acls:
- name: std_acl
acl_type: standard
aces:
- grant: deny
source:
address: 192.168.1.200
- grant: deny
source:
address: 192.168.2.0
wildcard_bits: 0.0.0.255
- name: 110
aces:
- sequence: 10
protocol_options:
icmp:
traceroute: true
- grant: deny
protocol_options:
tcp:
ack: true
source:
host: 198.51.100.0
destination:
host: 198.51.110.0
port_protocol:
eq: telnet
- name: test
acl_type: extended
aces:
- grant: deny
protocol_options:
tcp:
fin: true
source:
address: 192.0.2.0
wildcard_bits: 0.0.0.255
destination:
address: 192.0.3.0
wildcard_bits: 0.0.0.255
port_protocol:
eq: www
option:
traceroute: true
ttl:
eq: 10
- name: 123
aces:
- grant: deny
protocol_options:
tcp:
ack: true
source:
address: 198.51.100.0
wildcard_bits: 0.0.0.255
destination:
address: 198.51.101.0
wildcard_bits: 0.0.0.255
port_protocol:
eq: telnet
tos:
service_value: 12
- grant: deny
protocol_options:
tcp:
ack: true
source:
address: 192.0.3.0
wildcard_bits: 0.0.0.255
destination:
address: 192.0.4.0
wildcard_bits: 0.0.0.255
port_protocol:
eq: www
dscp: ef
ttl:
lt: 20
- afi: ipv6
acls:
- name: R1_TRAFFIC
aces:
- grant: deny
protocol_options:
tcp:
ack: true
source:
any: true
port_protocol:
eq: www
destination:
any: true
port_protocol:
eq: telnet
dscp: af11
state: merged
# Commands fired:
# ---------------
#
# - ip access-list standard std_acl
# - deny 192.168.1.200
# - deny 192.168.2.0 0.0.0.255
# - ip access-list extended 110
# - 10 deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 traceroute dscp ef ttl eq 10
# - deny tcp host 198.51.100.0 host 198.51.110.0 eq telnet ack
# - ip access-list extended test
# - deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www fin option traceroute ttl eq 10
# - ip access-list extended 123
# - deny tcp 198.51.100.0 0.0.0.255 198.51.101.0 0.0.0.255 eq telnet ack tos 12
# - deny tcp 192.0.3.0 0.0.0.255 192.0.4.0 0.0.0.255 eq www ack dscp ef ttl lt 20
# - ipv6 access-list R1_TRAFFIC
# - deny tcp any eq www any eq telnet ack dscp af11
# After state:
# ------------
#
# vios#sh access-lists
# Standard IP access list std_acl
# 10 deny 192.168.1.200
# 20 deny 192.168.2.0, wildcard bits 0.0.0.255
# Extended IP access list 100
# 10 deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 echo dscp ef ttl eq 10
# Extended IP access list 110
# 10 deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 traceroute dscp ef ttl eq 10
# 20 deny tcp host 198.51.100.0 host 198.51.110.0 eq telnet ack
# Extended IP access list 123
# 10 deny tcp 198.51.100.0 0.0.0.255 198.51.101.0 0.0.0.255 eq telnet ack tos 12
# 20 deny tcp 192.0.3.0 0.0.0.255 192.0.4.0 0.0.0.255 eq www ack dscp ef ttl lt 20
# Extended IP access list test
# 10 deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www fin option traceroute ttl eq 10
# IPv6 access list R1_TRAFFIC
# deny tcp any eq www any eq telnet ack dscp af11 sequence 10
# Using replaced
# Before state:
# -------------
#
# vios#sh access-lists
# Standard IP access list std_acl
# 10 deny 192.168.1.200
# 20 deny 192.168.2.0, wildcard bits 0.0.0.255
# Extended IP access list 110
# 10 deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 traceroute dscp ef ttl eq 10
# 20 deny tcp host 198.51.100.0 host 198.51.110.0 eq telnet ack
# Extended IP access list 123
# 10 deny tcp 198.51.100.0 0.0.0.255 198.51.101.0 0.0.0.255 eq telnet ack tos 12
# 20 deny tcp 192.0.3.0 0.0.0.255 192.0.4.0 0.0.0.255 eq www ack dscp ef ttl lt 20
# Extended IP access list test
# 10 deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www fin option traceroute ttl eq 10
# IPv6 access list R1_TRAFFIC
# deny tcp any eq www any eq telnet ack dscp af11 sequence 10
- name: Replaces device configuration of listed acls with provided configuration
cisco.ios.ios_acls:
config:
- afi: ipv4
acls:
- name: 110
aces:
- grant: deny
protocol_options:
tcp:
syn: true
source:
address: 192.0.2.0
wildcard_bits: 0.0.0.255
destination:
address: 192.0.3.0
wildcard_bits: 0.0.0.255
port_protocol:
eq: www
dscp: ef
ttl:
eq: 10
- name: 150
aces:
- grant: deny
sequence: 20
protocol_options:
tcp:
syn: true
source:
address: 198.51.100.0
wildcard_bits: 0.0.0.255
port_protocol:
eq: telnet
destination:
address: 198.51.110.0
wildcard_bits: 0.0.0.255
port_protocol:
eq: telnet
dscp: ef
ttl:
eq: 10
state: replaced
# Commands fired:
# ---------------
#
# - no ip access-list extended 110
# - ip access-list extended 110
# - deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www syn dscp ef ttl eq 10
# - ip access-list extended 150
# - 20 deny tcp 198.51.100.0 0.0.0.255 eq telnet 198.51.110.0 0.0.0.255 eq telnet syn dscp ef ttl eq 10
# After state:
# -------------
#
# vios#sh access-lists
# Standard IP access list std_acl
# 10 deny 192.168.1.200
# 20 deny 192.168.2.0, wildcard bits 0.0.0.255
# Extended IP access list 110
# 10 deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www syn dscp ef ttl eq 10
# Extended IP access list 123
# 10 deny tcp 198.51.100.0 0.0.0.255 198.51.101.0 0.0.0.255 eq telnet ack tos 12
# 20 deny tcp 192.0.3.0 0.0.0.255 192.0.4.0 0.0.0.255 eq www ack dscp ef ttl lt 20
# Extended IP access list 150
# 20 deny tcp 198.51.100.0 0.0.0.255 eq telnet 198.51.110.0 0.0.0.255 eq telnet syn dscp ef ttl eq 10
# Extended IP access list test
# 10 deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www fin option traceroute ttl eq 10
# IPv6 access list R1_TRAFFIC
# deny tcp any eq www any eq telnet ack dscp af11 sequence 10
# Using overridden
# Before state:
# -------------
#
# vios#sh access-lists
# Standard IP access list std_acl
# 10 deny 192.168.1.200
# 20 deny 192.168.2.0, wildcard bits 0.0.0.255
# Extended IP access list 110
# 10 deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 traceroute dscp ef ttl eq 10
# 20 deny tcp host 198.51.100.0 host 198.51.110.0 eq telnet ack
# Extended IP access list 123
# 10 deny tcp 198.51.100.0 0.0.0.255 198.51.101.0 0.0.0.255 eq telnet ack tos 12
# 20 deny tcp 192.0.3.0 0.0.0.255 192.0.4.0 0.0.0.255 eq www ack dscp ef ttl lt 20
# Extended IP access list test
# 10 deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www fin option traceroute ttl eq 10
# IPv6 access list R1_TRAFFIC
# deny tcp any eq www any eq telnet ack dscp af11 sequence 10
- name: Override device configuration of all acls with provided configuration
cisco.ios.ios_acls:
config:
- afi: ipv4
acls:
- name: 110
aces:
- grant: deny
sequence: 20
protocol_options:
tcp:
ack: true
source:
address: 198.51.100.0
wildcard_bits: 0.0.0.255
port_protocol:
eq: telnet
destination:
address: 198.51.110.0
wildcard_bits: 0.0.0.255
port_protocol:
eq: www
dscp: ef
ttl:
eq: 10
- name: 150
aces:
- grant: deny
sequence: 10
protocol_options:
tcp:
syn: true
source:
address: 198.51.100.0
wildcard_bits: 0.0.0.255
port_protocol:
eq: telnet
destination:
address: 198.51.110.0
wildcard_bits: 0.0.0.255
port_protocol:
eq: telnet
dscp: ef
ttl:
eq: 10
state: overridden
# Commands fired:
# ---------------
#
# - no ip access-list standard std_acl
# - no ip access-list extended 110
# - no ip access-list extended 123
# - no ip access-list extended 150
# - no ip access-list extended test
# - no ipv6 access-list R1_TRAFFIC
# - ip access-list extended 150
# - 10 deny tcp 198.51.100.0 0.0.0.255 eq telnet 198.51.110.0 0.0.0.255 eq telnet syn dscp ef ttl eq 10
# - ip access-list extended 110
# - 20 deny tcp 198.51.100.0 0.0.0.255 eq telnet 198.51.110.0 0.0.0.255 eq www ack dscp ef ttl eq 10
# After state:
# -------------
#
# vios#sh access-lists
# Extended IP access list 110
# 20 deny tcp 198.51.100.0 0.0.0.255 eq telnet 198.51.110.0 0.0.0.255 eq www ack dscp ef ttl eq 10
# Extended IP access list 150
# 10 deny tcp 198.51.100.0 0.0.0.255 eq telnet 198.51.110.0 0.0.0.255 eq telnet syn dscp ef ttl eq 10
# Using Deleted
# Before state:
# -------------
#
# vios#sh access-lists
# Standard IP access list std_acl
# 10 deny 192.168.1.200
# 20 deny 192.168.2.0, wildcard bits 0.0.0.255
# Extended IP access list 110
# 10 deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 traceroute dscp ef ttl eq 10
# 20 deny tcp host 198.51.100.0 host 198.51.110.0 eq telnet ack
# Extended IP access list 123
# 10 deny tcp 198.51.100.0 0.0.0.255 198.51.101.0 0.0.0.255 eq telnet ack tos 12
# 20 deny tcp 192.0.3.0 0.0.0.255 192.0.4.0 0.0.0.255 eq www ack dscp ef ttl lt 20
# Extended IP access list test
# 10 deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www fin option traceroute ttl eq 10
# IPv6 access list R1_TRAFFIC
# deny tcp any eq www any eq telnet ack dscp af11 sequence 10
- name: "Delete ACLs (Note: This won't delete the all configured ACLs)"
cisco.ios.ios_acls:
config:
- afi: ipv4
acls:
- name: test
acl_type: extended
- name: 110
- afi: ipv6
acls:
- name: R1_TRAFFIC
state: deleted
# Commands fired:
# ---------------
#
# - no ip access-list extended test
# - no ip access-list extended 110
# - no ipv6 access-list R1_TRAFFIC
# After state:
# -------------
#
# vios#sh access-lists
# Standard IP access list std_acl
# 10 deny 192.168.1.200
# 20 deny 192.168.2.0, wildcard bits 0.0.0.255
# Extended IP access list 123
# 10 deny tcp 198.51.100.0 0.0.0.255 198.51.101.0 0.0.0.255 eq telnet ack tos 12
# 20 deny tcp 192.0.3.0 0.0.0.255 192.0.4.0 0.0.0.255 eq www ack dscp ef ttl lt 20
# Before state:
# -------------
#
# vios#sh access-lists
# Standard IP access list std_acl
# 10 deny 192.168.1.200
# 20 deny 192.168.2.0, wildcard bits 0.0.0.255
# Extended IP access list 110
# 10 deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 traceroute dscp ef ttl eq 10
# 20 deny tcp host 198.51.100.0 host 198.51.110.0 eq telnet ack
# Extended IP access list 123
# 10 deny tcp 198.51.100.0 0.0.0.255 198.51.101.0 0.0.0.255 eq telnet ack tos 12
# 20 deny tcp 192.0.3.0 0.0.0.255 192.0.4.0 0.0.0.255 eq www ack dscp ef ttl lt 20
# Extended IP access list test
# 10 deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www fin option traceroute ttl eq 10
# IPv6 access list R1_TRAFFIC
# deny tcp any eq www any eq telnet ack dscp af11 sequence 10
- name: "Delete ACLs based on AFI (Note: This won't delete the all configured ACLs)"
cisco.ios.ios_acls:
config:
- afi: ipv4
state: deleted
# Commands fired:
# ---------------
#
# - no ip access-list standard std_acl
# - no ip access-list extended test
# - no ip access-list extended 110
# - no ip access-list extended 123
# After state:
# -------------
#
# vios#sh access-lists
# IPv6 access list R1_TRAFFIC
# deny tcp any eq www any eq telnet ack dscp af11 sequence 10
# Using Deleted without any config passed
#"(NOTE: This will delete all of configured ACLs)"
# Before state:
# -------------
#
# vios#sh access-lists
# Standard IP access list std_acl
# 10 deny 192.168.1.200
# 20 deny 192.168.2.0, wildcard bits 0.0.0.255
# Extended IP access list 110
# 10 deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 traceroute dscp ef ttl eq 10
# 20 deny tcp host 198.51.100.0 host 198.51.110.0 eq telnet ack
# Extended IP access list 123
# 10 deny tcp 198.51.100.0 0.0.0.255 198.51.101.0 0.0.0.255 eq telnet ack tos 12
# 20 deny tcp 192.0.3.0 0.0.0.255 192.0.4.0 0.0.0.255 eq www ack dscp ef ttl lt 20
# Extended IP access list test
# 10 deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www fin option traceroute ttl eq 10
# IPv6 access list R1_TRAFFIC
# deny tcp any eq www any eq telnet ack dscp af11 sequence 10
- name: 'Delete ALL of configured ACLs (Note: This WILL delete the all configured
ACLs)'
cisco.ios.ios_acls:
state: deleted
# Commands fired:
# ---------------
#
# - no ip access-list extended test
# - no ip access-list extended 110
# - no ip access-list extended 123
# - no ip access-list extended test
# - no ipv6 access-list R1_TRAFFIC
# After state:
# -------------
#
# vios#sh access-lists
# Using Gathered
# Before state:
# -------------
#
# vios#sh access-lists
# Standard IP access list std_acl
# 10 deny 192.168.1.200
# 20 deny 192.168.2.0, wildcard bits 0.0.0.255
# Extended IP access list 110
# 10 deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 traceroute dscp ef ttl eq 10
# 20 deny tcp host 198.51.100.0 host 198.51.110.0 eq telnet ack
# Extended IP access list 123
# 10 deny tcp 198.51.100.0 0.0.0.255 198.51.101.0 0.0.0.255 eq telnet ack tos 12
# 20 deny tcp 192.0.3.0 0.0.0.255 192.0.4.0 0.0.0.255 eq www ack dscp ef ttl lt 20
# Extended IP access list test
# 10 deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www fin option traceroute ttl eq 10
# IPv6 access list R1_TRAFFIC
# deny tcp any eq www any eq telnet ack dscp af11 sequence 10
- name: Gather listed acls with provided configurations
cisco.ios.ios_acls:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "acls": [
# {
# "aces": [
# {
# "destination": {
# "address": "192.0.3.0",
# "wildcard_bits": "0.0.0.255"
# },
# "dscp": "ef",
# "grant": "deny",
# "protocol_options": {
# "icmp": {
# "echo": true
# }
# },
# "sequence": 10,
# "source": {
# "address": "192.0.2.0",
# "wildcard_bits": "0.0.0.255"
# },
# "ttl": {
# "eq": 10
# }
# }
# ],
# "acl_type": "extended",
# "name": "110"
# },
# {
# "aces": [
# {
# "destination": {
# "address": "198.51.101.0",
# "port_protocol": {
# "eq": "telnet"
# },
# "wildcard_bits": "0.0.0.255"
# },
# "grant": "deny",
# "protocol_options": {
# "tcp": {
# "ack": true
# }
# },
# "sequence": 10,
# "source": {
# "address": "198.51.100.0",
# "wildcard_bits": "0.0.0.255"
# },
# "tos": {
# "service_value": 12
# }
# },
# {
# "destination": {
# "address": "192.0.4.0",
# "port_protocol": {
# "eq": "www"
# },
# "wildcard_bits": "0.0.0.255"
# },
# "dscp": "ef",
# "grant": "deny",
# "protocol_options": {
# "tcp": {
# "ack": true
# }
# },
# "sequence": 20,
# "source": {
# "address": "192.0.3.0",
# "wildcard_bits": "0.0.0.255"
# },
# "ttl": {
# "lt": 20
# }
# }
# ],
# "acl_type": "extended",
# "name": "123"
# },
# {
# "aces": [
# {
# "destination": {
# "address": "192.0.3.0",
# "port_protocol": {
# "eq": "www"
# },
# "wildcard_bits": "0.0.0.255"
# },
# "grant": "deny",
# "option": {
# "traceroute": true
# },
# "protocol_options": {
# "tcp": {
# "fin": true
# }
# },
# "sequence": 10,
# "source": {
# "address": "192.0.2.0",
# "wildcard_bits": "0.0.0.255"
# },
# "ttl": {
# "eq": 10
# }
# }
# ],
# "acl_type": "extended",
# "name": "test_acl"
# }
# ],
# "afi": "ipv4"
# },
# {
# "acls": [
# {
# "aces": [
# {
# "destination": {
# "any": true,
# "port_protocol": {
# "eq": "telnet"
# }
# },
# "dscp": "af11",
# "grant": "deny",
# "protocol_options": {
# "tcp": {
# "ack": true
# }
# },
# "sequence": 10,
# "source": {
# "any": true,
# "port_protocol": {
# "eq": "www"
# }
# }
# }
# ],
# "name": "R1_TRAFFIC"
# }
# ],
# "afi": "ipv6"
# }
# ]
# Using Rendered
- name: Rendered the provided configuration with the existing running configuration
cisco.ios.ios_acls:
config:
- afi: ipv4
acls:
- name: 110
aces:
- grant: deny
sequence: 10
protocol_options:
tcp:
syn: true
source:
address: 192.0.2.0
wildcard_bits: 0.0.0.255
destination:
address: 192.0.3.0
wildcard_bits: 0.0.0.255
port_protocol:
eq: www
dscp: ef
ttl:
eq: 10
- name: 150
aces:
- grant: deny
protocol_options:
tcp:
syn: true
source:
address: 198.51.100.0
wildcard_bits: 0.0.0.255
port_protocol:
eq: telnet
destination:
address: 198.51.110.0
wildcard_bits: 0.0.0.255
port_protocol:
eq: telnet
dscp: ef
ttl:
eq: 10
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "ip access-list extended 110",
# "10 deny tcp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 eq www syn dscp ef ttl eq 10",
# "ip access-list extended 150",
# "deny tcp 198.51.100.0 0.0.0.255 eq telnet 198.51.110.0 0.0.0.255 eq telnet syn dscp ef ttl eq 10"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# IPv6 access-list R1_TRAFFIC
# deny tcp any eq www any eq telnet ack dscp af11
- name: Parse the commands for provided configuration
cisco.ios.ios_acls:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "acls": [
# {
# "aces": [
# {
# "destination": {
# "any": true,
# "port_protocol": {
# "eq": "telnet"
# }
# },
# "dscp": "af11",
# "grant": "deny",
# "protocol_options": {
# "tcp": {
# "ack": true
# }
# },
# "source": {
# "any": true,
# "port_protocol": {
# "eq": "www"
# }
# }
# }
# ],
# "name": "R1_TRAFFIC"
# }
# ],
# "afi": "ipv6"
# }
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device **Sample:** ['ip access-list extended 110', 'deny icmp 192.0.2.0 0.0.0.255 192.0.3.0 0.0.0.255 echo dscp ef ttl eq 10'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ios.ios_lldp_interfaces β LLDP interfaces resource module cisco.ios.ios\_lldp\_interfaces β LLDP interfaces resource module
=================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_lldp_interfaces`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module manages link layer discovery protocol (LLDP) attributes of interfaces on Cisco IOS devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A dictionary of LLDP options |
| | **med\_tlv\_select** dictionary | | Selection of LLDP MED TLVs to send NOTE, if med-tlv-select is configured idempotency won't be maintained as Cisco device doesn't record configured med-tlv-select options. As such, Ansible cannot verify if the respective med-tlv-select options is already configured or not from the device side. If you try to apply med-tlv-select option in every play run, Ansible will show changed as True. |
| | | **inventory\_management** boolean | **Choices:*** no
* yes
| LLDP MED Inventory Management TLV |
| | **name** string / required | | Full name of the interface excluding any logical unit number, i.e. GigabitEthernet0/1. |
| | **receive** boolean | **Choices:*** no
* yes
| Enable LLDP reception on interface. |
| | **tlv\_select** dictionary | | Selection of LLDP type-length-value i.e. TLVs to send NOTE, if tlv-select is configured idempotency won't be maintained as Cisco device doesn't record configured tlv-select options. As such, Ansible cannot verify if the respective tlv-select options is already configured or not from the device side. If you try to apply tlv-select option in every play run, Ansible will show changed as True. |
| | | **power\_management** boolean | **Choices:*** no
* yes
| IEEE 802.3 DTE Power via MDI TLV |
| | **transmit** boolean | **Choices:*** no
* yes
| Enable LLDP transmission on interface. |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **sh lldp interface**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* rendered
* gathered
* parsed
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL.
Examples
--------
```
# Using merged
#
# Before state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
- name: Merge provided configuration with device configuration
cisco.ios.ios_lldp_interfaces:
config:
- name: GigabitEthernet0/1
receive: true
transmit: true
- name: GigabitEthernet0/2
receive: true
- name: GigabitEthernet0/3
transmit: true
state: merged
# After state:
# ------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: enabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: enabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# Using overridden
#
# Before state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
- name: Override device configuration of all lldp_interfaces with provided configuration
cisco.ios.ios_lldp_interfaces:
config:
- name: GigabitEthernet0/2
receive: true
transmit: true
state: overridden
# After state:
# ------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
# Using replaced
#
# Before state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
- name: Replaces device configuration of listed lldp_interfaces with provided configuration
cisco.ios.ios_lldp_interfaces:
config:
- name: GigabitEthernet0/2
receive: true
transmit: true
- name: GigabitEthernet0/3
receive: true
state: replaced
# After state:
# ------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: disabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# Using Deleted
#
# Before state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
- name: "Delete LLDP attributes of given interfaces (Note: This won't delete the interface itself)"
cisco.ios.ios_lldp_interfaces:
config:
- name: GigabitEthernet0/1
state: deleted
# After state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# Using Deleted without any config passed
# "(NOTE: This will delete all of configured LLDP module attributes)"
#
# Before state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
- name: "Delete LLDP attributes for all configured interfaces (Note: This won't delete the interface itself)"
cisco.ios.ios_lldp_interfaces:
state: deleted
# After state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: INIT
#
# GigabitEthernet0/3:
# Tx: disabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
# Using Gathered
# Before state:
# -------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
- name: Gather listed LLDP interfaces with provided configurations
cisco.ios.ios_lldp_interfaces:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "name": "GigabitEthernet0/0",
# "receive": true,
# "transmit": true
# },
# {
# "name": "GigabitEthernet0/1",
# "receive": true,
# "transmit": true
# },
# {
# "name": "GigabitEthernet0/2",
# "receive": true,
# "transmit": true
# }
# ]
# After state:
# ------------
#
# vios#sh lldp interface
# GigabitEthernet0/0:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
# GigabitEthernet0/2:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_lldp_interfaces:
config:
- name: GigabitEthernet0/0
receive: true
transmit: true
- name: GigabitEthernet0/1
receive: true
transmit: true
- name: GigabitEthernet0/2
receive: true
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "interface GigabitEthernet0/0",
# "lldp receive",
# "lldp transmit",
# "interface GigabitEthernet0/1",
# "lldp receive",
# "lldp transmit",
# "interface GigabitEthernet0/2",
# "lldp receive"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# GigabitEthernet0/0:
# Tx: enabled
# Rx: disabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/1:
# Tx: enabled
# Rx: enabled
# Tx state: IDLE
# Rx state: WAIT FOR FRAME
#
# GigabitEthernet0/2:
# Tx: disabled
# Rx: enabled
# Tx state: IDLE
# Rx state: INIT
- name: Parse the commands for provided configuration
cisco.ios.ios_lldp_interfaces:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "name": "GigabitEthernet0/0",
# "receive": false,
# "transmit": true
# },
# {
# "name": "GigabitEthernet0/1",
# "receive": true,
# "transmit": true
# },
# {
# "name": "GigabitEthernet0/2",
# "receive": true,
# "transmit": false
# }
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device. **Sample:** ['interface GigabitEthernet 0/1', 'lldp transmit', 'lldp receive'] |
### Authors
* Sumit Jaiswal (@justjais)
ansible cisco.ios.ios_linkagg β Manage link aggregation groups on Cisco IOS network devices cisco.ios.ios\_linkagg β Manage link aggregation groups on Cisco IOS network devices
====================================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_linkagg`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of link aggregation groups on Cisco IOS network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** list / elements=dictionary | | List of link aggregation definitions. |
| | **group** string / required | | Channel-group number for the port-channel Link aggregation group. Range 1-255. |
| | **members** list / elements=string | | List of members of the link aggregation group. |
| | **mode** string | **Choices:*** active
* on
* passive
* auto
* desirable
| Mode of the link aggregation group. On mode has to be quoted as 'on' or else pyyaml will convert to True before it gets to Ansible. |
| | **state** string | **Choices:*** present
* absent
| State of the link aggregation group. |
| **group** integer | | Channel-group number for the port-channel Link aggregation group. Range 1-255. |
| **members** list / elements=string | | List of members of the link aggregation group. |
| **mode** string | **Choices:*** active
* on
* passive
* auto
* desirable
| Mode of the link aggregation group. On mode has to be quoted as 'on' or else pyyaml will convert to True before it gets to Ansible. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **purge** boolean | **Choices:*** **no** β
* yes
| Purge links not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** β
* absent
| State of the link aggregation group. |
Notes
-----
Note
* Tested against IOS 15.2
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: create link aggregation group
cisco.ios.ios_linkagg:
group: 10
state: present
- name: delete link aggregation group
cisco.ios.ios_linkagg:
group: 10
state: absent
- name: set link aggregation group to members
cisco.ios.ios_linkagg:
group: 200
mode: active
members:
- GigabitEthernet0/0
- GigabitEthernet0/1
- name: remove link aggregation group from GigabitEthernet0/0
cisco.ios.ios_linkagg:
group: 200
mode: active
members:
- GigabitEthernet0/1
- name: Create aggregate of linkagg definitions
cisco.ios.ios_linkagg:
aggregate:
- {group: 3, mode: on, members: [GigabitEthernet0/1]}
- {group: 100, mode: passive, members: [GigabitEthernet0/2]}
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['interface port-channel 30', 'interface GigabitEthernet0/3', 'channel-group 30 mode on', 'no interface port-channel 30'] |
### Authors
* Trishna Guha (@trishnaguha)
| programming_docs |
ansible cisco.ios.ios_ping β Tests reachability using ping from Cisco IOS network devices cisco.ios.ios\_ping β Tests reachability using ping from Cisco IOS network devices
==================================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_ping`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Tests reachability using ping from switch to a remote destination.
* For a general purpose network module, see the M(net\_ping) module.
* For Windows targets, use the M(win\_ping) module instead.
* For targets running Python, use the M(ping) module instead.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **count** integer | | Number of packets to send. |
| **dest** string / required | | The IP Address or hostname (resolvable by switch) of the remote node. |
| **df\_bit** boolean | **Choices:*** **no** β
* yes
| Set the DF bit. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **size** integer | | Size of packets to send. |
| **source** string | | The source IP Address. |
| **state** string | **Choices:*** absent
* **present** β
| Determines if the expected result is success or fail. |
| **vrf** string | | The VRF to use for forwarding. |
Notes
-----
Note
* For a general purpose network module, see the M(net\_ping) module.
* For Windows targets, use the M(win\_ping) module instead.
* For targets running Python, use the M(ping) module instead.
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: Test reachability to 10.10.10.10 using default vrf
cisco.ios.ios_ping:
dest: 10.10.10.10
- name: Test reachability to 10.20.20.20 using prod vrf
cisco.ios.ios_ping:
dest: 10.20.20.20
vrf: prod
- name: Test unreachability to 10.30.30.30 using default vrf
cisco.ios.ios_ping:
dest: 10.30.30.30
state: absent
- name: Test reachability to 10.40.40.40 using prod vrf and setting count and source
cisco.ios.ios_ping:
dest: 10.40.40.40
source: loopback0
vrf: prod
count: 20
- name: Test reachability to 10.50.50.50 using df-bit and size
cisco.ios.ios_ping:
dest: 10.50.50.50
df_bit: true
size: 1400
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | Show the command sent. **Sample:** ['ping vrf prod 10.40.40.40 count 20 source loopback0'] |
| **packet\_loss** string | always | Percentage of packets lost. **Sample:** 0% |
| **packets\_rx** integer | always | Packets successfully received. **Sample:** 20 |
| **packets\_tx** integer | always | Packets successfully transmitted. **Sample:** 20 |
| **rtt** dictionary | always | Show RTT stats. **Sample:** {'avg': 2, 'max': 8, 'min': 1} |
### Authors
* Jacob McGill (@jmcgill298)
ansible cisco.ios.ios_bgp_address_family β BGP Address family resource module cisco.ios.ios\_bgp\_address\_family β BGP Address family resource module
========================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_bgp_address_family`.
New in version 1.2.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module configures and manages the attributes of bgp address family on Cisco IOS.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** dictionary | | A list of configurations for bgp address family. |
| | **address\_family** list / elements=dictionary | | A list of configurations for bgp address family. |
| | | **afi** string | **Choices:*** ipv4
* ipv6
* l2vpn
* nsap
* rtfilter
* vpnv4
* vpnv6
| Address Family |
| | | **aggregate\_address** list / elements=dictionary | | Configure BGP aggregate entries |
| | | | **address** string | | Aggregate address(A.B.C.D) |
| | | | **advertise\_map** string | | Set condition to advertise attribute |
| | | | **as\_confed\_set** boolean | **Choices:*** no
* yes
| Generate AS confed set path information |
| | | | **as\_set** boolean | **Choices:*** no
* yes
| Generate AS set path information |
| | | | **attribute\_map** string | | Set attributes of aggregate |
| | | | **netmask** string | | Aggregate mask(A.B.C.D) |
| | | | **summary\_only** boolean | **Choices:*** no
* yes
| Filter more specific routes from updates |
| | | | **suppress\_map** string | | Conditionally filter more specific routes from updates |
| | | **auto\_summary** boolean | **Choices:*** no
* yes
| Enable automatic network number summarization |
| | | **bgp** dictionary | | Configure BGP aggregate entries |
| | | | **additional\_paths** dictionary | | Additional paths in the BGP table |
| | | | | **receive** boolean | **Choices:*** no
* yes
| Receive additional paths from neighbors |
| | | | | **select** dictionary | | Selection criteria to pick the paths |
| | | | | | **all** boolean | **Choices:*** no
* yes
| Select all available paths |
| | | | | | **best** integer | | Select best N paths (2-3). |
| | | | | | **group\_best** boolean | **Choices:*** no
* yes
| Select group-best path |
| | | | | **send** boolean | **Choices:*** no
* yes
| Send additional paths to neighbors |
| | | | **aggregate\_timer** integer | | Configure Aggregation Timer Please refer vendor documentation for valid values |
| | | | **dampening** dictionary | | Enable route-flap dampening |
| | | | | **max\_suppress** integer | | Maximum duration to suppress a stable route Please refer vendor documentation for valid values |
| | | | | **penalty\_half\_time** integer | | Half-life time for the penalty Please refer vendor documentation for valid values |
| | | | | **reuse\_route\_val** integer | | Value to start reusing a route Please refer vendor documentation for valid values |
| | | | | **route\_map** string | | Route-map to specify criteria for dampening |
| | | | | **suppress\_route\_val** integer | | Value to start suppressing a route Please refer vendor documentation for valid values |
| | | | **dmzlink\_bw** boolean | **Choices:*** no
* yes
| Use DMZ Link Bandwidth as weight for BGP multipaths |
| | | | **nexthop** dictionary | | Nexthop tracking commands |
| | | | | **route\_map** string | | Route map for valid nexthops |
| | | | | **trigger** dictionary | | Nexthop triggering |
| | | | | | **delay** integer | | Set the delay to tigger nexthop tracking Please refer vendor documentation for valid values |
| | | | | | **enable** boolean | **Choices:*** no
* yes
| Enable nexthop tracking |
| | | | **redistribute\_internal** boolean | **Choices:*** no
* yes
| Allow redistribution of iBGP into IGPs (dangerous) |
| | | | **route\_map** boolean | **Choices:*** no
* yes
| route-map control commands Have route-map set commands take priority over BGP commands such as next-hop unchanged |
| | | | **scan\_time** integer | | Configure background scanner interval Please refer vendor documentation for valid values |
| | | | **slow\_peer** list / elements=dictionary | | Nexthop triggering |
| | | | | **detection** dictionary | | Slow-peer detection |
| | | | | | **enable** boolean | **Choices:*** no
* yes
| Enable slow-peer detection |
| | | | | | **threshold** integer | | Set the slow-peer detection threshold Threshold value (seconds) Please refer vendor documentation for valid values |
| | | | | **split\_update\_group** dictionary | | Configure slow-peer split-update-group |
| | | | | | **dynamic** boolean | **Choices:*** no
* yes
| Dynamically split the slow peer to slow-update group |
| | | | | | **permanent** boolean | **Choices:*** no
* yes
| Keep the slow-peer permanently in slow-update group |
| | | | **soft\_reconfig\_backup** boolean | **Choices:*** no
* yes
| Use soft-reconfiguration inbound only when route-refresh is not negotiated |
| | | | **update\_group** boolean | **Choices:*** no
* yes
| Manage peers in bgp update groups Split update groups based on Policy Keep peers with as-override in different update groups |
| | | **default** boolean | **Choices:*** no
* yes
| Set a command to its defaults |
| | | **default\_information** boolean | **Choices:*** no
* yes
| Distribution of default information Distribute default route |
| | | **default\_metric** integer | | Set metric of redistributed routes |
| | | **distance** dictionary | | Define an administrative distance |
| | | | **external** integer | | Distance for routes external to the AS |
| | | | **internal** integer | | Distance for routes internal to the AS |
| | | | **local** integer | | Distance for local routes |
| | | **neighbor** list / elements=dictionary | | Specify a neighbor router |
| | | | **activate** boolean | **Choices:*** no
* yes
| Enable the Address Family for this Neighbor |
| | | | **additional\_paths** dictionary | | Negotiate additional paths capabilities with this neighbor |
| | | | | **disable** boolean | **Choices:*** no
* yes
| Disable additional paths for this neighbor |
| | | | | **receive** boolean | **Choices:*** no
* yes
| Receive additional paths from neighbors |
| | | | | **send** boolean | **Choices:*** no
* yes
| Send additional paths to this neighbor |
| | | | **address** string | | Neighbor address (A.B.C.D) |
| | | | **advertise** dictionary | | Advertise to this neighbor Advertise additional paths |
| | | | | **all** boolean | **Choices:*** no
* yes
| Select all available paths |
| | | | | **best** integer | | Select best N paths (2-3). |
| | | | | **group\_best** boolean | **Choices:*** no
* yes
| Select group-best path |
| | | | **advertise\_map** dictionary | | specify route-map for conditional advertisement |
| | | | | **exist\_map** string | | advertise prefix only if prefix is in the condition exists condition route-map name |
| | | | | **name** string | | advertise route-map name |
| | | | | **non\_exist\_map** string | | advertise prefix only if prefix in the condition does not exist condition route-map name |
| | | | **advertisement\_interval** integer | | Minimum interval between sending BGP routing updates |
| | | | **aigp** dictionary | | Enable a AIGP on neighbor |
| | | | | **enable** string | | Enable a AIGP on neighbor |
| | | | | **send** dictionary | | Cost community or MED carrying AIGP VALUE |
| | | | | | **cost\_community** dictionary | | Cost extended community carrying AIGP Value |
| | | | | | | **id** integer | | Community ID Please refer vendor documentation for valid values |
| | | | | | | **poi** dictionary | | Point of Insertion |
| | | | | | | | **igp\_cost** boolean | **Choices:*** no
* yes
| Point of Insertion After IGP |
| | | | | | | | **pre\_bestpath** boolean | **Choices:*** no
* yes
| Point of Insertion At Beginning |
| | | | | | | | **transitive** boolean | **Choices:*** no
* yes
| Cost community is Transitive |
| | | | | | **med** boolean | **Choices:*** no
* yes
| Med carrying AIGP Value |
| | | | **allow\_policy** boolean | **Choices:*** no
* yes
| Enable the policy support for this IBGP Neighbor |
| | | | **allowas\_in** integer | | Accept as-path with my AS present in it Please refer vendor documentation for valid values |
| | | | **as\_override** dictionary | | Override matching AS-number while sending update |
| | | | | **set** boolean | **Choices:*** no
* yes
| Enable AS override |
| | | | | **split\_horizon** boolean | **Choices:*** no
* yes
| Maintain Split Horizon while sending update |
| | | | **bmp\_activate** dictionary | | Activate the BMP monitoring for a BGP peer |
| | | | | **all** boolean | **Choices:*** no
* yes
| Activate BMP monitoring for all servers |
| | | | | **server** integer | | Activate BMP for server BMP Server Number Please refer vendor documentation for valid values |
| | | | **capability** dictionary | | Advertise capability to the peer Advertise ORF capability to the peer Advertise prefixlist ORF capability to this neighbor |
| | | | | **both** boolean | **Choices:*** no
* yes
| Capability to SEND and RECEIVE the ORF to/from this neighbor |
| | | | | **receive** boolean | **Choices:*** no
* yes
| Capability to RECEIVE the ORF from this neighbor |
| | | | | **send** boolean | **Choices:*** no
* yes
| Capability to SEND the ORF to this neighbor |
| | | | **cluster\_id** string | | Configure Route-Reflector Cluster-id (peers may reset) Route-Reflector Cluster-id as 32 bit quantity, or Route-Reflector Cluster-id in IP address format (A.B.C.D) |
| | | | **default\_originate** dictionary | | Originate default route to this neighbor |
| | | | | **route\_map** string | | Route-map to specify criteria to originate default |
| | | | | **set** boolean | **Choices:*** no
* yes
| Set default route to this neighbor |
| | | | **description** string | | Neighbor specific description |
| | | | **disable\_connected\_check** boolean | **Choices:*** no
* yes
| one-hop away EBGP peer using loopback address |
| | | | **distribute\_list** dictionary | | Filter updates to/from this neighbor |
| | | | | **acl** string | | ACL id/name |
| | | | | **in** boolean | **Choices:*** no
* yes
| Filter incoming updates |
| | | | | **out** boolean | **Choices:*** no
* yes
| Filter outgoing updates |
| | | | **dmzlink\_bw** boolean | **Choices:*** no
* yes
| Propagate the DMZ link bandwidth |
| | | | **ebgp\_multihop** dictionary | | Allow EBGP neighbors not on directly connected networks |
| | | | | **enable** boolean | **Choices:*** no
* yes
| Allow EBGP neighbors not on directly connected networks |
| | | | | **hop\_count** integer | | Maximum hop count Please refer vendor documentation for valid values |
| | | | **fall\_over** dictionary | | Session fall on peer route lost |
| | | | | **bfd** dictionary | | Use BFD to detect failure |
| | | | | | **multi\_hop** boolean | **Choices:*** no
* yes
| Force BFD multi-hop to detect failure |
| | | | | | **set** boolean | **Choices:*** no
* yes
| set bfd |
| | | | | | **single\_hop** boolean | **Choices:*** no
* yes
| Force BFD single-hop to detect failure |
| | | | | **route\_map** string | | Route map for peer route |
| | | | **filter\_list** dictionary | | Establish BGP filters |
| | | | | **as\_path\_acl** integer | | AS path access list Please refer vendor documentation for valid values |
| | | | | **in** boolean | **Choices:*** no
* yes
| Filter incoming updates |
| | | | | **out** boolean | **Choices:*** no
* yes
| Filter outgoing updates |
| | | | **ha\_mode** dictionary | | high availability mode |
| | | | | **disable** boolean | **Choices:*** no
* yes
| disable graceful-restart |
| | | | | **set** boolean | **Choices:*** no
* yes
| set ha-mode and graceful-restart for this peer |
| | | | **inherit** string | | Inherit a template Inherit a peer-policy template |
| | | | **internal\_vpn\_client** boolean | **Choices:*** no
* yes
| Stack iBGP-CE Neighbor Path in ATTR\_SET for vpn update |
| | | | **ipv6\_adddress** string | | Neighbor ipv6 address (X:X:X:X::X) |
| | | | **local\_as** dictionary | | Specify a local-as number |
| | | | | **dual\_as** boolean | **Choices:*** no
* yes
| Accept either real AS or local AS from the ebgp peer |
| | | | | **no\_prepend** dictionary | | Do not prepend local-as to updates from ebgp peers |
| | | | | | **replace\_as** boolean | **Choices:*** no
* yes
| Replace real AS with local AS in the EBGP updates |
| | | | | | **set** boolean | **Choices:*** no
* yes
| Set prepend |
| | | | | **number** integer | | AS number used as local AS Please refer vendor documentation for valid values |
| | | | | **set** boolean | **Choices:*** no
* yes
| set local-as number |
| | | | **log\_neighbor\_changes** dictionary | | Log neighbor up/down and reset reason |
| | | | | **disable** boolean | **Choices:*** no
* yes
| disable Log neighbor up/down and reset |
| | | | | **set** boolean | **Choices:*** no
* yes
| set Log neighbor up/down and reset |
| | | | **maximum\_prefix** dictionary | | Establish BGP filters |
| | | | | **number** integer | | maximum no. of prefix limit Please refer vendor documentation for valid values |
| | | | | **restart** integer | | Restart bgp connection after limit is exceeded |
| | | | | **threshold\_value** integer | | Threshold value (%) at which to generate a warning msg Please refer vendor documentation for valid values |
| | | | | **warning\_only** boolean | **Choices:*** no
* yes
| Only give warning message when limit is exceeded |
| | | | **next\_hop\_self** boolean | **Choices:*** no
* yes
| Disable the next hop calculation for this neighbor This option is DEPRECATED and is replaced with nexthop\_self which accepts dict as input this attribute will be removed after 2023-06-01. |
| | | | **next\_hop\_unchanged** boolean | **Choices:*** no
* yes
| Propagate next hop unchanged for iBGP paths to this neighbor |
| | | | **nexthop\_self** dictionary | | Disable the next hop calculation for this neighbor |
| | | | | **all** boolean | **Choices:*** no
* yes
| Enable next-hop-self for both eBGP and iBGP received paths |
| | | | | **set** boolean | **Choices:*** no
* yes
| set the next hop self |
| | | | **password** string | | Set a password |
| | | | **path\_attribute** dictionary | | BGP optional attribute filtering |
| | | | | **discard** dictionary | | Discard matching path-attribute for this neighbor |
| | | | | | **in** boolean | **Choices:*** no
* yes
| Perform inbound path-attribute filtering |
| | | | | | **range** dictionary | | path attribute range |
| | | | | | | **end** integer | | path attribute range end value Please refer vendor documentation for valid values |
| | | | | | | **start** integer | | path attribute range start value Please refer vendor documentation for valid values |
| | | | | | **type** integer | | path attribute type Please refer vendor documentation for valid values |
| | | | | **treat\_as\_withdraw** dictionary | | Treat-as-withdraw matching path-attribute for this neighbor |
| | | | | | **in** boolean | **Choices:*** no
* yes
| Perform inbound path-attribute filtering |
| | | | | | **range** dictionary | | path attribute range |
| | | | | | | **end** integer | | path attribute range end value Please refer vendor documentation for valid values |
| | | | | | | **start** integer | | path attribute range start value Please refer vendor documentation for valid values |
| | | | | | **type** integer | | path attribute type Please refer vendor documentation for valid values |
| | | | **peer\_group** boolean | **Choices:*** no
* yes
| Member of the peer-group |
| | | | **prefix\_list** dictionary | | Filter updates to/from this neighbor This option is DEPRECATED and is replaced with prefix\_lists which accepts list of dict as input |
| | | | | **in** boolean | **Choices:*** no
* yes
| Filter incoming updates |
| | | | | **name** string | | Name of a prefix list |
| | | | | **out** boolean | **Choices:*** no
* yes
| Filter outgoing updates |
| | | | **prefix\_lists** list / elements=dictionary | | Filter updates to/from this neighbor |
| | | | | **in** boolean | **Choices:*** no
* yes
| Filter incoming updates |
| | | | | **name** string | | Name of a prefix list |
| | | | | **out** boolean | **Choices:*** no
* yes
| Filter outgoing updates |
| | | | **remote\_as** integer | | Specify a BGP neighbor AS of remote neighbor |
| | | | **remove\_private\_as** dictionary | | Remove private AS number from outbound updates |
| | | | | **all** boolean | **Choices:*** no
* yes
| Remove all private AS numbers |
| | | | | **replace\_as** boolean | **Choices:*** no
* yes
| Replace all private AS numbers with local AS |
| | | | | **set** boolean | **Choices:*** no
* yes
| Remove private AS number from outbound updates |
| | | | **route\_map** dictionary | | Apply route map to neighbor This option is DEPRECATED and is replaced with route\_maps which accepts list of dict as input |
| | | | | **in** boolean | **Choices:*** no
* yes
| Apply map to incoming routes |
| | | | | **name** string | | Name of route map |
| | | | | **out** boolean | **Choices:*** no
* yes
| Apply map to outbound routes |
| | | | **route\_maps** list / elements=dictionary | | Apply route map to neighbor |
| | | | | **in** boolean | **Choices:*** no
* yes
| Apply map to incoming routes |
| | | | | **name** string | | Name of route map |
| | | | | **out** boolean | **Choices:*** no
* yes
| Apply map to outbound routes |
| | | | **route\_reflector\_client** boolean | **Choices:*** no
* yes
| Configure a neighbor as Route Reflector client |
| | | | **route\_server\_client** boolean | **Choices:*** no
* yes
| Configure a neighbor as Route Server client |
| | | | **send\_community** dictionary | | Send Community attribute to this neighbor |
| | | | | **both** boolean | **Choices:*** no
* yes
| Send Standard and Extended Community attributes |
| | | | | **extended** boolean | **Choices:*** no
* yes
| Send Extended Community attribute |
| | | | | **standard** boolean | **Choices:*** no
* yes
| Send Standard Community attribute |
| | | | **shutdown** dictionary | | Administratively shut down this neighbor |
| | | | | **graceful** integer | | Gracefully shut down this neighbor time in seconds Please refer vendor documentation for valid values |
| | | | | **set** boolean | **Choices:*** no
* yes
| shut down |
| | | | **slow\_peer** list / elements=dictionary | | Configure slow-peer |
| | | | | **detection** dictionary | | Configure slow-peer |
| | | | | | **disable** boolean | **Choices:*** no
* yes
| Disable slow-peer detection |
| | | | | | **enable** boolean | **Choices:*** no
* yes
| Enable slow-peer detection |
| | | | | | **threshold** integer | | Set the slow-peer detection threshold |
| | | | | **split\_update\_group** dictionary | | Configure slow-peer |
| | | | | | **dynamic** dictionary | | Configure slow-peer |
| | | | | | | **disable** boolean | **Choices:*** no
* yes
| Configure slow-peer |
| | | | | | | **enable** boolean | **Choices:*** no
* yes
| Configure slow-peer |
| | | | | | | **permanent** boolean | **Choices:*** no
* yes
| Configure slow-peer |
| | | | | | **static** boolean | **Choices:*** no
* yes
| Configure slow-peer |
| | | | **soft\_reconfiguration** boolean | **Choices:*** no
* yes
| Per neighbor soft reconfiguration Allow inbound soft reconfiguration for this neighbor |
| | | | **soo** string | | Site-of-Origin extended community |
| | | | **tag** string | | Neighbor tag |
| | | | **timers** dictionary | | BGP per neighbor timers |
| | | | | **holdtime** integer | | Holdtime |
| | | | | **interval** integer | | Keepalive interval |
| | | | | **min\_holdtime** integer | | Minimum hold time from neighbor |
| | | | **transport** dictionary | | Transport options |
| | | | | **connection\_mode** dictionary | | Specify passive or active connection |
| | | | | | **active** boolean | **Choices:*** no
* yes
| Actively establish the TCP session |
| | | | | | **passive** boolean | **Choices:*** no
* yes
| Passively establish the TCP session |
| | | | | **multi\_session** boolean | **Choices:*** no
* yes
| Use Multi-session for transport |
| | | | | **path\_mtu\_discovery** dictionary | | Use transport path MTU discovery |
| | | | | | **disable** boolean | **Choices:*** no
* yes
| disable |
| | | | | | **set** boolean | **Choices:*** no
* yes
| Use path MTU discovery |
| | | | **ttl\_security** integer | | BGP ttl security check maximum number of hops Please refer vendor documentation for valid values |
| | | | **unsuppress\_map** string | | Route-map to selectively unsuppress suppressed routes |
| | | | **version** integer | | Set the BGP version to match a neighbor Neighbor's BGP version Please refer vendor documentation for valid values |
| | | | **weight** integer | | Set default weight for routes from this neighbor |
| | | **network** list / elements=dictionary | | Specify a network to announce via BGP |
| | | | **address** string | | Network number (A.B.C.D) |
| | | | **backdoor** boolean | **Choices:*** no
* yes
| Specify a BGP backdoor route |
| | | | **mask** string | | Network mask (A.B.C.D) |
| | | | **route\_map** string | | Route-map to modify the attributes |
| | | **redistribute** list / elements=dictionary | | Redistribute information from another routing protocol |
| | | | **application** dictionary | | Application |
| | | | | **metric** integer | | Metric for redistributed routes |
| | | | | **name** string | | Application name |
| | | | | **route\_map** string | | Route map reference |
| | | | **bgp** dictionary | | Border Gateway Protocol (BGP) |
| | | | | **as\_number** string | | Autonomous system number |
| | | | | **metric** integer | | Metric for redistributed routes |
| | | | | **route\_map** string | | Route map reference |
| | | | **connected** dictionary | | Connected |
| | | | | **metric** integer | | Metric for redistributed routes |
| | | | | **route\_map** string | | Route map reference |
| | | | **eigrp** dictionary | | Enhanced Interior Gateway Routing Protocol (EIGRP) |
| | | | | **as\_number** string | | Autonomous system number |
| | | | | **metric** integer | | Metric for redistributed routes |
| | | | | **route\_map** string | | Route map reference |
| | | | **isis** dictionary | | ISO IS-IS |
| | | | | **area\_tag** string | | ISO routing area tag |
| | | | | **clns** boolean | **Choices:*** no
* yes
| Redistribution of OSI dynamic routes |
| | | | | **ip** boolean | **Choices:*** no
* yes
| Redistribution of IP dynamic routes |
| | | | | **metric** integer | | Metric for redistributed routes |
| | | | | **route\_map** string | | Route map reference |
| | | | **iso\_igrp** dictionary | | IGRP for OSI networks |
| | | | | **area\_tag** string | | ISO routing area tag |
| | | | | **route\_map** string | | Route map reference |
| | | | **lisp** dictionary | | Locator ID Separation Protocol (LISP) |
| | | | | **metric** integer | | Metric for redistributed routes |
| | | | | **route\_map** string | | Route map reference |
| | | | **mobile** dictionary | | Mobile routes |
| | | | | **metric** integer | | Metric for redistributed routes |
| | | | | **route\_map** string | | Route map reference |
| | | | **odr** dictionary | | On Demand stub Routes |
| | | | | **metric** integer | | Metric for redistributed routes |
| | | | | **route\_map** string | | Route map reference |
| | | | **ospf** dictionary | | Open Shortest Path First (OSPF) |
| | | | | **match** dictionary | | On Demand stub Routes |
| | | | | | **external** boolean | **Choices:*** no
* yes
| Redistribute OSPF external routes |
| | | | | | **internal** boolean | **Choices:*** no
* yes
| Redistribute OSPF internal routes |
| | | | | | **nssa\_external** boolean | **Choices:*** no
* yes
| Redistribute OSPF NSSA external routes |
| | | | | | **type\_1** boolean | **Choices:*** no
* yes
| Redistribute NSSA external type 1 routes |
| | | | | | **type\_2** boolean | **Choices:*** no
* yes
| Redistribute NSSA external type 2 routes |
| | | | | **metric** integer | | Metric for redistributed routes |
| | | | | **process\_id** integer | | Process ID |
| | | | | **route\_map** string | | Route map reference |
| | | | | **vrf** string | | VPN Routing/Forwarding Instance |
| | | | **ospfv3** dictionary | | OSPFv3 |
| | | | | **match** dictionary | | On Demand stub Routes |
| | | | | | **external** boolean | **Choices:*** no
* yes
| Redistribute OSPF external routes |
| | | | | | **internal** boolean | **Choices:*** no
* yes
| Redistribute OSPF internal routes |
| | | | | | **nssa\_external** boolean | **Choices:*** no
* yes
| Redistribute OSPF NSSA external routes |
| | | | | | **type\_1** boolean | **Choices:*** no
* yes
| Redistribute NSSA external type 1 routes |
| | | | | | **type\_2** boolean | **Choices:*** no
* yes
| Redistribute NSSA external type 2 routes |
| | | | | **metric** integer | | Metric for redistributed routes |
| | | | | **process\_id** integer | | Process ID |
| | | | | **route\_map** string | | Route map reference |
| | | | **rip** dictionary | | Routing Information Protocol (RIP) |
| | | | | **metric** integer | | Metric for redistributed routes |
| | | | | **route\_map** string | | Route map reference |
| | | | **static** dictionary | | Static routes |
| | | | | **clns** boolean | **Choices:*** no
* yes
| Redistribution of OSI static routes |
| | | | | **ip** boolean | **Choices:*** no
* yes
| Redistribution of IP static routes |
| | | | | **metric** integer | | Metric for redistributed routes |
| | | | | **route\_map** string | | Route map reference |
| | | | **vrf** dictionary | | Specify a source VRF |
| | | | | **global** boolean | **Choices:*** no
* yes
| global VRF |
| | | | | **name** string | | Source VRF name |
| | | **safi** string | **Choices:*** flowspec
* mdt
* multicast
* mvpn
* evpn
* unicast
| Address Family modifier |
| | | **snmp** dictionary | | Modify snmp parameters |
| | | | **context** dictionary | | Configure a SNMP context Context Name |
| | | | | **community** dictionary | | Configure a SNMP v2c Community string and access privs |
| | | | | | **acl** string | | Standard IP accesslist allowing access with this community string Expanded IP accesslist allowing access with this community string Access-list name |
| | | | | | **ipv6** string | | Specify IPv6 Named Access-List IPv6 Access-list name |
| | | | | | **ro** boolean | **Choices:*** no
* yes
| Read-only access with this community string |
| | | | | | **rw** boolean | **Choices:*** no
* yes
| Read-write access with this community string |
| | | | | | **snmp\_community** string | | SNMP community string |
| | | | | **name** string | | Context Name |
| | | | | **user** dictionary | | Configure a SNMP v3 user |
| | | | | | **access** dictionary | | specify an access-list associated with this group |
| | | | | | | **acl** string | | SNMP community string |
| | | | | | | **ipv6** string | | Specify IPv6 Named Access-List IPv6 Access-list name |
| | | | | | **auth** dictionary | | authentication parameters for the user |
| | | | | | | **md5** string | | Use HMAC MD5 algorithm for authentication authentication password for user |
| | | | | | | **sha** string | | Use HMAC SHA algorithm for authentication authentication password for user |
| | | | | | **credential** boolean | **Choices:*** no
* yes
| If the user password is already configured and saved |
| | | | | | **encrypted** boolean | **Choices:*** no
* yes
| specifying passwords as MD5 or SHA digests |
| | | | | | **name** string | | SNMP community string |
| | | | | | **priv** dictionary | | encryption parameters for the user |
| | | | | | | **des** string | | Use 56 bit DES algorithm for encryption |
| | | **table\_map** dictionary | | Map external entry attributes into routing table |
| | | | **filter** boolean | **Choices:*** no
* yes
| Selective route download |
| | | | **name** string | | route-map name |
| | | **vrf** string | | Specify parameters for a VPN Routing/Forwarding instance |
| | **as\_number** string | | Autonomous system number. |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **sh running-config | section ^router bgp**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* gathered
* rendered
* parsed
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL
Examples
--------
```
# Using merged
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
- name: Merge provided configuration with device configuration
cisco.ios.ios_bgp_address_family:
config:
as_number: 65000
address_family:
- afi: ipv4
safi: multicast
vrf: blue
aggregate_address:
- address: 192.0.2.1
netmask: 255.255.255.255
as_confed_set: true
bgp:
aggregate_timer: 10
dampening:
penalty_half_time: 1
reuse_route_val: 1
suppress_route_val: 1
max_suppress: 1
slow_peer:
- detection:
threshold: 150
neighbor:
- address: 198.51.100.1
aigp:
send:
cost_community:
id: 100
poi:
igp_cost: true
transitive: true
slow_peer:
- detection:
threshold: 150
remote_as: 10
route_map:
- name: test-route-out
out: true
- name: test-route-in
in: true
route_server_client: true
network:
- address: 198.51.110.10
mask: 255.255.255.255
backdoor: true
snmp:
context:
name: snmp_con
community:
snmp_community: community
ro: true
acl: 10
- afi: ipv4
safi: mdt
bgp:
dmzlink_bw: true
dampening:
penalty_half_time: 1
reuse_route_val: 10
suppress_route_val: 100
max_suppress: 5
soft_reconfig_backup: true
- afi: ipv4
safi: multicast
aggregate_address:
- address: 192.0.3.1
netmask: 255.255.255.255
as_confed_set: true
default_metric: 12
distance:
external: 10
internal: 10
local: 100
network:
- address: 198.51.111.11
mask: 255.255.255.255
route_map: test
table_map:
name: test_tableMap
filter: true
state: merged
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "address-family ipv4 multicast vrf blue",
# "bgp aggregate-timer 10",
# "bgp slow-peer detection threshold 150",
# "bgp dampening 1 1 1 1",
# "neighbor 198.51.100.1 remote-as 10",
# "neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "neighbor 198.51.100.1 route-map test-route out",
# "neighbor 198.51.100.1 route-server-client",
# "neighbor 198.51.100.1 slow-peer detection threshold 150",
# "network 198.51.110.10 mask 255.255.255.255 backdoor",
# "snmp context snnmp_con_1 community community ro 10",
# "aggregate-address 192.0.2.1 255.255.255.255 as-confed-set",
# "exit-address-family",
# "address-family ipv4 mdt",
# "bgp dmzlink-bw",
# "bgp dampening 1 10 100 5",
# "bgp soft-reconfig-backup",
# "exit-address-family",
# "address-family ipv4 multicast",
# "network 1.1.1.1 mask 255.255.255.255 route-map test",
# "aggregate-address 192.0.3.1 255.255.255.255 as-confed-set",
# "default-metric 12",
# "distance bgp 10 10 100",
# "table-map test_tableMap filter"
# "exit-address-family",
# ]
# After state:
# ------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 1.1.1.1 mask 255.255.255.255 route-map test
# aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# default-metric 12
# distance bgp 10 10 100
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 1 1 1 1
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.100.1 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-server-client
# neighbor 198.51.100.1 slow-peer detection threshold 150
# neighbor 198.51.100.1 route-map test-route out
# exit-address-family
# Using replaced
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 1.1.1.1 mask 255.255.255.255 route-map test
# aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# default-metric 12
# distance bgp 10 10 100
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 1 1 1 1
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.100.1 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-server-client
# neighbor 198.51.100.1 slow-peer detection threshold 150
# neighbor 198.51.100.1 route-map test-route out
# exit-address-family
- name: Replaces device configuration of listed AF BGP with provided configuration
cisco.ios.ios_bgp_address_family:
config:
as_number: 65000
address_family:
- afi: ipv4
safi: multicast
vrf: blue
aggregate_address:
- address: 192.0.2.1
netmask: 255.255.255.255
as_confed_set: true
bgp:
aggregate_timer: 10
dampening:
penalty_half_time: 1
reuse_route_val: 1
suppress_route_val: 1
max_suppress: 1
slow_peer:
- detection:
threshold: 150
neighbor:
- address: 198.51.110.1
activate: true
aigp:
send:
cost_community:
id: 200
poi:
igp_cost: true
transitive: true
slow_peer:
- detection:
threshold: 150
remote_as: 10
route_maps:
- name: test-replaced-route
out: true
route_server_client: true
network:
- address: 198.51.110.10
mask: 255.255.255.255
backdoor: true
- afi: ipv4
safi: multicast
bgp:
aggregate_timer: 10
dampening:
penalty_half_time: 10
reuse_route_val: 10
suppress_route_val: 10
max_suppress: 10
slow_peer:
- detection:
threshold: 200
network:
- address: 192.0.2.1
mask: 255.255.255.255
route_map: test
state: replaced
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "address-family ipv4 multicast vrf blue",
# "neighbor 198.51.110.1 remote-as 10",
# "neighbor 198.51.110.1 activate",
# "neighbor 198.51.110.1 aigp send cost-community 200 poi igp-cost transitive",
# "neighbor 198.51.110.1 route-map test-replaced-route out",
# "neighbor 198.51.110.1 route-server-client",
# "neighbor 198.51.110.1 slow-peer detection threshold 150",
# "no neighbor 198.51.100.1 remote-as 10",
# "no neighbor 198.51.100.1 activate",
# "no neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "no neighbor 198.51.100.1 route-map test-route out",
# "no neighbor 198.51.100.1 route-server-client",
# "no neighbor 198.51.100.1 slow-peer detection threshold 150",
# "exit-address-family",
# "address-family ipv4 multicast",
# "bgp aggregate-timer 10",
# "bgp slow-peer detection threshold 200",
# "bgp dampening 10 10 10 10",
# "network 192.0.2.1 mask 255.255.255.255 route-map test",
# "no network 1.1.1.1 mask 255.255.255.255 route-map test",
# "no aggregate-address 192.0.3.1 255.255.255.255 as-confed-set",
# "no default-metric 12",
# "no distance bgp 10 10 100",
# "no table-map test_tableMap filter"
# "exit-address-family",
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 200
# bgp dampening 10 10 10 10
# network 192.0.2.1 mask 255.255.255.255 route-map test
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 1 1 1 1
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.110.1 remote-as 10
# neighbor 198.51.110.1 activate
# neighbor 198.51.110.1 aigp send cost-community 200 poi igp-cost transitive
# neighbor 198.51.110.1 route-server-client
# neighbor 198.51.110.1 slow-peer detection threshold 150
# neighbor 198.51.110.1 route-map test-replaced-route out
# exit-address-family
# Using overridden
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 1.1.1.1 mask 255.255.255.255 route-map test
# aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# default-metric 12
# distance bgp 10 10 100
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 1 1 1 1
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.100.1 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-server-client
# neighbor 198.51.100.1 slow-peer detection threshold 150
# neighbor 198.51.100.1 route-map test-route out
# exit-address-family
- name: Override device configuration of all AF BGP with provided configuration
cisco.ios.ios_bgp_address_family:
config:
as_number: 65000
address_family:
- afi: ipv4
safi: multicast
vrf: blue
aggregate_address:
- address: 192.0.2.1
netmask: 255.255.255.255
as_confed_set: true
bgp:
aggregate_timer: 10
dampening:
penalty_half_time: 10
reuse_route_val: 10
suppress_route_val: 100
max_suppress: 50
slow_peer:
- detection:
threshold: 150
neighbor:
- address: 198.51.110.1
activate: true
log_neighbor_changes:
disable: true
maximum_prefix:
number: 1
threshold_value: 10
restart: 100
slow_peer:
- detection:
threshold: 150
remote_as: 100
route_maps:
- name: test-override-route
out: true
route_server_client: true
version: 4
network:
- address: 198.51.110.10
mask: 255.255.255.255
backdoor: true
- afi: ipv6
safi: multicast
default_information: true
bgp:
aggregate_timer: 10
dampening:
penalty_half_time: 10
reuse_route_val: 10
suppress_route_val: 10
max_suppress: 10
slow_peer:
- detection:
threshold: 200
network:
- address: 2001:DB8:0:3::/64
route_map: test_ipv6
state: overridden
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "no address-family ipv4 multicast",
# "no address-family ipv4 mdt",
# "address-family ipv4 multicast vrf blue",
# "bgp aggregate-timer 10",
# "bgp slow-peer detection threshold 150",
# "bgp dampening 10 10 100 50",
# "neighbor 198.51.110.1 remote-as 100",
# "neighbor 198.51.110.1 activate",
# "neighbor 198.51.110.1 log-neighbor-changes disable",
# "neighbor 198.51.110.1 maximum-prefix 1 10 restart 100",
# "neighbor 198.51.110.1 route-map test-override-route out",
# "neighbor 198.51.110.1 route-server-client",
# "neighbor 198.51.110.1 version 4",
# "neighbor 198.51.110.1 slow-peer detection threshold 150",
# "network 198.51.110.10 mask 255.255.255.255 backdoor",
# "aggregate-address 192.0.2.1 255.255.255.255 as-confed-set",
# "exit-address-family",
# "address-family ipv6 multicast",
# "bgp aggregate-timer 10",
# "bgp slow-peer detection threshold 200",
# "bgp dampening 10 10 10 10",
# "network 2001:DB8:0:3::/64 route-map test_ipv6"
# "exit-address-family",
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# bgp nopeerup-delay post-boot 10
# bgp bestpath med confed
# snmp context snnmp_con_1 community community RO 10
# neighbor 192.0.2.1 remote-as 100
# neighbor 192.0.2.1 description replace neighbor
# neighbor 198.51.100.1 remote-as 10
# !
# address-family ipv6 multicast
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 200
# bgp dampening 10 10 10 10
# network 2001:DB8:0:3::/64 route-map test_ipv6
# exit-address-family
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 10 10 100 50
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.110.1 remote-as 100
# neighbor 198.51.110.1 log-neighbor-changes disable
# neighbor 198.51.110.1 version 4
# neighbor 198.51.110.1 activate
# neighbor 198.51.110.1 route-server-client
# neighbor 198.51.110.1 slow-peer detection threshold 150
# neighbor 198.51.110.1 route-map test-override-route out
# neighbor 198.51.110.1 maximum-prefix 1 10 restart 100
# exit-address-family
# Using Deleted
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 1.1.1.1 mask 255.255.255.255 route-map test
# aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# default-metric 12
# distance bgp 10 10 100
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 1 1 1 1
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.100.1 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-server-client
# neighbor 198.51.100.1 slow-peer detection threshold 150
# neighbor 198.51.100.1 route-map test-route out
# exit-address-family
- name: "Delete AF BGP (Note: This won't delete the all configured AF BGP)"
cisco.ios.ios_bgp_address_family:
config:
as_number: 65000
address_family:
- afi: ipv4
safi: multicast
- afi: ipv4
safi: mdt
state: deleted
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "no address-family ipv4 multicast",
# "no address-family ipv4 mdt"
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bg
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 1 1 1 1
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.100.1 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-server-client
# neighbor 198.51.100.1 slow-peer detection threshold 150
# neighbor 198.51.100.1 route-map test-route out
# exit-address-family
# Using Deleted without any config passed
#"(NOTE: This will delete all of configured AF BGP)"
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 1.1.1.1 mask 255.255.255.255 route-map test
# aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# default-metric 12
# distance bgp 10 10 100
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# !
# address-family ipv4 multicast vrf blue
# bgp aggregate-timer 10
# bgp slow-peer detection threshold 150
# bgp dampening 1 1 1 1
# network 198.51.110.10 mask 255.255.255.255 backdoor
# aggregate-address 192.0.2.1 255.255.255.255 as-confed-set
# neighbor 198.51.100.1 remote-as 10
# neighbor 198.51.100.1 activate
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-server-client
# neighbor 198.51.100.1 slow-peer detection threshold 150
# neighbor 198.51.100.1 route-map test-route out
# exit-address-family
- name: 'Delete ALL of configured AF BGP (Note: This WILL delete the all configured
AF BGP)'
cisco.ios.ios_bgp_address_family:
state: deleted
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "no address-family ipv4 multicast vrf blue",
# "no address-family ipv4 multicast",
# "no address-family ipv4 mdt"
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# Using Gathered
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
- name: Gather listed AF BGP with provided configurations
cisco.ios.ios_bgp_address_family:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": {
# "address_family": [
# {
# "afi": "ipv4",
# "aggregate_address": [{
# "address": "192.0.2.1",
# "as_confed_set": true,
# "netmask": "255.255.255.255"
# }],
# "bgp": {
# "aggregate_timer": 10,
# "dampening": {
# "max_suppress": 1,
# "penalty_half_time": 1,
# "reuse_route_val": 1,
# "suppress_route_val": 1
# },
# "slow_peer": [
# {
# "detection": {
# "threshold": 150
# }
# }
# ]
# },
# "neighbor": [
# {
# "activate": true,
# "address": "198.51.100.1",
# "aigp": {
# "send": {
# "cost_community": {
# "id": 100,
# "poi": {
# "igp_cost": true,
# "transitive": true
# }
# }
# }
# },
# "remote_as": 10,
# "route_maps": [{
# "name": "test-route",
# "out": true
# }],
# "route_server_client": true,
# "slow_peer": [
# {
# "detection": {
# "threshold": 150
# }
# }
# ]
# }
# ],
# "network": [
# {
# "address": "198.51.110.10",
# "backdoor": true,
# "mask": "255.255.255.255"
# }
# ],
# "safi": "multicast",
# "snmp": {
# "context": {
# "community": {
# "acl": "10",
# "ro": true,
# "snmp_community": "community"
# },
# "name": "snnmp_con_1"
# }
# },
# "vrf": "blue"
# },
# {
# "afi": "ipv4",
# "aggregate_address": [{
# "address": "192.0.3.1",
# "as_confed_set": true,
# "netmask": "255.255.255.255"
# }],
# "default_metric": 12,
# "distance": {
# "external": 10,
# "internal": 10,
# "local": 100
# },
# "network": [
# {
# "address": "1.1.1.1",
# "mask": "255.255.255.255",
# "route_map": "test"
# }
# ],
# "safi": "multicast",
# "table_map": {
# "filter": true,
# "name": "test_tableMap"
# }
# },
# {
# "afi": "ipv4",
# "bgp": {
# "dampening": {
# "max_suppress": 5,
# "penalty_half_time": 1,
# "reuse_route_val": 10,
# "suppress_route_val": 100
# },
# "dmzlink_bw": true,
# "soft_reconfig_backup": true
# },
# "safi": "mdt"
# }
# ],
# "as_number": "65000"
# }
# Using Rendered
- name: Rendered the provided configuration with the existing running configuration
cisco.ios.ios_bgp_address_family:
config:
as_number: 65000
address_family:
- afi: ipv4
safi: multicast
vrf: blue
aggregate_address:
- address: 192.0.2.1
netmask: 255.255.255.255
as_confed_set: true
bgp:
aggregate_timer: 10
dampening:
penalty_half_time: 1
reuse_route_val: 1
suppress_route_val: 1
max_suppress: 1
slow_peer:
- detection:
threshold: 150
neighbor:
- address: 198.51.100.1
aigp:
send:
cost_community:
id: 100
poi:
igp_cost: true
transitive: true
slow_peer:
- detection:
threshold: 150
remote_as: 10
route_maps:
- name: test-route
out: true
route_server_client: true
network:
- address: 198.51.110.10
mask: 255.255.255.255
backdoor: true
snmp:
context:
name: snmp_con
community:
snmp_community: community
ro: true
acl: 10
- afi: ipv4
safi: mdt
bgp:
dmzlink_bw: true
dampening:
penalty_half_time: 1
reuse_route_val: 10
suppress_route_val: 100
max_suppress: 5
soft_reconfig_backup: true
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "router bgp 65000",
# "address-family ipv4 multicast vrf blue",
# "bgp aggregate-timer 10",
# "bgp slow-peer detection threshold 150",
# "bgp dampening 1 1 1 1",
# "neighbor 198.51.100.1 remote-as 10",
# "neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "neighbor 198.51.100.1 route-map test-route out",
# "neighbor 198.51.100.1 route-server-client",
# "neighbor 198.51.100.1 slow-peer detection threshold 150",
# "network 198.51.110.10 mask 255.255.255.255 backdoor",
# "snmp context snnmp_con_1 community community ro 10",
# "aggregate-address 192.0.2.1 255.255.255.255 as-confed-set",
# "exit-address-family",
# "address-family ipv4 mdt",
# "bgp dmzlink-bw",
# "bgp dampening 1 10 100 5",
# "bgp soft-reconfig-backup"
# "exit-address-family",
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# !
# address-family ipv4 multicast
# table-map test_tableMap filter
# network 1.1.1.1 mask 255.255.255.255 route-map test
# aggregate-address 192.0.3.1 255.255.255.255 as-confed-set
# default-metric 12
# distance bgp 10 10 100
# exit-address-family
# !
# address-family ipv4 mdt
# bgp dampening 1 10 100 5
# bgp dmzlink-bw
# bgp soft-reconfig-backup
# exit-address-family
# !
- name: Parse the commands for provided configuration
cisco.ios.ios_bgp_address_family:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": {
# "address_family": [
# {
# "afi": "ipv4",
# "aggregate_address": [{
# "address": "192.0.3.1",
# "as_confed_set": true,
# "netmask": "255.255.255.255"
# }],
# "default_metric": 12,
# "distance": {
# "external": 10,
# "internal": 10,
# "local": 100
# },
# "network": [
# {
# "address": "1.1.1.1",
# "mask": "255.255.255.255",
# "route_map": "test"
# }
# ],
# "safi": "multicast",
# "table_map": {
# "filter": true,
# "name": "test_tableMap"
# }
# },
# {
# "afi": "ipv4",
# "bgp": {
# "dampening": {
# "max_suppress": 5,
# "penalty_half_time": 1,
# "reuse_route_val": 10,
# "suppress_route_val": 100
# },
# "dmzlink_bw": true,
# "soft_reconfig_backup": true
# },
# "safi": "mdt"
# }
# ],
# "as_number": "65000"
# }
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** dictionary | when changed | The resulting configuration after module execution. **Sample:** This output will always be in the same format as the module argspec. |
| **before** dictionary | when *state* is `merged`, `replaced`, `overridden`, `deleted` or `purged` | The configuration prior to the module execution. **Sample:** This output will always be in the same format as the module argspec. |
| **commands** list / elements=string | when *state* is `merged`, `replaced`, `overridden`, `deleted` or `purged` | The set of commands pushed to the remote device. **Sample:** ['router bgp 65000', 'address-family ipv4 multicast', 'table-map test\_tableMap filter', 'network 1.1.1.1 mask 255.255.255.255 route-map test', 'aggregate-address 192.0.3.1 255.255.255.255 as-confed-set'] |
| **gathered** list / elements=string | when *state* is `gathered` | Facts about the network resource gathered from the remote device as structured data. **Sample:** This output will always be in the same format as the module argspec. |
| **parsed** list / elements=string | when *state* is `parsed` | The device native config provided in *running\_config* option parsed into structured data as per module argspec. **Sample:** This output will always be in the same format as the module argspec. |
| **rendered** list / elements=string | when *state* is `rendered` | The provided configuration in the task rendered in device-native format (offline). **Sample:** ['router bgp 65000', 'address-family ipv4 multicast', 'table-map test\_tableMap filter', 'network 1.1.1.1 mask 255.255.255.255 route-map test', 'aggregate-address 192.0.3.1 255.255.255.255 as-confed-set'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ios.ios_vrf β Manage the collection of VRF definitions on Cisco IOS devices cisco.ios.ios\_vrf β Manage the collection of VRF definitions on Cisco IOS devices
==================================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_vrf`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of VRF definitions on Cisco IOS devices. It allows playbooks to manage individual or the entire VRF collection. It also supports purging VRF definitions from the configuration that are not explicitly defined.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **associated\_interfaces** list / elements=string | | This is a intent option and checks the operational state of the for given vrf `name` for associated interfaces. If the value in the `associated_interfaces` does not match with the operational state of vrf interfaces on device it will result in failure. |
| **delay** integer | **Default:**10 | Time in seconds to wait before checking for the operational state on remote device. |
| **description** string | | Provides a short description of the VRF definition in the current active configuration. The VRF definition value accepts alphanumeric characters used to provide additional information about the VRF. |
| **interfaces** list / elements=string | | Identifies the set of interfaces that should be configured in the VRF. Interfaces must be routed interfaces in order to be placed into a VRF. |
| **name** string | | The name of the VRF definition to be managed on the remote IOS device. The VRF definition name is an ASCII string name used to uniquely identify the VRF. This argument is mutually exclusive with the `vrfs` argument |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **purge** boolean | **Choices:*** **no** β
* yes
| Instructs the module to consider the VRF definition absolute. It will remove any previously configured VRFs on the device. |
| **rd** string | | The router-distinguisher value uniquely identifies the VRF to routing processes on the remote IOS system. The RD value takes the form of `A:B` where `A` and `B` are both numeric values. |
| **route\_both** list / elements=string | | Adds an export and import list of extended route target communities to the VRF. |
| **route\_both\_ipv4** list / elements=string | | Adds an export and import list of extended route target communities in address-family configuration submode to the VRF. |
| **route\_both\_ipv6** list / elements=string | | Adds an export and import list of extended route target communities in address-family configuration submode to the VRF. |
| **route\_export** list / elements=string | | Adds an export list of extended route target communities to the VRF. |
| **route\_export\_ipv4** list / elements=string | | Adds an export list of extended route target communities in address-family configuration submode to the VRF. |
| **route\_export\_ipv6** list / elements=string | | Adds an export list of extended route target communities in address-family configuration submode to the VRF. |
| **route\_import** list / elements=string | | Adds an import list of extended route target communities to the VRF. |
| **route\_import\_ipv4** list / elements=string | | Adds an import list of extended route target communities in address-family configuration submode to the VRF. |
| **route\_import\_ipv6** list / elements=string | | Adds an import list of extended route target communities in address-family configuration submode to the VRF. |
| **state** string | **Choices:*** **present** β
* absent
| Configures the state of the VRF definition as it relates to the device operational configuration. When set to *present*, the VRF should be configured in the device active configuration and when set to *absent* the VRF should not be in the device active configuration |
| **vrfs** list / elements=raw | | The set of VRF definition objects to be configured on the remote IOS device. Ths list entries can either be the VRF name or a hash of VRF definitions and attributes. This argument is mutually exclusive with the `name` argument. |
Notes
-----
Note
* Tested against IOS 15.6
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: configure a vrf named management
cisco.ios.ios_vrf:
name: management
description: oob mgmt vrf
interfaces:
- Management1
- name: remove a vrf named test
cisco.ios.ios_vrf:
name: test
state: absent
- name: configure set of VRFs and purge any others
cisco.ios.ios_vrf:
vrfs:
- red
- blue
- green
purge: yes
- name: Creates a list of import RTs for the VRF with the same parameters
cisco.ios.ios_vrf:
name: test_import
rd: 1:100
route_import:
- 1:100
- 3:100
- name: Creates a list of import RTs in address-family configuration submode for the
VRF with the same parameters
cisco.ios.ios_vrf:
name: test_import_ipv4
rd: 1:100
route_import_ipv4:
- 1:100
- 3:100
- name: Creates a list of import RTs in address-family configuration submode for the
VRF with the same parameters
cisco.ios.ios_vrf:
name: test_import_ipv6
rd: 1:100
route_import_ipv6:
- 1:100
- 3:100
- name: Creates a list of export RTs for the VRF with the same parameters
cisco.ios.ios_vrf:
name: test_export
rd: 1:100
route_export:
- 1:100
- 3:100
- name: Creates a list of export RTs in address-family configuration submode for the
VRF with the same parameters
cisco.ios.ios_vrf:
name: test_export_ipv4
rd: 1:100
route_export_ipv4:
- 1:100
- 3:100
- name: Creates a list of export RTs in address-family configuration submode for the
VRF with the same parameters
cisco.ios.ios_vrf:
name: test_export_ipv6
rd: 1:100
route_export_ipv6:
- 1:100
- 3:100
- name: Creates a list of import and export route targets for the VRF with the same
parameters
cisco.ios.ios_vrf:
name: test_both
rd: 1:100
route_both:
- 1:100
- 3:100
- name: Creates a list of import and export route targets in address-family configuration
submode for the VRF with the same parameters
cisco.ios.ios_vrf:
name: test_both_ipv4
rd: 1:100
route_both_ipv4:
- 1:100
- 3:100
- name: Creates a list of import and export route targets in address-family configuration
submode for the VRF with the same parameters
cisco.ios.ios_vrf:
name: test_both_ipv6
rd: 1:100
route_both_ipv6:
- 1:100
- 3:100
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['vrf definition ansible', 'description management vrf', {'rd': '1:100'}] |
| **delta** string | always | The time elapsed to perform all operations **Sample:** 0:00:10.469466 |
| **end** string | always | The time the job ended **Sample:** 2016-11-16 10:38:25.595612 |
| **start** string | always | The time the job started **Sample:** 2016-11-16 10:38:15.126146 |
### Authors
* Peter Sprygada (@privateip)
ansible cisco.ios.ios_vlans β VLANs resource module cisco.ios.ios\_vlans β VLANs resource module
============================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_vlans`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of VLANs on Cisco IOS network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A dictionary of VLANs options |
| | **mtu** integer | | VLAN Maximum Transmission Unit. Refer to vendor documentation for valid values. |
| | **name** string | | Ascii name of the VLAN. NOTE, *name* should not be named/appended with *default* as it is reserved for device default vlans. |
| | **remote\_span** boolean | **Choices:*** no
* yes
| Configure as Remote SPAN VLAN |
| | **shutdown** string | **Choices:*** enabled
* disabled
| Shutdown VLAN switching. |
| | **state** string | **Choices:*** active
* suspend
| Operational state of the VLAN |
| | **vlan\_id** integer / required | | ID of the VLAN. Range 1-4094 |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **show vlan**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* rendered
* gathered
* parsed
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSl2 device with Version 15.2 on VIRL.
* Starting from v2.5.0, this module will fail when run against Cisco IOS devices that do not support VLANs. The offline states (`rendered` and `parsed`) will work as expected.
Examples
--------
```
# Using merged
# Before state:
# -------------
#
# vios_l2#show vlan
# VLAN Name Status Ports
# ---- -------------------------------- --------- -------------------------------
# 1 default active Gi0/1, Gi0/2
# 1002 fddi-default act/unsup
# 1003 token-ring-default act/unsup
# 1004 fddinet-default act/unsup
# 1005 trnet-default act/unsup
#
# VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
# ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
# 1 enet 100001 1500 - - - - - 0 0
# 1002 fddi 101002 1500 - - - - - 0 0
# 1003 tr 101003 1500 - - - - - 0 0
# 1004 fdnet 101004 1500 - - - ieee - 0 0
# 1005 trnet 101005 1500 - - - ibm - 0 0
- name: Merge provided configuration with device configuration
cisco.ios.ios_vlans:
config:
- name: Vlan_10
vlan_id: 10
state: active
shutdown: disabled
remote_span: true
- name: Vlan_20
vlan_id: 20
mtu: 610
state: active
shutdown: enabled
- name: Vlan_30
vlan_id: 30
state: suspend
shutdown: enabled
state: merged
# After state:
# ------------
#
# vios_l2#show vlan
# VLAN Name Status Ports
# ---- -------------------------------- --------- -------------------------------
# 1 default active Gi0/1, Gi0/2
# 10 vlan_10 active
# 20 vlan_20 act/lshut
# 30 vlan_30 sus/lshut
# 1002 fddi-default act/unsup
# 1003 token-ring-default act/unsup
# 1004 fddinet-default act/unsup
# 1005 trnet-default act/unsup
#
# VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
# ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
# 1 enet 100001 1500 - - - - - 0 0
# 10 enet 100010 1500 - - - - - 0 0
# 20 enet 100020 610 - - - - - 0 0
# 30 enet 100030 1500 - - - - - 0 0
# 1002 fddi 101002 1500 - - - - - 0 0
# 1003 tr 101003 1500 - - - - - 0 0
# 1004 fdnet 101004 1500 - - - ieee - 0 0
# 1005 trnet 101005 1500 - - - ibm - 0 0
#
# Remote SPAN VLANs
# ------------------------------------------------------------------------------
# 10
# Using overridden
# Before state:
# -------------
#
# vios_l2#show vlan
# VLAN Name Status Ports
# ---- -------------------------------- --------- -------------------------------
# 1 default active Gi0/1, Gi0/2
# 10 vlan_10 active
# 20 vlan_20 act/lshut
# 30 vlan_30 sus/lshut
# 1002 fddi-default act/unsup
# 1003 token-ring-default act/unsup
# 1004 fddinet-default act/unsup
# 1005 trnet-default act/unsup
#
# VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
# ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
# 1 enet 100001 1500 - - - - - 0 0
# 10 enet 100010 1500 - - - - - 0 0
# 20 enet 100020 610 - - - - - 0 0
# 30 enet 100030 1500 - - - - - 0 0
# 1002 fddi 101002 1500 - - - - - 0 0
# 1003 tr 101003 1500 - - - - - 0 0
# 1004 fdnet 101004 1500 - - - ieee - 0 0
# 1005 trnet 101005 1500 - - - ibm - 0 0
#
# Remote SPAN VLANs
# ------------------------------------------------------------------------------
# 10
- name: Override device configuration of all VLANs with provided configuration
cisco.ios.ios_vlans:
config:
- name: Vlan_10
vlan_id: 10
mtu: 1000
state: overridden
# After state:
# ------------
#
# vios_l2#show vlan
# VLAN Name Status Ports
# ---- -------------------------------- --------- -------------------------------
# 1 default active Gi0/1, Gi0/2
# 10 Vlan_10 active
# 1002 fddi-default act/unsup
# 1003 token-ring-default act/unsup
# 1004 fddinet-default act/unsup
# 1005 trnet-default act/unsup
#
# VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
# ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
# 1 enet 100001 1500 - - - - - 0 0
# 10 enet 100010 1000 - - - - - 0 0
# 1002 fddi 101002 1500 - - - - - 0 0
# 1003 tr 101003 1500 - - - - - 0 0
# 1004 fdnet 101004 1500 - - - ieee - 0 0
# 1005 trnet 101005 1500 - - - ibm - 0 0
# Using replaced
# Before state:
# -------------
#
# vios_l2#show vlan
# VLAN Name Status Ports
# ---- -------------------------------- --------- -------------------------------
# 1 default active Gi0/1, Gi0/2
# 10 vlan_10 active
# 20 vlan_20 act/lshut
# 30 vlan_30 sus/lshut
# 1002 fddi-default act/unsup
# 1003 token-ring-default act/unsup
# 1004 fddinet-default act/unsup
# 1005 trnet-default act/unsup
#
# VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
# ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
# 1 enet 100001 1500 - - - - - 0 0
# 10 enet 100010 1500 - - - - - 0 0
# 20 enet 100020 610 - - - - - 0 0
# 30 enet 100030 1500 - - - - - 0 0
# 1002 fddi 101002 1500 - - - - - 0 0
# 1003 tr 101003 1500 - - - - - 0 0
# 1004 fdnet 101004 1500 - - - ieee - 0 0
# 1005 trnet 101005 1500 - - - ibm - 0 0
#
# Remote SPAN VLANs
# ------------------------------------------------------------------------------
# 10
- name: Replaces device configuration of listed VLANs with provided configuration
cisco.ios.ios_vlans:
config:
- vlan_id: 20
name: Test_VLAN20
mtu: 700
shutdown: disabled
- vlan_id: 30
name: Test_VLAN30
mtu: 1000
state: replaced
# After state:
# ------------
#
# vios_l2#show vlan
# VLAN Name Status Ports
# ---- -------------------------------- --------- -------------------------------
# 1 default active Gi0/1, Gi0/2
# 10 vlan_10 active
# 20 Test_VLAN20 active
# 30 Test_VLAN30 active
# 1002 fddi-default act/unsup
# 1003 token-ring-default act/unsup
# 1004 fddinet-default act/unsup
# 1005 trnet-default act/unsup
#
# VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
# ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
# 1 enet 100001 1500 - - - - - 0 0
# 10 enet 100010 1500 - - - - - 0 0
# 20 enet 100020 700 - - - - - 0 0
# 30 enet 100030 1000 - - - - - 0 0
# 1002 fddi 101002 1500 - - - - - 0 0
# 1003 tr 101003 1500 - - - - - 0 0
# 1004 fdnet 101004 1500 - - - ieee - 0 0
# 1005 trnet 101005 1500 - - - ibm - 0 0
#
# Remote SPAN VLANs
# ------------------------------------------------------------------------------
# 10
# Using deleted
# Before state:
# -------------
#
# vios_l2#show vlan
# VLAN Name Status Ports
# ---- -------------------------------- --------- -------------------------------
# 1 default active Gi0/1, Gi0/2
# 10 vlan_10 active
# 20 vlan_20 act/lshut
# 30 vlan_30 sus/lshut
# 1002 fddi-default act/unsup
# 1003 token-ring-default act/unsup
# 1004 fddinet-default act/unsup
# 1005 trnet-default act/unsup
#
# VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
# ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
# 1 enet 100001 1500 - - - - - 0 0
# 10 enet 100010 1500 - - - - - 0 0
# 20 enet 100020 610 - - - - - 0 0
# 30 enet 100030 1500 - - - - - 0 0
# 1002 fddi 101002 1500 - - - - - 0 0
# 1003 tr 101003 1500 - - - - - 0 0
# 1004 fdnet 101004 1500 - - - ieee - 0 0
# 1005 trnet 101005 1500 - - - ibm - 0 0
#
# Remote SPAN VLANs
# ------------------------------------------------------------------------------
# 10
- name: Delete attributes of given VLANs
cisco.ios.ios_vlans:
config:
- vlan_id: 10
- vlan_id: 20
state: deleted
# After state:
# -------------
#
# vios_l2#show vlan
# VLAN Name Status Ports
# ---- -------------------------------- --------- -------------------------------
# 1 default active Gi0/1, Gi0/2
# 30 vlan_30 sus/lshut
# 1002 fddi-default act/unsup
# 1003 token-ring-default act/unsup
# 1004 fddinet-default act/unsup
# 1005 trnet-default act/unsup
#
# VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
# ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
# 1 enet 100001 1500 - - - - - 0 0
# 30 enet 100030 1500 - - - - - 0 0
# 1002 fddi 101002 1500 - - - - - 0 0
# 1003 tr 101003 1500 - - - - - 0 0
# 1004 fdnet 101004 1500 - - - ieee - 0 0
# 1005 trnet 101005 1500 - - - ibm - 0 0
# Using Deleted without any config passed
#"(NOTE: This will delete all of configured vlans attributes)"
# Before state:
# -------------
#
# vios_l2#show vlan
# VLAN Name Status Ports
# ---- -------------------------------- --------- -------------------------------
# 1 default active Gi0/1, Gi0/2
# 10 vlan_10 active
# 20 vlan_20 act/lshut
# 30 vlan_30 sus/lshut
# 1002 fddi-default act/unsup
# 1003 token-ring-default act/unsup
# 1004 fddinet-default act/unsup
# 1005 trnet-default act/unsup
#
# VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
# ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
# 1 enet 100001 1500 - - - - - 0 0
# 10 enet 100010 1500 - - - - - 0 0
# 20 enet 100020 610 - - - - - 0 0
# 30 enet 100030 1500 - - - - - 0 0
# 1002 fddi 101002 1500 - - - - - 0 0
# 1003 tr 101003 1500 - - - - - 0 0
# 1004 fdnet 101004 1500 - - - ieee - 0 0
# 1005 trnet 101005 1500 - - - ibm - 0 0
#
# Remote SPAN VLANs
# ------------------------------------------------------------------------------
# 10
- name: Delete attributes of ALL VLANs
cisco.ios.ios_vlans:
state: deleted
# After state:
# -------------
#
# vios_l2#show vlan
# VLAN Name Status Ports
# ---- -------------------------------- --------- -------------------------------
# 1 default active Gi0/1, Gi0/2
# 1002 fddi-default act/unsup
# 1003 token-ring-default act/unsup
# 1004 fddinet-default act/unsup
# 1005 trnet-default act/unsup
#
# VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
# ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
# 1 enet 100001 1500 - - - - - 0 0
# 1002 fddi 101002 1500 - - - - - 0 0
# 1003 tr 101003 1500 - - - - - 0 0
# 1004 fdnet 101004 1500 - - - ieee - 0 0
# 1005 trnet 101005 1500 - - - ibm - 0 0
# Using Gathered
# Before state:
# -------------
#
# vios_l2#show vlan
# VLAN Name Status Ports
# ---- -------------------------------- --------- -------------------------------
# 1 default active Gi0/1, Gi0/2
# 10 vlan_10 active
# 20 vlan_20 act/lshut
# 30 vlan_30 sus/lshut
# 1002 fddi-default act/unsup
# 1003 token-ring-default act/unsup
# 1004 fddinet-default act/unsup
# 1005 trnet-default act/unsup
#
# VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
# ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
# 1 enet 100001 1500 - - - - - 0 0
# 10 enet 100010 1500 - - - - - 0 0
# 20 enet 100020 610 - - - - - 0 0
# 30 enet 100030 1500 - - - - - 0 0
# 1002 fddi 101002 1500 - - - - - 0 0
# 1003 tr 101003 1500 - - - - - 0 0
# 1004 fdnet 101004 1500 - - - ieee - 0 0
# 1005 trnet 101005 1500 - - - ibm - 0 0
#
# Remote SPAN VLANs
# ------------------------------------------------------------------------------
# 10
- name: Gather listed vlans with provided configurations
cisco.ios.ios_vlans:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "mtu": 1500,
# "name": "default",
# "shutdown": "disabled",
# "state": "active",
# "vlan_id": 1
# },
# {
# "mtu": 1500,
# "name": "VLAN0010",
# "shutdown": "disabled",
# "state": "active",
# "vlan_id": 10
# },
# {
# "mtu": 1500,
# "name": "VLAN0020",
# "shutdown": "disabled",
# "state": "active",
# "vlan_id": 20
# },
# {
# "mtu": 1500,
# "name": "VLAN0030",
# "shutdown": "disabled",
# "state": "active",
# "vlan_id": 30
# },
# {
# "mtu": 1500,
# "name": "fddi-default",
# "shutdown": "enabled",
# "state": "active",
# "vlan_id": 1002
# },
# {
# "mtu": 1500,
# "name": "token-ring-default",
# "shutdown": "enabled",
# "state": "active",
# "vlan_id": 1003
# },
# {
# "mtu": 1500,
# "name": "fddinet-default",
# "shutdown": "enabled",
# "state": "active",
# "vlan_id": 1004
# },
# {
# "mtu": 1500,
# "name": "trnet-default",
# "shutdown": "enabled",
# "state": "active",
# "vlan_id": 1005
# }
# ]
# After state:
# ------------
#
# vios_l2#show vlan
# VLAN Name Status Ports
# ---- -------------------------------- --------- -------------------------------
# 1 default active Gi0/1, Gi0/2
# 10 vlan_10 active
# 20 vlan_20 act/lshut
# 30 vlan_30 sus/lshut
# 1002 fddi-default act/unsup
# 1003 token-ring-default act/unsup
# 1004 fddinet-default act/unsup
# 1005 trnet-default act/unsup
#
# VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
# ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
# 1 enet 100001 1500 - - - - - 0 0
# 10 enet 100010 1500 - - - - - 0 0
# 20 enet 100020 610 - - - - - 0 0
# 30 enet 100030 1500 - - - - - 0 0
# 1002 fddi 101002 1500 - - - - - 0 0
# 1003 tr 101003 1500 - - - - - 0 0
# 1004 fdnet 101004 1500 - - - ieee - 0 0
# 1005 trnet 101005 1500 - - - ibm - 0 0
#
# Remote SPAN VLANs
# ------------------------------------------------------------------------------
# 10
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_vlans:
config:
- name: Vlan_10
vlan_id: 10
state: active
shutdown: disabled
remote_span: true
- name: Vlan_20
vlan_id: 20
mtu: 610
state: active
shutdown: enabled
- name: Vlan_30
vlan_id: 30
state: suspend
shutdown: enabled
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "vlan 10",
# "name Vlan_10",
# "state active",
# "remote-span",
# "no shutdown",
# "vlan 20",
# "name Vlan_20",
# "state active",
# "mtu 610",
# "shutdown",
# "vlan 30",
# "name Vlan_30",
# "state suspend",
# "shutdown"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# VLAN Name Status Ports
# ---- -------------------------------- --------- -------------------------------
# 1 default active Gi0/1, Gi0/2
# 10 vlan_10 active
# 20 vlan_20 act/lshut
# 30 vlan_30 sus/lshut
# 1002 fddi-default act/unsup
# 1003 token-ring-default act/unsup
# 1004 fddinet-default act/unsup
# 1005 trnet-default act/unsup
#
# VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
# ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
# 1 enet 100001 1500 - - - - - 0 0
# 10 enet 100010 1500 - - - - - 0 0
# 20 enet 100020 1500 - - - - - 0 0
# 30 enet 100030 1500 - - - - - 0 0
# 1002 fddi 101002 1500 - - - - - 0 0
# 1003 tr 101003 1500 - - - - - 0 0
# 1004 fdnet 101004 1500 - - - ieee - 0 0
# 1005 trnet 101005 1500 - - - ibm - 0 0
- name: Parse the commands for provided configuration
cisco.ios.ios_vlans:
running_config: "{{ lookup('file', './parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "mtu": 1500,
# "name": "default",
# "shutdown": "disabled",
# "state": "active",
# "vlan_id": 1
# },
# {
# "mtu": 1500,
# "name": "vlan_10",
# "shutdown": "disabled",
# "state": "active",
# "vlan_id": 10
# },
# {
# "mtu": 1500,
# "name": "vlan_20",
# "shutdown": "enabled",
# "state": "active",
# "vlan_id": 20
# },
# {
# "mtu": 1500,
# "name": "vlan_30",
# "shutdown": "enabled",
# "state": "suspend",
# "vlan_id": 30
# },
# {
# "mtu": 1500,
# "name": "fddi-default",
# "shutdown": "enabled",
# "state": "active",
# "vlan_id": 1002
# },
# {
# "mtu": 1500,
# "name": "token-ring-default",
# "shutdown": "enabled",
# "state": "active",
# "vlan_id": 1003
# },
# {
# "mtu": 1500,
# "name": "fddinet-default",
# "shutdown": "enabled",
# "state": "active",
# "vlan_id": 1004
# },
# {
# "mtu": 1500,
# "name": "trnet-default",
# "shutdown": "enabled",
# "state": "active",
# "vlan_id": 1005
# }
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device. **Sample:** ['vlan 20', 'name vlan\_20', 'mtu 600', 'remote-span'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ios.ios_l2_interface β (deprecated, removed after 2022-06-01) Manage Layer-2 interface on Cisco IOS devices. cisco.ios.ios\_l2\_interface β (deprecated, removed after 2022-06-01) Manage Layer-2 interface on Cisco IOS devices.
====================================================================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_l2_interface`.
New in version 1.0.0: of cisco.ios
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Newer and updated modules released with more functionality in Ansible 2.9
Alternative
ios\_l2\_interfaces
Synopsis
--------
* This module provides declarative management of Layer-2 interfaces on Cisco IOS devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_vlan** string | | Configure given VLAN in access port. If `mode=access`, used as the access VLAN ID. |
| **aggregate** list / elements=dictionary | | List of Layer-2 interface definitions. |
| | **access\_vlan** string | | Configure given VLAN in access port. If `mode=access`, used as the access VLAN ID. |
| | **mode** string | **Choices:*** access
* trunk
| Mode in which interface needs to be configured. |
| | **name** string | | Full name of the interface excluding any logical unit number, i.e. GigabitEthernet0/1.
aliases: interface |
| | **native\_vlan** string | | Native VLAN to be configured in trunk port. If `mode=trunk`, used as the trunk native VLAN ID. |
| | **state** string | **Choices:*** present
* absent
* unconfigured
| Manage the state of the Layer-2 Interface configuration. |
| | **trunk\_allowed\_vlans** string | | List of allowed VLANs in a given trunk port. If `mode=trunk`, these are the only VLANs that will be configured on the trunk, i.e. "2-10,15". |
| | **trunk\_vlans** string | | List of VLANs to be configured in trunk port. If `mode=trunk`, used as the VLAN range to ADD or REMOVE from the trunk. |
| **mode** string | **Choices:*** access
* trunk
| Mode in which interface needs to be configured. |
| **name** string | | Full name of the interface excluding any logical unit number, i.e. GigabitEthernet0/1.
aliases: interface |
| **native\_vlan** string | | Native VLAN to be configured in trunk port. If `mode=trunk`, used as the trunk native VLAN ID. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **state** string | **Choices:*** **present** β
* absent
* unconfigured
| Manage the state of the Layer-2 Interface configuration. |
| **trunk\_allowed\_vlans** string | | List of allowed VLANs in a given trunk port. If `mode=trunk`, these are the only VLANs that will be configured on the trunk, i.e. "2-10,15". |
| **trunk\_vlans** string | | List of VLANs to be configured in trunk port. If `mode=trunk`, used as the VLAN range to ADD or REMOVE from the trunk. |
Notes
-----
Note
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: Ensure GigabitEthernet0/5 is in its default l2 interface state
ios.ios_l2_interface:
name: GigabitEthernet0/5
state: unconfigured
- name: Ensure GigabitEthernet0/5 is configured for access vlan 20
ios.ios_l2_interface:
name: GigabitEthernet0/5
mode: access
access_vlan: 20
- name: Ensure GigabitEthernet0/5 only has vlans 5-10 as trunk vlans
ios.ios_l2_interface:
name: GigabitEthernet0/5
mode: trunk
native_vlan: 10
trunk_allowed_vlans: 5-10
- name: Ensure GigabitEthernet0/5 is a trunk port and ensure 2-50 are being tagged
(doesn't mean others aren't also being tagged)
ios.ios_l2_interface:
name: GigabitEthernet0/5
mode: trunk
native_vlan: 10
trunk_vlans: 2-50
- name: Ensure these VLANs are not being tagged on the trunk
ios.ios_l2_interface:
name: GigabitEthernet0/5
mode: trunk
trunk_vlans: 51-4094
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['interface GigabitEthernet0/5', 'switchport access vlan 20'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Nathaniel Case (@Qalthos)
ansible cisco.ios.ios β Use ios cliconf to run command on Cisco IOS platform cisco.ios.ios β Use ios cliconf to run command on Cisco IOS platform
====================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
Synopsis
--------
* This ios plugin provides low level abstraction apis for sending and receiving CLI commands from Cisco IOS network devices.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **config\_commands** list / elements=string added in 2.0.0 of cisco.ios | **Default:**[] | var: ansible\_ios\_config\_commands | Specifies a list of commands that can make configuration changes to the target device. When `ansible\_network\_single\_user\_mode` is enabled, if a command sent to the device is present in this list, the existing cache is invalidated. |
### Authors
* Ansible Networking Team
ansible cisco.ios.ios_l2_interfaces β L2 interfaces resource module cisco.ios.ios\_l2\_interfaces β L2 interfaces resource module
=============================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_l2_interfaces`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of Layer-2 interface on Cisco IOS devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A dictionary of Layer-2 interface options |
| | **access** dictionary | | Switchport mode access command to configure the interface as a layer 2 access. |
| | | **vlan** integer | | Configure given VLAN in access port. It's used as the access VLAN ID. |
| | **mode** string | **Choices:*** access
* trunk
| Mode in which interface needs to be configured. An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode. |
| | **name** string / required | | Full name of the interface excluding any logical unit number, i.e. GigabitEthernet0/1. |
| | **trunk** dictionary | | Switchport mode trunk command to configure the interface as a Layer 2 trunk. Note The encapsulation is always set to dot1q. |
| | | **allowed\_vlans** list / elements=string | | List of allowed VLANs in a given trunk port. These are the only VLANs that will be configured on the trunk. |
| | | **encapsulation** string | **Choices:*** dot1q
* isl
* negotiate
| Trunking encapsulation when interface is in trunking mode. |
| | | **native\_vlan** integer | | Native VLAN to be configured in trunk port. It's used as the trunk native VLAN ID. |
| | | **pruning\_vlans** list / elements=string | | Pruning VLAN to be configured in trunk port. It's used as the trunk pruning VLAN ID. |
| | **voice** dictionary | | Switchport mode voice command to configure the interface with a voice vlan. |
| | | **vlan** integer | | Configure given voice VLAN on access port. It's used as the voice VLAN ID. |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **show running-config | section ^interface**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* rendered
* gathered
* parsed
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL.
Examples
--------
```
# Using merged
# Before state:
# -------------
#
# viosl2#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# negotiation auto
# interface GigabitEthernet0/2
# description This is test
# switchport access vlan 20
# media-type rj45
# negotiation auto
- name: Merge provided configuration with device configuration
cisco.ios.ios_l2_interfaces:
config:
- name: GigabitEthernet0/1
mode: access
access:
vlan: 10
voice:
vlan: 40
- name: GigabitEthernet0/2
mode: trunk
trunk:
allowed_vlans: 10-20,40
native_vlan: 20
pruning_vlans: 10,20
encapsulation: dot1q
state: merged
# After state:
# ------------
#
# viosl2#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# switchport access vlan 10
# switchport voice vlan 40
# switchport mode access
# negotiation auto
# interface GigabitEthernet0/2
# description This is test
# switchport trunk allowed vlan 10-20,40
# switchport trunk encapsulation dot1q
# switchport trunk native vlan 20
# switchport trunk pruning vlan 10,20
# switchport mode trunk
# media-type rj45
# negotiation auto
# Using replaced
# Before state:
# -------------
#
# viosl2#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# switchport access vlan 20
# negotiation auto
# interface GigabitEthernet0/2
# description This is test
# switchport access vlan 20
# media-type rj45
# negotiation auto
- name: Replaces device configuration of listed l2 interfaces with provided configuration
cisco.ios.ios_l2_interfaces:
config:
- name: GigabitEthernet0/2
trunk:
allowed_vlans: 20-25,40
native_vlan: 20
pruning_vlans: 10
encapsulation: isl
state: replaced
# After state:
# -------------
#
# viosl2#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# switchport access vlan 20
# negotiation auto
# interface GigabitEthernet0/2
# description This is test
# switchport trunk allowed vlan 20-25,40
# switchport trunk encapsulation isl
# switchport trunk native vlan 20
# switchport trunk pruning vlan 10
# media-type rj45
# negotiation auto
# Using overridden
# Before state:
# -------------
#
# viosl2#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# switchport trunk encapsulation dot1q
# switchport trunk native vlan 20
# negotiation auto
# interface GigabitEthernet0/2
# description This is test
# switchport access vlan 20
# switchport trunk encapsulation dot1q
# switchport trunk native vlan 20
# media-type rj45
# negotiation auto
- name: Override device configuration of all l2 interfaces with provided configuration
cisco.ios.ios_l2_interfaces:
config:
- name: GigabitEthernet0/2
access:
vlan: 20
voice:
vlan: 40
state: overridden
# After state:
# -------------
#
# viosl2#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# negotiation auto
# interface GigabitEthernet0/2
# description This is test
# switchport access vlan 20
# switchport voice vlan 40
# media-type rj45
# negotiation auto
# Using Deleted
# Before state:
# -------------
#
# viosl2#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# switchport access vlan 20
# negotiation auto
# interface GigabitEthernet0/2
# description This is test
# switchport access vlan 20
# switchport trunk allowed vlan 20-40,60,80
# switchport trunk encapsulation dot1q
# switchport trunk native vlan 10
# switchport trunk pruning vlan 10
# media-type rj45
# negotiation auto
- name: Delete IOS L2 interfaces as in given arguments
cisco.ios.ios_l2_interfaces:
config:
- name: GigabitEthernet0/1
state: deleted
# After state:
# -------------
#
# viosl2#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# negotiation auto
# interface GigabitEthernet0/2
# description This is test
# switchport access vlan 20
# switchport trunk allowed vlan 20-40,60,80
# switchport trunk encapsulation dot1q
# switchport trunk native vlan 10
# switchport trunk pruning vlan 10
# media-type rj45
# negotiation auto
# Using Deleted without any config passed
#"(NOTE: This will delete all of configured resource module attributes from each configured interface)"
# Before state:
# -------------
#
# viosl2#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# switchport access vlan 20
# negotiation auto
# interface GigabitEthernet0/2
# description This is test
# switchport access vlan 20
# switchport trunk allowed vlan 20-40,60,80
# switchport trunk encapsulation dot1q
# switchport trunk native vlan 10
# switchport trunk pruning vlan 10
# media-type rj45
# negotiation auto
- name: Delete IOS L2 interfaces as in given arguments
cisco.ios.ios_l2_interfaces:
state: deleted
# After state:
# -------------
#
# viosl2#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# negotiation auto
# interface GigabitEthernet0/2
# description This is test
# media-type rj45
# negotiation auto
# Using Gathered
# Before state:
# -------------
#
# vios#sh running-config | section ^interface
# interface GigabitEthernet0/1
# switchport access vlan 10
# interface GigabitEthernet0/2
# switchport trunk allowed vlan 10-20,40
# switchport trunk encapsulation dot1q
# switchport trunk native vlan 10
# switchport trunk pruning vlan 10,20
# switchport mode trunk
- name: Gather listed l2 interfaces with provided configurations
cisco.ios.ios_l2_interfaces:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "name": "GigabitEthernet0/0"
# },
# {
# "access": {
# "vlan": 10
# },
# "name": "GigabitEthernet0/1"
# },
# {
# "mode": "trunk",
# "name": "GigabitEthernet0/2",
# "trunk": {
# "allowed_vlans": [
# "10-20",
# "40"
# ],
# "encapsulation": "dot1q",
# "native_vlan": 10,
# "pruning_vlans": [
# "10",
# "20"
# ]
# }
# }
# ]
# After state:
# ------------
#
# vios#sh running-config | section ^interface
# interface GigabitEthernet0/1
# switchport access vlan 10
# interface GigabitEthernet0/2
# switchport trunk allowed vlan 10-20,40
# switchport trunk encapsulation dot1q
# switchport trunk native vlan 10
# switchport trunk pruning vlan 10,20
# switchport mode trunk
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_l2_interfaces:
config:
- name: GigabitEthernet0/1
access:
vlan: 30
- name: GigabitEthernet0/2
trunk:
allowed_vlans: 10-20,40
native_vlan: 20
pruning_vlans: 10,20
encapsulation: dot1q
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "interface GigabitEthernet0/1",
# "switchport access vlan 30",
# "interface GigabitEthernet0/2",
# "switchport trunk encapsulation dot1q",
# "switchport trunk native vlan 20",
# "switchport trunk allowed vlan 10-20,40",
# "switchport trunk pruning vlan 10,20"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# interface GigabitEthernet0/1
# switchport mode access
# switchport access vlan 30
# interface GigabitEthernet0/2
# switchport trunk allowed vlan 15-20,40
# switchport trunk encapsulation dot1q
# switchport trunk native vlan 20
# switchport trunk pruning vlan 10,20
- name: Parse the commands for provided configuration
cisco.ios.ios_l2_interfaces:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "access": {
# "vlan": 30
# },
# "mode": "access",
# "name": "GigabitEthernet0/1"
# },
# {
# "name": "GigabitEthernet0/2",
# "trunk": {
# "allowed_vlans": [
# "15-20",
# "40"
# ],
# "encapsulation": "dot1q",
# "native_vlan": 20,
# "pruning_vlans": [
# "10",
# "20"
# ]
# }
# }
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device **Sample:** ['interface GigabitEthernet0/1', 'switchport access vlan 20'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ios.ios_route_maps β Route maps resource module cisco.ios.ios\_route\_maps β Route maps resource module
=======================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_route_maps`.
New in version 2.1.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module configures and manages the attributes of Route maps on Cisco IOS.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A list of configurations for Route maps. |
| | **entries** list / elements=dictionary | | A list of configurations entries for Route maps. |
| | | **action** string | **Choices:*** deny
* permit
| Route map set operations |
| | | **continue\_entry** dictionary | | Continue on a different entry within the route-map |
| | | | **entry\_sequence** integer | | Route-map entry sequence number Please refer vendor documentation for valid values |
| | | | **set** boolean | **Choices:*** no
* yes
| Set continue |
| | | **description** string | | Route-map comment |
| | | **match** dictionary | | Match values from routing table |
| | | | **additional\_paths** dictionary | | BGP Add-Path match policie BGP Add-Path advertise-set policy |
| | | | | **all** boolean | **Choices:*** no
* yes
| BGP Add-Path advertise all paths |
| | | | | **best** integer | | BGP Add-Path advertise best n paths (1-3) |
| | | | | **best\_range** dictionary | | BGP Add-Path advertise best paths (range m to n) |
| | | | | | **lower\_limit** integer | | BGP Add-Path best paths to advertise (lower limit) (1-3) |
| | | | | | **upper\_limit** integer | | BGP Add-Path best paths to advertise (upper limit) (1-3) |
| | | | | **group\_best** boolean | **Choices:*** no
* yes
| BGP Add-Path advertise group-best path |
| | | | **as\_path** dictionary | | Match BGP AS path list |
| | | | | **acls** list / elements=integer | | AS path access-list Please refer vendor documentation for valid values |
| | | | | **set** boolean | **Choices:*** no
* yes
| Set AS path list |
| | | | **clns** dictionary | | CLNS information |
| | | | | **address** string | | Match address of route or match packet |
| | | | | **next\_hop** string | | Match next-hop address of route |
| | | | | **route\_source** string | | Match advertising source address of route |
| | | | **community** dictionary | | Match BGP community list |
| | | | | **exact\_match** boolean | **Choices:*** no
* yes
| Do exact matching of communities |
| | | | | **name** list / elements=string | | Community-list number/Community-list name Please refer vendor documentation for valid values |
| | | | **extcommunity** list / elements=string | | Match BGP/VPN extended community list Extended community-list number Please refer vendor documentation for valid values |
| | | | **interfaces** list / elements=string | | Match first hop interface of route |
| | | | **ip** dictionary | | IP specific information |
| | | | | **address** dictionary | | Match address of route or match packet |
| | | | | | **acls** list / elements=string | | Match entries of acl IP acl name/number Please refer vendor documentation for valid values |
| | | | | | **prefix\_lists** list / elements=string | | Match entries of prefix-lists IP prefix-list name |
| | | | | **flowspec** dictionary | | Match src/dest prefix component of flowspec prefix |
| | | | | | **acls** list / elements=string | | Match entries of acl IP acl name/number Please refer vendor documentation for valid values |
| | | | | | **dest\_pfx** boolean | **Choices:*** no
* yes
| Match dest prefix component of flowspec prefix |
| | | | | | **prefix\_lists** list / elements=string | | Match entries of prefix-lists IP prefix-list name |
| | | | | | **src\_pfx** boolean | **Choices:*** no
* yes
| Match source prefix component of flowspec prefix |
| | | | | **next\_hop** dictionary | | Match next-hop address of route |
| | | | | | **acls** list / elements=string | | Match entries of acl IP acl name/number Please refer vendor documentation for valid values |
| | | | | | **prefix\_lists** list / elements=string | | Match entries of prefix-lists IP prefix-list name |
| | | | | | **set** boolean | **Choices:*** no
* yes
| Set next-hop address |
| | | | | **redistribution\_source** dictionary | | route redistribution source (EIGRP only) |
| | | | | | **acls** list / elements=string | | Match entries of acl IP acl name/number Please refer vendor documentation for valid values |
| | | | | | **prefix\_lists** list / elements=string | | Match entries of prefix-lists IP prefix-list name |
| | | | | | **set** boolean | **Choices:*** no
* yes
| Set redistribution-source |
| | | | | **route\_source** dictionary | | Match advertising source address of route |
| | | | | | **acls** list / elements=string | | Match entries of acl IP acl name/number Please refer vendor documentation for valid values |
| | | | | | **prefix\_lists** list / elements=string | | Match entries of prefix-lists IP prefix-list name |
| | | | | | **redistribution\_source** boolean | **Choices:*** no
* yes
| route redistribution source (EIGRP only) |
| | | | | | **set** boolean | **Choices:*** no
* yes
| Set redistribution-source |
| | | | **ipv6** dictionary | | IPv6 specific information |
| | | | | **address** dictionary | | Match address of route or match packet |
| | | | | | **acl** string | | IPv6 access-list name |
| | | | | | **prefix\_list** string | | IPv6 prefix-list name |
| | | | | **flowspec** dictionary | | Match next-hop address of route |
| | | | | | **acl** string | | IPv6 access-list name |
| | | | | | **dest\_pfx** boolean | **Choices:*** no
* yes
| Match dest prefix component of flowspec prefix |
| | | | | | **prefix\_list** string | | IPv6 prefix-list name |
| | | | | | **src\_pfx** boolean | **Choices:*** no
* yes
| Match source prefix component of flowspec prefix |
| | | | | **next\_hop** dictionary | | Match next-hop address of route |
| | | | | | **acl** string | | IPv6 access-list name |
| | | | | | **prefix\_list** string | | IPv6 prefix-list name |
| | | | | **route\_source** dictionary | | Match advertising source address of route |
| | | | | | **acl** string | | IPv6 access-list name |
| | | | | | **prefix\_list** string | | IPv6 prefix-list name |
| | | | **length** dictionary | | Packet length |
| | | | | **maximum** integer | | Maximum packet length Please refer vendor documentation for valid values |
| | | | | **minimum** integer | | Minimum packet length Please refer vendor documentation for valid values |
| | | | **local\_preference** dictionary | | Local preference for route |
| | | | | **set** boolean | **Choices:*** no
* yes
| Set the Local preference for route |
| | | | | **value** list / elements=string | | Local preference value Please refer vendor documentation for valid values |
| | | | **mdt\_group** dictionary | | Match routes corresponding to MDT group |
| | | | | **acls** list / elements=string | | IP access-list number/IP standard access-list name Please refer vendor documentation for valid values |
| | | | | **set** boolean | **Choices:*** no
* yes
| Set and Match routes corresponding to MDT group |
| | | | **metric** dictionary | | Match metric of route |
| | | | | **deviation** boolean | **Choices:*** no
* yes
| Deviation option to match metric in a range |
| | | | | **deviation\_value** integer | | deviation value, 500 +- 10 creates the range 490 - 510 Please refer vendor documentation for valid values |
| | | | | **external** boolean | **Choices:*** no
* yes
| Match route using external protocol metric |
| | | | | **value** integer | | Metric value Please refer vendor documentation for valid values |
| | | | **mpls\_label** boolean | **Choices:*** no
* yes
| Match routes which have MPLS labels |
| | | | **policy\_lists** list / elements=string | | Match IP policy list |
| | | | **route\_type** dictionary | | Match route-type of route |
| | | | | **external** dictionary | | external route (BGP, EIGRP and OSPF type 1/2) |
| | | | | | **set** boolean | **Choices:*** no
* yes
| Set external route |
| | | | | | **type\_1** boolean | **Choices:*** no
* yes
| OSPF external type 1 route |
| | | | | | **type\_2** boolean | **Choices:*** no
* yes
| OSPF external type 2 route |
| | | | | **internal** boolean | **Choices:*** no
* yes
| internal route (including OSPF intra/inter area) |
| | | | | **level\_1** boolean | **Choices:*** no
* yes
| IS-IS level-1 route |
| | | | | **level\_2** boolean | **Choices:*** no
* yes
| IS-IS level-2 route |
| | | | | **local** boolean | **Choices:*** no
* yes
| locally generated route |
| | | | | **nssa\_external** dictionary | | nssa-external route (OSPF type 1/2) |
| | | | | | **set** boolean | **Choices:*** no
* yes
| Set nssa-external route |
| | | | | | **type\_1** boolean | **Choices:*** no
* yes
| OSPF external type 1 route |
| | | | | | **type\_2** boolean | **Choices:*** no
* yes
| OSPF external type 2 route |
| | | | **rpki** dictionary | | Match RPKI state of route |
| | | | | **invalid** boolean | **Choices:*** no
* yes
| RPKI Invalid State |
| | | | | **not\_found** boolean | **Choices:*** no
* yes
| RPKI Not Found State |
| | | | | **valid** boolean | **Choices:*** no
* yes
| RPKI Valid State |
| | | | **security\_group** dictionary | | Security Group |
| | | | | **destination** list / elements=integer | | Destination Security Group, destination Security tag Please refer vendor documentation for valid values |
| | | | | **source** list / elements=integer | | Source Security Group, source Security tag Please refer vendor documentation for valid values |
| | | | **source\_protocol** dictionary | | Match source-protocol of route |
| | | | | **bgp** string | | Border Gateway Protocol (BGP) Autonomous system number Please refer vendor documentation for valid values |
| | | | | **connected** boolean | **Choices:*** no
* yes
| Connected |
| | | | | **eigrp** integer | | Enhanced Interior Gateway Routing Protocol (EIGRP) Autonomous system number Please refer vendor documentation for valid values |
| | | | | **isis** boolean | **Choices:*** no
* yes
| ISO IS-IS |
| | | | | **lisp** boolean | **Choices:*** no
* yes
| Locator ID Separation Protocol (LISP) |
| | | | | **mobile** boolean | **Choices:*** no
* yes
| Mobile routes |
| | | | | **ospf** integer | | Open Shortest Path First (OSPF) Process ID Please refer vendor documentation for valid values |
| | | | | **ospfv3** integer | | OSPFv3 Process ID Please refer vendor documentation for valid values |
| | | | | **rip** boolean | **Choices:*** no
* yes
| Routing Information Protocol (RIP) |
| | | | | **static** boolean | **Choices:*** no
* yes
| Static routes |
| | | | **tag** dictionary | | Match tag of route |
| | | | | **tag\_list** list / elements=string | | Route Tag List/Tag list name |
| | | | | **value** list / elements=string | | Tag value/Tag in Dotted Decimal eg, 10.10.10.10 |
| | | | **track** integer | | tracking object |
| | | **sequence** integer | | Sequence to insert to/delete from existing route-map entry Please refer vendor documentation for valid values |
| | | **set** dictionary | | Match source-protocol of route |
| | | | **aigp\_metric** dictionary | | accumulated metric value |
| | | | | **igp\_metric** boolean | **Choices:*** no
* yes
| metric value from rib |
| | | | | **value** integer | | manual value |
| | | | **as\_path** dictionary | | Prepend string for a BGP AS-path attribute |
| | | | | **prepend** dictionary | | Prepend to the as-path |
| | | | | | **as\_number** list / elements=string | | AS number Please refer vendor documentation for valid values |
| | | | | | **last\_as** integer | | Prepend last AS to the as-path Number of last-AS prepends Please refer vendor documentation for valid values |
| | | | | **tag** boolean | **Choices:*** no
* yes
| Set the tag as an AS-path attribute |
| | | | **automatic\_tag** boolean | **Choices:*** no
* yes
| Automatically compute TAG value |
| | | | **clns** string | | OSI summary address Next hop address CLNS summary prefix |
| | | | **comm\_list** string | | set BGP community list (for deletion) Community-list name/number Delete matching communities |
| | | | **community** dictionary | | BGP community attribute |
| | | | | **additive** boolean | **Choices:*** no
* yes
| Add to the existing community |
| | | | | **gshut** boolean | **Choices:*** no
* yes
| Graceful Shutdown (well-known community) |
| | | | | **internet** boolean | **Choices:*** no
* yes
| Internet (well-known community) |
| | | | | **local\_as** boolean | **Choices:*** no
* yes
| Do not send outside local AS (well-known community) |
| | | | | **no\_advertise** boolean | **Choices:*** no
* yes
| Do not advertise to any peer (well-known community) |
| | | | | **no\_export** boolean | **Choices:*** no
* yes
| Do not export to next AS (well-known community) |
| | | | | **none** boolean | **Choices:*** no
* yes
| No community attribute |
| | | | | **number** string | | community number community number in aa:nn format Please refer vendor documentation for valid values |
| | | | **dampening** dictionary | | Set BGP route flap dampening parameters |
| | | | | **max\_suppress** integer | | Maximum duration to suppress a stable route Please refer vendor documentation for valid values |
| | | | | **penalty\_half\_time** integer | | half-life time for the penalty Please refer vendor documentation for valid values |
| | | | | **reuse\_route\_val** integer | | Penalty to start reusing a route Please refer vendor documentation for valid values |
| | | | | **suppress\_route\_val** integer | | Penalty to start suppressing a route Please refer vendor documentation for valid values |
| | | | **default** string | | Set default information Default output interface |
| | | | **extcomm\_list** string | | Set BGP/VPN extended community list (for deletion) Extended community-list number/name Delete matching extended communities |
| | | | **extcommunity** dictionary | | BGP extended community attribute |
| | | | | **cost** dictionary | | Cost extended community |
| | | | | | **cost\_value** integer | | Cost Value (No-preference Cost = 2147483647) Please refer vendor documentation for valid values |
| | | | | | **id** string | | Community ID Please refer vendor documentation for valid values |
| | | | | | **igp** boolean | **Choices:*** no
* yes
| Compare following IGP cost comparison |
| | | | | | **pre\_bestpath** boolean | **Choices:*** no
* yes
| Compare before all other steps in bestpath calculation |
| | | | | **rt** dictionary | | Route Target extended community |
| | | | | | **additive** boolean | **Choices:*** no
* yes
| Add to the existing extcommunity |
| | | | | | **address** string | | VPN extended community |
| | | | | | **range** dictionary | | Specify a range of extended community |
| | | | | | | **lower\_limit** string | | VPN extended community |
| | | | | | | **upper\_limit** string | | VPN extended community |
| | | | | **soo** string | | Site-of-Origin extended community |
| | | | | **vpn\_distinguisher** dictionary | | VPN Distinguisher |
| | | | | | **additive** boolean | **Choices:*** no
* yes
| Add to the existing extcommunity |
| | | | | | **address** string | | VPN extended community |
| | | | | | **range** dictionary | | Specify a range of extended community |
| | | | | | | **lower\_limit** string | | VPN extended community |
| | | | | | | **upper\_limit** string | | VPN extended community |
| | | | **global\_route** boolean | **Choices:*** no
* yes
| Set to global routing table |
| | | | **interfaces** list / elements=string | | Output interface |
| | | | **ip** dictionary | | IP specific information |
| | | | | **address** string | | Specify IP address Prefix-list name to set ip address |
| | | | | **df** integer | **Choices:*** 0
* 1
| Set DF bit |
| | | | | **global\_route** dictionary | | global routing table |
| | | | | | **address** string | | IP address of next hop |
| | | | | | **verify\_availability** dictionary | | Verify if nexthop is reachable |
| | | | | | | **address** string | | IP address of next hop |
| | | | | | | **sequence** integer | | Sequence to insert into next-hop list Please refer vendor documentation for valid values |
| | | | | | | **track** integer | | Set the next hop depending on the state of a tracked object tracked object number Please refer vendor documentation for valid values |
| | | | | **next\_hop** dictionary | | Next hop address |
| | | | | | **address** string | | IP address of next hop |
| | | | | | **dynamic** boolean | **Choices:*** no
* yes
| application dynamically sets next hop DHCP learned next hop |
| | | | | | **encapsulate** string | | Encapsulation profile for VPN nexthop L3VPN Encapsulation profile name |
| | | | | | **peer\_address** boolean | **Choices:*** no
* yes
| Use peer address (for BGP only) |
| | | | | | **recursive** dictionary | | Recursive next-hop |
| | | | | | | **address** string | | IP address of recursive next hop |
| | | | | | | **global\_route** boolean | **Choices:*** no
* yes
| global routing table |
| | | | | | | **vrf** string | | VRF |
| | | | | | **self** boolean | **Choices:*** no
* yes
| Use self address (for BGP only) |
| | | | | | **verify\_availability** dictionary | | Verify if nexthop is reachable |
| | | | | | | **address** string | | IP address of next hop |
| | | | | | | **sequence** integer | | Sequence to insert into next-hop list Please refer vendor documentation for valid values |
| | | | | | | **set** boolean | **Choices:*** no
* yes
| Set and Verify if nexthop is reachable |
| | | | | | | **track** integer | | Set the next hop depending on the state of a tracked object tracked object number Please refer vendor documentation for valid values |
| | | | | **precedence** dictionary | | Set precedence field |
| | | | | | **critical** boolean | **Choices:*** no
* yes
| Set critical precedence (5) |
| | | | | | **flash** boolean | **Choices:*** no
* yes
| Set flash precedence (3) |
| | | | | | **flash\_override** boolean | **Choices:*** no
* yes
| Set flash override precedence (4) |
| | | | | | **immediate** boolean | **Choices:*** no
* yes
| Set immediate precedence (2) |
| | | | | | **internet** boolean | **Choices:*** no
* yes
| Set internetwork control precedence (6) |
| | | | | | **network** boolean | **Choices:*** no
* yes
| Set network control precedence (7) |
| | | | | | **priority** boolean | **Choices:*** no
* yes
| Set priority precedence (1) |
| | | | | | **routine** boolean | **Choices:*** no
* yes
| Set routine precedence (0) |
| | | | | | **set** boolean | **Choices:*** no
* yes
| Just set precedence field |
| | | | | **qos\_group** integer | | Set QOS Group ID Please refer vendor documentation for valid values |
| | | | | **tos** dictionary | | Set type of service field |
| | | | | | **max\_reliability** boolean | **Choices:*** no
* yes
| Set max reliable TOS (2) |
| | | | | | **max\_throughput** boolean | **Choices:*** no
* yes
| Set max throughput TOS (4) |
| | | | | | **min\_delay** boolean | **Choices:*** no
* yes
| Set min delay TOS (8) |
| | | | | | **min\_monetary\_cost** boolean | **Choices:*** no
* yes
| Set min monetary cost TOS (1) |
| | | | | | **normal** boolean | **Choices:*** no
* yes
| Set normal TOS (0) |
| | | | | | **set** boolean | **Choices:*** no
* yes
| Just set type of service field |
| | | | | **vrf** dictionary | | VRF |
| | | | | | **address** string | | IP address of next hop |
| | | | | | **name** string | | VRF name |
| | | | | | **verify\_availability** dictionary | | Verify if nexthop is reachable |
| | | | | | | **address** string | | IP address of next hop |
| | | | | | | **sequence** integer | | Sequence to insert into next-hop list Please refer vendor documentation for valid values |
| | | | | | | **set** boolean | **Choices:*** no
* yes
| Set and Verify if nexthop is reachable |
| | | | | | | **track** integer | | Set the next hop depending on the state of a tracked object tracked object number Please refer vendor documentation for valid values |
| | | | **ipv6** dictionary | | IPv6 specific information |
| | | | | **address** string | | IPv6 address IPv6 prefix-list |
| | | | | **default** boolean | **Choices:*** no
* yes
| Set default information |
| | | | | **global\_route** dictionary | | global routing table |
| | | | | | **address** string | | Next hop address (X:X:X:X::X) |
| | | | | | **verify\_availability** dictionary | | Verify if nexthop is reachable |
| | | | | | | **address** string | | Next hop address (X:X:X:X::X) |
| | | | | | | **sequence** integer | | Sequence to insert into next-hop list Please refer vendor documentation for valid values |
| | | | | | | **track** integer | | Set the next hop depending on the state of a tracked object tracked object number Please refer vendor documentation for valid values |
| | | | | **next\_hop** dictionary | | IPv6 Next hop |
| | | | | | **address** string | | Next hop address (X:X:X:X::X) |
| | | | | | **encapsulate** string | | Encapsulation profile for VPN nexthop L3VPN Encapsulation profile name |
| | | | | | **peer\_address** boolean | **Choices:*** no
* yes
| Use peer address (for BGP only) |
| | | | | | **recursive** string | | Recursive next-hop IPv6 address of recursive next-hop |
| | | | | **precedence** integer | | Set precedence field Precedence value Please refer vendor documentation for valid values |
| | | | | **vrf** dictionary | | VRF name |
| | | | | | **name** string | | VRF name |
| | | | | | **verify\_availability** dictionary | | Verify if nexthop is reachable |
| | | | | | | **address** string | | IPv6 address of next hop |
| | | | | | | **sequence** integer | | Sequence to insert into next-hop list Please refer vendor documentation for valid values |
| | | | | | | **track** integer | | Set the next hop depending on the state of a tracked object tracked object number Please refer vendor documentation for valid values |
| | | | **level** dictionary | | Where to import route |
| | | | | **level\_1** boolean | **Choices:*** no
* yes
| Import into a level-1 area |
| | | | | **level\_1\_2** boolean | **Choices:*** no
* yes
| Import into level-1 and level-2 |
| | | | | **level\_2** boolean | **Choices:*** no
* yes
| Import into level-2 sub-domain |
| | | | | **nssa\_only** boolean | **Choices:*** no
* yes
| Import only into OSPF NSSA areas and don't propagate |
| | | | **lisp** string | | Locator ID Separation Protocol specific information Specify a locator-set to use in LISP route-import The name of the locator set |
| | | | **local\_preference** integer | | BGP local preference path attribute Please refer vendor documentation for valid values |
| | | | **metric** dictionary | | Metric value for destination routing protocol |
| | | | | **deviation** string | **Choices:*** plus
* minus
| Add or subtract metric |
| | | | | **eigrp\_delay** integer | | EIGRP delay metric, in 10 microsecond units Please refer vendor documentation for valid values |
| | | | | **metric\_bandwidth** integer | | EIGRP Effective bandwidth metric (Loading) where 255 is 100 loaded Please refer vendor documentation for valid values |
| | | | | **metric\_reliability** integer | | EIGRP reliability metric where 255 is 100 reliable Please refer vendor documentation for valid values |
| | | | | **metric\_value** integer | | Metric value or Bandwidth in Kbits per second Please refer vendor documentation for valid values |
| | | | | **mtu** integer | | EIGRP MTU of the path Please refer vendor documentation for valid values |
| | | | **metric\_type** dictionary | | Type of metric for destination routing protocol |
| | | | | **external** boolean | **Choices:*** no
* yes
| IS-IS external metric |
| | | | | **internal** boolean | **Choices:*** no
* yes
| IS-IS internal metric or Use IGP metric as the MED for BGP |
| | | | | **type\_1** boolean | **Choices:*** no
* yes
| OSPF external type 1 metric |
| | | | | **type\_2** boolean | **Choices:*** no
* yes
| OSPF external type 2 metric |
| | | | **mpls\_label** boolean | **Choices:*** no
* yes
| Set MPLS label for prefix |
| | | | **origin** dictionary | | BGP origin code |
| | | | | **igp** boolean | **Choices:*** no
* yes
| local IGP |
| | | | | **incomplete** boolean | **Choices:*** no
* yes
| unknown heritage |
| | | | **tag** string | | Tag value for destination routing protocol Tag value A.B.C.D(dotted decimal format)/Tag value |
| | | | **traffic\_index** integer | | BGP traffic classification number for accounting Please refer vendor documentation for valid values |
| | | | **vrf** string | | Define VRF name VPN Routing/Forwarding instance name |
| | | | **weight** integer | | BGP weight for routing table Please refer vendor documentation for valid values |
| | **route\_map** string | | Route map tag/name |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **sh running-config | section ^route-map**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* gathered
* parsed
* rendered
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *sh running-config | section ^route-map* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL
* This module works with connection `network_cli`. See [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios)
Examples
--------
```
# Using deleted
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Delete provided Route maps config
cisco.ios.ios_route_maps:
config:
- route_map: test_1
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "no route-map test_1"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^route-map
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
# Using deleted without any config passed (NOTE: This will delete all Route maps configuration from device)
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Delete all Route maps config
cisco.ios.ios_route_maps:
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "no route-map test_1",
# "no route-map test_2"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^route-map
# router-ios#
# Using merged
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# router-ios#
- name: Merge provided Route maps configuration
cisco.ios.ios_route_maps:
config:
- route_map: test_1
entries:
- sequence: 10
action: deny
description: this is test route
match:
ip:
next_hop:
prefix_lists:
- test_1_new
- test_2_new
route_source:
acls:
- 10
security_group:
source:
- 10
- 20
local_preference:
value:
- 50
- 100
mpls_label: true
- sequence: 20
action: deny
continue_entry:
entry_sequence: 100
match:
additional_paths:
all: true
group_best: true
as_path:
acls:
- 100
- 200
ipv6:
address:
acl: test_acl_20
route_type:
level_1: true
tag:
tag_list:
- test_match_tag
track: 105
- route_map: test_2
entries:
- sequence: 10
action: deny
match:
ipv6:
address:
acl: test_ip_acl
next_hop:
prefix_list: test_new
route_source:
acl: route_src_acl
security_group:
source:
- 10
- 20
local_preference:
value:
- 55
- 105
mpls_label: true
set:
aigp_metric:
value: 100
automatic_tag: true
extcommunity:
cost:
id: 10
cost_value: 100
pre_bestpath: true
ip:
address: 192.0.2.1
df: 1
next_hop:
recursive:
global_route: true
address: 198.51.110.1
verify_availability:
address: 198.51.111.1
sequence: 100
track: 10
precedence:
critical: true
state: merged
# Commands Fired:
# ---------------
#
# "commands": [
# "route-map test_2 deny 10",
# "match security-group source tag 10 20",
# "match local-preference 55 105",
# "match mpls-label",
# "match ipv6 next-hop prefix-list test_new",
# "match ipv6 route-source route_src_acl",
# "match ipv6 address test_ip_acl",
# "set extcommunity cost pre-bestpath 10 100",
# "set ip df 1",
# "set ip next-hop recursive global 198.51.110.1",
# "set ip next-hop verify-availability 198.51.111.1 100 track 10",
# "set ip precedence critical",
# "set ip address prefix-list 192.0.2.1",
# "set automatic-tag",
# "set aigp-metric 100",
# "route-map test_1 deny 20",
# "continue 100",
# "match track 105",
# "match tag list test_match_tag",
# "match ipv6 address test_acl_20",
# "match route-type level-1",
# "match as-path 200 100",
# "match additional-paths advertise-set all group-best",
# "route-map test_1 deny 10",
# "description this is test route",
# "match security-group source tag 10 20",
# "match ip next-hop prefix-list test_2_new test_1_new",
# "match ip route-source 10",
# "match local-preference 100 50",
# "match mpls-label"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
# Using overridden
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Override provided Route maps configuration
cisco.ios.ios_route_maps:
config:
- route_map: test_1
entries:
- sequence: 10
action: deny
description: this is override route
match:
ip:
next_hop:
acls:
- 10
- test1_acl
flowspec:
dest_pfx: true
acls:
- test_acl_1
- test_acl_2
length:
minimum: 10
maximum: 100
metric:
value: 10
external: true
security_group:
source:
- 10
- 20
mpls_label: true
set:
extcommunity:
vpn_distinguisher:
address: 192.0.2.1:12
additive: true
metric:
metric_value: 100
deviation: plus
eigrp_delay: 100
metric_reliability: 10
metric_bandwidth: 20
mtu: 30
- route_map: test_override
entries:
- sequence: 10
action: deny
match:
ipv6:
address:
acl: test_acl
next_hop:
prefix_list: test_new
route_source:
acl: route_src_acl
security_group:
source:
- 15
- 20
local_preference:
value:
- 105
- 110
mpls_label: true
set:
aigp_metric:
value: 100
automatic_tag: true
extcommunity:
cost:
id: 10
cost_value: 100
pre_bestpath: true
ip:
address: 192.0.2.1
df: 1
next_hop:
recursive:
global_route: true
address: 198.110.51.1
verify_availability:
address: 198.110.51.2
sequence: 100
track: 10
precedence:
critical: true
state: overridden
# Commands Fired:
# ---------------
#
# "commands": [
# "no route-map test_2",
# "route-map test_override deny 10",
# "match security-group source tag 15 20",
# "match local-preference 110 105",
# "match mpls-label",
# "match ipv6 next-hop prefix-list test_new",
# "match ipv6 route-source route_src_acl",
# "match ipv6 address test_acl",
# "set extcommunity cost pre-bestpath 10 100",
# "set ip df 1",
# "set ip next-hop recursive global 198.110.51.1",
# "set ip next-hop verify-availability 198.110.51.2 100 track 10",
# "set ip precedence critical",
# "set ip address prefix-list 192.0.2.1",
# "set automatic-tag",
# "set aigp-metric 100",
# "route-map test_1 deny 10",
# "no description this is test route",
# "description this is override route",
# "match ip flowspec dest-pfx test_acl_1 test_acl_2",
# "no match ip next-hop prefix-list test_2_new test_1_new",
# "match ip next-hop test1_acl 10",
# "no match ip route-source 10",
# "match metric external 10",
# "match length 10 100",
# "no match local-preference 100 50",
# "set extcommunity vpn-distinguisher 192.0.2.1:12 additive",
# "set metric 100 +100 10 20 30",
# "no route-map test_1 deny 20"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_override deny 10
# match security-group source tag 15 20
# match local-preference 110 105
# match mpls-label
# match ipv6 address test_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.110.51.2 100 track 10
# set ip next-hop recursive global 198.110.51.1
# route-map test_1 deny 10
# description this is override route
# match ip flowspec dest-pfx test_acl_1 test_acl_2
# match ip next-hop test1_acl 10
# match security-group source tag 10 20
# match metric external 10
# match mpls-label
# match length 10 100
# set metric 100 +100 10 20 30
# set extcommunity vpn-distinguisher 192.0.2.1:12 additive
# Using replaced
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Replaced provided Route maps configuration
cisco.ios.ios_route_maps:
config:
- route_map: test_1
entries:
- sequence: 10
action: deny
description: this is replaced route
match:
ip:
next_hop:
acls:
- 10
- test1_acl
flowspec:
dest_pfx: true
acls:
- test_acl_1
- test_acl_2
length:
minimum: 10
maximum: 100
metric:
value: 10
external: true
security_group:
source:
- 10
- 20
mpls_label: true
set:
extcommunity:
vpn_distinguisher:
address: 192.0.2.1:12
additive: true
metric:
metric_value: 100
deviation: plus
eigrp_delay: 100
metric_reliability: 10
metric_bandwidth: 20
mtu: 30
- route_map: test_replaced
entries:
- sequence: 10
action: deny
match:
ipv6:
address:
acl: test_acl
next_hop:
prefix_list: test_new
route_source:
acl: route_src_acl
security_group:
source:
- 15
- 20
local_preference:
value:
- 105
- 110
mpls_label: true
set:
aigp_metric:
value: 100
automatic_tag: true
extcommunity:
cost:
id: 10
cost_value: 100
pre_bestpath: true
ip:
address: 192.0.2.1
df: 1
next_hop:
recursive:
global_route: true
address: 198.110.51.1
verify_availability:
address: 198.110.51.2
sequence: 100
track: 10
precedence:
critical: true
state: replaced
# Commands Fired:
# ---------------
# "commands": [
# "route-map test_replaced deny 10",
# "match security-group source tag 15 20",
# "match local-preference 110 105",
# "match mpls-label",
# "match ipv6 next-hop prefix-list test_new",
# "match ipv6 route-source route_src_acl",
# "match ipv6 address test_acl",
# "set extcommunity cost pre-bestpath 10 100",
# "set ip df 1",
# "set ip next-hop recursive global 198.110.51.1",
# "set ip next-hop verify-availability 198.110.51.2 100 track 10",
# "set ip precedence critical",
# "set ip address prefix-list 192.0.2.1",
# "set automatic-tag",
# "set aigp-metric 100",
# "route-map test_1 deny 10",
# "no description this is test route",
# "description this is replaced route",
# "match ip flowspec dest-pfx test_acl_1 test_acl_2",
# "no match ip next-hop prefix-list test_2_new test_1_new",
# "match ip next-hop test1_acl 10",
# "no match ip route-source 10",
# "match metric external 10",
# "match length 10 100",
# "no match local-preference 100 50",
# "set extcommunity vpn-distinguisher 192.0.2.1:12 additive",
# "set metric 100 +100 10 20 30",
# "no route-map test_1 deny 20"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_replaced deny 10
# match security-group source tag 15 20
# match local-preference 110 105
# match mpls-label
# match ipv6 address test_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.110.51.2 100 track 10
# set ip next-hop recursive global 198.110.51.1
# route-map test_1 deny 10
# description this is replaced route
# match ip flowspec dest-pfx test_acl_1 test_acl_2
# match ip next-hop test1_acl 10
# match security-group source tag 10 20
# match metric external 10
# match mpls-label
# match length 10 100
# set metric 100 +100 10 20 30
# set extcommunity vpn-distinguisher 192.0.2.1:12 additive
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
# Using Gathered
# Before state:
# -------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Gather Route maps provided configurations
cisco.ios.ios_route_maps:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "entries": [
# {
# "action": "deny",
# "description": "this is test route",
# "match": {
# "ip": {
# "next_hop": {
# "prefix_lists": [
# "test_2_new",
# "test_1_new"
# ]
# },
# "route_source": {
# "acls": [
# "10"
# ]
# }
# },
# "local_preference": {
# "value": [
# "100",
# "50"
# ]
# },
# "mpls_label": true,
# "security_group": {
# "source": [
# 10,
# 20
# ]
# }
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_entry": {
# "entry_sequence": 100
# },
# "match": {
# "additional_paths": {
# "all": true,
# "group_best": true
# },
# "as_path": {
# "acls": [
# 200,
# 100
# ]
# },
# "ipv6": {
# "address": {
# "acl": "test_acl_20"
# }
# },
# "route_type": {
# "external": {
# "set": true
# },
# "level_1": true,
# "nssa_external": {
# "set": true
# }
# },
# "tag": {
# "tag_list": [
# "test_match_tag"
# ]
# },
# "track": 105
# },
# "sequence": 20
# }
# ],
# "route_map": "test_1"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "address": {
# "acl": "test_ip_acl"
# },
# "next_hop": {
# "prefix_list": "test_new"
# },
# "route_source": {
# "acl": "route_src_acl"
# }
# },
# "local_preference": {
# "value": [
# "55",
# "105"
# ]
# },
# "mpls_label": true,
# "security_group": {
# "source": [
# 10,
# 20
# ]
# }
# },
# "sequence": 10,
# "set": {
# "aigp_metric": {
# "value": 100
# },
# "automatic_tag": true,
# "extcommunity": {
# "cost": {
# "cost_value": 100,
# "id": "10",
# "pre_bestpath": true
# }
# },
# "ip": {
# "address": "192.0.2.1",
# "df": 1,
# "next_hop": {
# "recursive": {
# "address": "198.51.110.1",
# "global_route": true
# },
# "verify_availability": {
# "address": "198.51.111.1",
# "sequence": 100,
# "track": 10
# }
# },
# "precedence": {
# "critical": true
# }
# }
# }
# }
# ],
# "route_map": "test_2"
# }
# ]
# After state:
# ------------
#
# router-ios#sh running-config | section ^route-map
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_route_maps:
config:
- route_map: test_1
entries:
- sequence: 10
action: deny
description: this is test route
match:
ip:
next_hop:
prefix_lists:
- test_1_new
- test_2_new
route_source:
acls:
- 10
security_group:
source:
- 10
- 20
local_preference:
value:
- 50
- 100
mpls_label: true
- sequence: 20
action: deny
continue_entry:
entry_sequence: 100
match:
additional_paths:
all: true
group_best: true
as_path:
acls:
- 100
- 200
ipv6:
address:
acl: test_acl_20
route_type:
level_1: true
tag:
tag_list:
- test_match_tag
track: 105
- route_map: test_2
entries:
- sequence: 10
action: deny
match:
ipv6:
address:
acl: test_ip_acl
next_hop:
prefix_list: test_new
route_source:
acl: route_src_acl
security_group:
source:
- 10
- 20
local_preference:
value:
- 55
- 105
mpls_label: true
set:
aigp_metric:
value: 100
automatic_tag: true
extcommunity:
cost:
id: 10
cost_value: 100
pre_bestpath: true
ip:
address: 192.0.2.1
df: 1
next_hop:
recursive:
global_route: true
address: 198.51.110.1
verify_availability:
address: 198.51.111.1
sequence: 100
track: 10
precedence:
critical: true
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "route-map test_2 deny 10",
# "match security-group source tag 10 20",
# "match local-preference 55 105",
# "match mpls-label",
# "match ipv6 next-hop prefix-list test_new",
# "match ipv6 route-source route_src_acl",
# "match ipv6 address test_ip_acl",
# "set extcommunity cost pre-bestpath 10 100",
# "set ip df 1",
# "set ip next-hop recursive global 198.51.110.1",
# "set ip next-hop verify-availability 198.51.111.1 100 track 10",
# "set ip precedence critical",
# "set ip address prefix-list 192.0.2.1",
# "set automatic-tag",
# "set aigp-metric 100",
# "route-map test_1 deny 20",
# "continue 100",
# "match track 105",
# "match tag list test_match_tag",
# "match ipv6 address test_acl_20",
# "match route-type level-1",
# "match as-path 200 100",
# "match additional-paths advertise-set all group-best",
# "route-map test_1 deny 10",
# "description this is test route",
# "match security-group source tag 10 20",
# "match ip next-hop prefix-list test_2_new test_1_new",
# "match ip route-source 10",
# "match local-preference 100 50",
# "match mpls-label"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# route-map test_1 deny 10
# description this is test route
# match ip next-hop prefix-list test_2_new test_1_new
# match ip route-source 10
# match security-group source tag 10 20
# match local-preference 100 50
# match mpls-label
# route-map test_1 deny 20
# match track 105
# match tag list test_match_tag
# match route-type level-1
# match additional-paths advertise-set all group-best
# match as-path 200 100
# match ipv6 address test_acl_20
# continue 100
# route-map test_2 deny 10
# match security-group source tag 10 20
# match local-preference 55 105
# match mpls-label
# match ipv6 address test_ip_acl
# match ipv6 next-hop prefix-list test_new
# match ipv6 route-source route_src_acl
# set automatic-tag
# set ip precedence critical
# set ip address prefix-list 192.0.2.1
# set aigp-metric 100
# set extcommunity cost pre-bestpath 10 100
# set ip df 1
# set ip next-hop verify-availability 198.51.111.1 100 track 10
# set ip next-hop recursive global 198.51.110.1
- name: Parse the provided configuration with the existing running configuration
cisco.ios.ios_route_maps:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "entries": [
# {
# "action": "deny",
# "description": "this is test route",
# "match": {
# "ip": {
# "next_hop": {
# "prefix_lists": [
# "test_2_new",
# "test_1_new"
# ]
# },
# "route_source": {
# "acls": [
# "10"
# ]
# }
# },
# "local_preference": {
# "value": [
# "100",
# "50"
# ]
# },
# "mpls_label": true,
# "security_group": {
# "source": [
# 10,
# 20
# ]
# }
# },
# "sequence": 10
# },
# {
# "action": "deny",
# "continue_entry": {
# "entry_sequence": 100
# },
# "match": {
# "additional_paths": {
# "all": true,
# "group_best": true
# },
# "as_path": {
# "acls": [
# 200,
# 100
# ]
# },
# "ipv6": {
# "address": {
# "acl": "test_acl_20"
# }
# },
# "route_type": {
# "external": {
# "set": true
# },
# "level_1": true,
# "nssa_external": {
# "set": true
# }
# },
# "tag": {
# "tag_list": [
# "test_match_tag"
# ]
# },
# "track": 105
# },
# "sequence": 20
# }
# ],
# "route_map": "test_1"
# },
# {
# "entries": [
# {
# "action": "deny",
# "match": {
# "ipv6": {
# "address": {
# "acl": "test_ip_acl"
# },
# "next_hop": {
# "prefix_list": "test_new"
# },
# "route_source": {
# "acl": "route_src_acl"
# }
# },
# "local_preference": {
# "value": [
# "55",
# "105"
# ]
# },
# "mpls_label": true,
# "security_group": {
# "source": [
# 10,
# 20
# ]
# }
# },
# "sequence": 10,
# "set": {
# "aigp_metric": {
# "value": 100
# },
# "automatic_tag": true,
# "extcommunity": {
# "cost": {
# "cost_value": 100,
# "id": "10",
# "pre_bestpath": true
# }
# },
# "ip": {
# "address": "192.0.2.1",
# "df": 1,
# "next_hop": {
# "recursive": {
# "address": "198.51.110.1",
# "global_route": true
# },
# "verify_availability": {
# "address": "198.51.111.1",
# "sequence": 100,
# "track": 10
# }
# },
# "precedence": {
# "critical": true
# }
# }
# }
# }
# ],
# "route_map": "test_2"
# }
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The resulting configuration model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration prior to the model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device. **Sample:** ['route-map test\_1 deny 10', 'description this is test route', 'match ip route-source 10', 'match track 105'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ios.ios_lldp_global β LLDP resource module cisco.ios.ios\_lldp\_global β LLDP resource module
==================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_lldp_global`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module configures and manages the Link Layer Discovery Protocol(LLDP) attributes on IOS platforms.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** dictionary | | A dictionary of LLDP options |
| | **enabled** boolean | **Choices:*** no
* yes
| Enable LLDP |
| | **holdtime** integer | | LLDP holdtime (in sec) to be sent in packets. Refer to vendor documentation for valid values. |
| | **reinit** integer | | Specify the delay (in secs) for LLDP to initialize. Refer to vendor documentation for valid values. NOTE, if LLDP reinit is configured with a starting value, idempotency won't be maintained as the Cisco device doesn't record the starting reinit configured value. As such, Ansible cannot verify if the respective starting reinit value is already configured or not from the device side. If you try to apply starting reinit value in every play run, Ansible will show changed as True. For any other reinit value, idempotency will be maintained since any other reinit value is recorded in the Cisco device. |
| | **timer** integer | | Specify the rate at which LLDP packets are sent (in sec). Refer to vendor documentation for valid values. |
| | **tlv\_select** dictionary | | Selection of LLDP TLVs i.e. type-length-value to send NOTE, if tlv-select is configured idempotency won't be maintained as Cisco device doesn't record configured tlv-select options. As such, Ansible cannot verify if the respective tlv-select options is already configured or not from the device side. If you try to apply tlv-select option in every play run, Ansible will show changed as True. |
| | | **four\_wire\_power\_management** boolean | **Choices:*** no
* yes
| Cisco 4-wire Power via MDI TLV |
| | | **mac\_phy\_cfg** boolean | **Choices:*** no
* yes
| IEEE 802.3 MAC/Phy Configuration/status TLV |
| | | **management\_address** boolean | **Choices:*** no
* yes
| Management Address TLV |
| | | **port\_description** boolean | **Choices:*** no
* yes
| Port Description TLV |
| | | **port\_vlan** boolean | **Choices:*** no
* yes
| Port VLAN ID TLV |
| | | **power\_management** boolean | **Choices:*** no
* yes
| IEEE 802.3 DTE Power via MDI TLV |
| | | **system\_capabilities** boolean | **Choices:*** no
* yes
| System Capabilities TLV |
| | | **system\_description** boolean | **Choices:*** no
* yes
| System Description TLV |
| | | **system\_name** boolean | **Choices:*** no
* yes
| System Name TLV |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **show running-config | section ^lldp**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* deleted
* rendered
* gathered
* parsed
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL.
Examples
--------
```
# Using merged
# Before state:
# -------------
# vios#sh running-config | section ^lldp
# vios1#
- name: Merge provided configuration with device configuration
cisco.ios.ios_lldp_global:
config:
holdtime: 10
enabled: true
reinit: 3
timer: 10
state: merged
# After state:
# ------------
# vios#sh running-config | section ^lldp
# lldp timer 10
# lldp holdtime 10
# lldp reinit 3
# lldp run
# Using replaced
# Before state:
# -------------
# vios#sh running-config | section ^lldp
# lldp timer 10
# lldp holdtime 10
# lldp reinit 3
# lldp run
- name: Replaces LLDP device configuration with provided configuration
cisco.ios.ios_lldp_global:
config:
holdtime: 20
reinit: 5
state: replaced
# After state:
# -------------
# vios#sh running-config | section ^lldp
# lldp holdtime 20
# lldp reinit 5
# Using Deleted without any config passed
#"(NOTE: This will delete all of configured LLDP module attributes)"
# Before state:
# -------------
# vios#sh running-config | section ^lldp
# lldp timer 10
# lldp holdtime 10
# lldp reinit 3
# lldp run
- name: Delete LLDP attributes
cisco.ios.ios_lldp_global:
state: deleted
# After state:
# -------------
# vios#sh running-config | section ^lldp
# vios1#
# Using Gathered
# Before state:
# -------------
#
# vios#sh running-config | section ^lldp
# lldp timer 10
# lldp holdtime 10
# lldp reinit 3
# lldp run
- name: Gather listed interfaces with provided configurations
cisco.ios.ios_lldp_global:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": {
# "enabled": true,
# "holdtime": 10,
# "reinit": 3,
# "timer": 10
# }
# After state:
# ------------
#
# vios#sh running-config | section ^lldp
# lldp timer 10
# lldp holdtime 10
# lldp reinit 3
# lldp run
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_lldp_global:
config:
holdtime: 10
enabled: true
reinit: 3
timer: 10
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "lldp holdtime 10",
# "lldp run",
# "lldp timer 10",
# "lldp reinit 3"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# lldp timer 10
# lldp holdtime 10
# lldp reinit 3
# lldp run
- name: Parse the commands for provided configuration
cisco.ios.ios_lldp_global:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": {
# "enabled": true,
# "holdtime": 10,
# "reinit": 3,
# "timer": 10
# }
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** dictionary | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** dictionary | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device **Sample:** ['lldp holdtime 10', 'lldp run', 'lldp timer 10'] |
### Authors
* Sumit Jaiswal (@justjais)
ansible cisco.ios.ios_ntp β Manages core NTP configuration. cisco.ios.ios\_ntp β Manages core NTP configuration.
====================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_ntp`.
New in version 1.0.0: of cisco.ios
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2024-01-01
Why
Updated module released with more functionality.
Alternative
ios\_ntp\_global
Synopsis
--------
* Manages core NTP configuration.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **acl** string | | ACL for peer/server access restricition. |
| **auth** boolean | **Choices:*** **no** β
* yes
| Enable NTP authentication. Data type boolean. |
| **auth\_key** string | | md5 NTP authentication key of tye 7. |
| **key\_id** string | | auth\_key id. Data type string |
| **logging** boolean | **Choices:*** **no** β
* yes
| Enable NTP logs. Data type boolean. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **server** string | | Network address of NTP server. |
| **source\_int** string | | Source interface for NTP packets. |
| **state** string | **Choices:*** **present** β
* absent
| Manage the state of the resource. |
| **vrf** string | | VRF configuration for NTP servers |
Notes
-----
Note
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
# Set new NTP server and source interface
- cisco.ios.ios_ntp:
server: 10.0.255.10
source_int: Loopback0
logging: false
state: present
# Remove NTP ACL and logging
- cisco.ios.ios_ntp:
acl: NTP_ACL
logging: true
state: absent
# Set NTP authentication
- cisco.ios.ios_ntp:
key_id: 10
auth_key: 15435A030726242723273C21181319000A
auth: true
state: present
# Set new NTP configuration
- cisco.ios.ios_ntp:
server: 10.0.255.10
source_int: Loopback0
acl: NTP_ACL
logging: true
vrf: mgmt
key_id: 10
auth_key: 15435A030726242723273C21181319000A
auth: true
state: present
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | command sent to the device **Sample:** ['no ntp server 10.0.255.10', 'no ntp source Loopback0'] |
Status
------
* This module will be removed in a major release after 2024-01-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Federico Olivieri (@Federico87)
* Joanie Sylvain (@JoanieAda)
ansible cisco.ios.ios_l3_interfaces β L3 interfaces resource module cisco.ios.ios\_l3\_interfaces β L3 interfaces resource module
=============================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_l3_interfaces`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of Layer-3 interface on Cisco IOS devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A dictionary of Layer-3 interface options |
| | **ipv4** list / elements=dictionary | | IPv4 address to be set for the Layer-3 interface mentioned in *name* option. The address format is <ipv4 address>/<mask>, the mask is number in range 0-32 eg. 192.168.0.1/24. |
| | | **address** string | | Configures the IPv4 address for Interface. |
| | | **dhcp** dictionary | | IP Address negotiated via DHCP. |
| | | | **client\_id** string | | Specify client-id to use. |
| | | | **enable** boolean | **Choices:*** no
* yes
| Enable dhcp. |
| | | | **hostname** string | | Specify value for hostname option. |
| | | **dhcp\_client** string | | Configures and specifies client-id to use over DHCP ip. Note, This option shall work only when dhcp is configured as IP. GigabitEthernet interface number This option is DEPRECATED and is replaced with dhcp which accepts dict as input this attribute will be removed after 2023-08-01. |
| | | **dhcp\_hostname** string | | Configures and specifies value for hostname option over DHCP ip. Note, This option shall work only when dhcp is configured as IP. This option is DEPRECATED and is replaced with dhcp which accepts dict as input this attribute will be removed after 2023-08-01. |
| | | **pool** string | | IP Address auto-configured from a local DHCP pool. |
| | | **secondary** boolean | **Choices:*** no
* yes
| Configures the IP address as a secondary address. |
| | **ipv6** list / elements=dictionary | | IPv6 address to be set for the Layer-3 interface mentioned in *name* option. The address format is <ipv6 address>/<mask>, the mask is number in range 0-128 eg. fd5d:12c9:2201:1::1/64 |
| | | **address** string | | Configures the IPv6 address for Interface. |
| | | **anycast** boolean | **Choices:*** no
* yes
| Configure as an anycast |
| | | **autoconfig** dictionary | | Obtain address using auto-configuration. |
| | | | **default** boolean | **Choices:*** no
* yes
| Insert default route. |
| | | | **enable** boolean | **Choices:*** no
* yes
| enable auto-configuration. |
| | | **cga** boolean | **Choices:*** no
* yes
| Use CGA interface identifier |
| | | **dhcp** dictionary | | Obtain a ipv6 address using DHCP. |
| | | | **enable** boolean | **Choices:*** no
* yes
| Enable dhcp. |
| | | | **rapid\_commit** boolean | **Choices:*** no
* yes
| Enable Rapid-Commit. |
| | | **eui** boolean | **Choices:*** no
* yes
| Use eui-64 interface identifier |
| | | **link\_local** boolean | **Choices:*** no
* yes
| Use link-local address |
| | | **segment\_routing** dictionary | | Segment Routing submode |
| | | | **default** boolean | **Choices:*** no
* yes
| Set a command to its defaults. |
| | | | **enable** boolean | **Choices:*** no
* yes
| Enable segmented routing. |
| | | | **ipv6\_sr** boolean | **Choices:*** no
* yes
| Set ipv6\_sr. |
| | **name** string / required | | Full name of the interface excluding any logical unit number, i.e. GigabitEthernet0/1. |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **show running-config | section ^interface**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* rendered
* gathered
* parsed
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | section ^interface* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.6.
* Using deleted state without config will delete all l3 attributes from all the interfaces.
Examples
--------
```
# Using state merged
# Before state:
# -------------
# router-ios#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# ip address 10.1.1.1 255.255.255.0
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description This is test
# no ip address
# duplex auto
# speed 1000
# interface GigabitEthernet0/3
# description Configured by Ansible Network
# no ip address
# interface GigabitEthernet0/3.100
# encapsulation dot1Q 20
- name: Merge provided configuration with device configuration
cisco.ios.ios_l3_interfaces:
config:
- name: GigabitEthernet0/1
ipv4:
- address: 192.168.0.1/24
secondary: true
- name: GigabitEthernet0/2
ipv4:
- address: 192.168.0.2/24
- name: GigabitEthernet0/3
ipv6:
- address: fd5d:12c9:2201:1::1/64
- name: GigabitEthernet0/3.100
ipv4:
- address: 192.168.0.3/24
state: merged
# Commands Fired:
# ---------------
# "commands": [
# "interface GigabitEthernet0/1",
# "ip address 192.168.0.1 255.255.255.0 secondary",
# "interface GigabitEthernet0/2",
# "ip address 192.168.0.2 255.255.255.0",
# "interface GigabitEthernet0/3",
# "ipv6 address fd5d:12c9:2201:1::1/64",
# "GigabitEthernet0/3.100",
# "ip address 192.168.0.3 255.255.255.0",
# ],
# After state:
# ------------
# router-ios#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# ip address 10.1.1.1 255.255.255.0
# ip address 192.168.0.1 255.255.255.0 secondary
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description This is test
# ip address 192.168.0.2 255.255.255.0
# duplex auto
# speed 1000
# interface GigabitEthernet0/3
# description Configured by Ansible Network
# ipv6 address FD5D:12C9:2201:1::1/64
# interface GigabitEthernet0/3.100
# encapsulation dot1Q 20
# ip address 192.168.0.3 255.255.255.0
# Using state replaced
# Before state:
# -------------
# router-ios#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# ip address 10.1.1.1 255.255.255.0
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description This is test
# no ip address
# duplex auto
# speed 1000
# interface GigabitEthernet0/3
# description Configured by Ansible Network
# ip address 192.168.2.0 255.255.255.0
# interface GigabitEthernet0/3.100
# encapsulation dot1Q 20
# ip address 192.168.0.2 255.255.255.0
- name: Replaces device configuration of listed interfaces with provided configuration
cisco.ios.ios_l3_interfaces:
config:
- name: GigabitEthernet0/2
ipv4:
- address: 192.168.2.0/24
- name: GigabitEthernet0/3
ipv4:
- dhcp:
client_id: GigabitEthernet0/2
hostname: test.com
- name: GigabitEthernet0/3.100
ipv4:
- address: 192.168.0.3/24
secondary: true
state: replaced
# Commands Fired:
# ---------------
# "commands": [
# "interface GigabitEthernet0/1",
# "ip address 192.168.0.1 255.255.255.0 secondary",
# "interface GigabitEthernet0/2",
# "ip address 192.168.0.2 255.255.255.0",
# "interface GigabitEthernet0/3",
# "no ip address 192.168.2.0 255.255.255.0",
# "ip address dhcp client-id GigabitEthernet0/2 hostname test.com",
# "GigabitEthernet0/3.100",
# "no ip address 192.168.0.2 255.255.255.0",
# "ip address 192.168.0.3 255.255.255.0 secondary",
# ],
# After state:
# ------------
# router-ios#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# ip address 10.1.1.1 255.255.255.0
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description This is test
# ip address 192.168.2.1 255.255.255.0
# duplex auto
# speed 1000
# interface GigabitEthernet0/3
# description Configured by Ansible Network
# ip address dhcp client-id GigabitEthernet0/2 hostname test.com
# interface GigabitEthernet0/3.100
# encapsulation dot1Q 20
# ip address 192.168.0.3 255.255.255.0 secondary
# Using state overridden
# Before state:
# -------------
# router-ios#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# ip address 10.1.1.1 255.255.255.0
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description This is test
# ip address 192.168.2.1 255.255.255.0
# duplex auto
# speed 1000
# interface GigabitEthernet0/3
# description Configured by Ansible Network
# ipv6 address FD5D:12C9:2201:1::1/64
# interface GigabitEthernet0/3.100
# encapsulation dot1Q 20
# ip address 192.168.0.2 255.255.255.0
- name: Override device configuration of all interfaces with provided configuration
cisco.ios.ios_l3_interfaces:
config:
- name: GigabitEthernet0/2
ipv4:
- address: 192.168.0.1/24
- name: GigabitEthernet0/3.100
ipv6:
- autoconfig: true
state: overridden
# Commands Fired:
# ---------------
# "commands": [
# "interface GigabitEthernet0/1",
# "no ip address 10.1.1.1 255.255.255.0",
# "interface GigabitEthernet0/2",
# "no ip address 192.168.2.1 255.255.255.0",
# "ip address 192.168.0.1 255.255.255.0",
# "interface GigabitEthernet0/3",
# "no ipv6 address FD5D:12C9:2201:1::1/64",
# "GigabitEthernet0/3.100",
# "no ip address 192.168.0.2 255.255.255.0",
# "ipv6 address autoconfig",
# ],
# After state:
# ------------
# router-ios#show running-config | section ^interface
# interface GigabitEthernet0/1
# description Configured by Ansible
# no ip address
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description This is test
# ip address 192.168.0.1 255.255.255.0
# duplex auto
# speed 1000
# interface GigabitEthernet0/3
# description Configured by Ansible Network
# interface GigabitEthernet0/3.100
# encapsulation dot1Q 20
# ipv6 address autoconfig
# Using state Deleted
# Before state:
# -------------
# router-ios#show running-config | section ^interface
# interface GigabitEthernet0/1
# ip address 192.0.2.10 255.255.255.0
# shutdown
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description Configured by Ansible Network
# ip address 192.168.1.0 255.255.255.0
# interface GigabitEthernet0/3
# description Configured by Ansible Network
# ip address 192.168.0.1 255.255.255.0
# shutdown
# duplex full
# speed 10
# ipv6 address FD5D:12C9:2201:1::1/64
# interface GigabitEthernet0/3.100
# encapsulation dot1Q 20
# ip address 192.168.0.2 255.255.255.0
- name: "Delete attributes of given interfaces (NOTE: This won't delete the interfaces itself)"
cisco.ios.ios_l3_interfaces:
config:
- name: GigabitEthernet0/2
- name: GigabitEthernet0/3.100
state: deleted
# "commands": [
# "interface GigabitEthernet0/2",
# "no ip address 192.168.1.0 255.255.255.0",
# "GigabitEthernet0/3.100",
# "no ip address 192.168.0.2 255.255.255.0",
# ],
# After state:
# -------------
# router-ios#show running-config | section ^interface
# interface GigabitEthernet0/1
# ip address 192.0.2.10 255.255.255.0
# shutdown
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description Configured by Ansible Network
# no ip address
# interface GigabitEthernet0/3
# description Configured by Ansible Network
# ip address 192.168.0.1 255.255.255.0
# shutdown
# duplex full
# speed 10
# ipv6 address FD5D:12C9:2201:1::1/64
# interface GigabitEthernet0/3.100
# encapsulation dot1Q 20
# Using state Deleted without any config passed
#"(NOTE: This will delete all of configured L3 resource module attributes from each configured interface)"
# Before state:
# -------------
# router-ios#show running-config | section ^interface
# interface GigabitEthernet0/1
# ip address 192.0.2.10 255.255.255.0
# shutdown
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description Configured by Ansible Network
# ip address 192.168.1.0 255.255.255.0
# interface GigabitEthernet0/3
# description Configured by Ansible Network
# ip address 192.168.0.1 255.255.255.0
# shutdown
# duplex full
# speed 10
# ipv6 address FD5D:12C9:2201:1::1/64
# interface GigabitEthernet0/3.100
# encapsulation dot1Q 20
# ip address 192.168.0.2 255.255.255.0
- name: "Delete L3 attributes of ALL interfaces together (NOTE: This won't delete the interface itself)"
cisco.ios.ios_l3_interfaces:
state: deleted
# "commands": [
# "interface GigabitEthernet0/1",
# "no ip address 192.0.2.10 255.255.255.0",
# "interface GigabitEthernet0/2",
# "no ip address 192.168.1.0 255.255.255.0",
# "interface GigabitEthernet0/3",
# "no ip address 192.168.0.1 255.255.255.0",
# "no ipv6 address FD5D:12C9:2201:1::1/64",
# "GigabitEthernet0/3.100",
# "no ip address 192.168.0.2 255.255.255.0",
# ],
# After state:
# -------------
# router-ios#show running-config | section ^interface
# interface GigabitEthernet0/1
# no ip address
# shutdown
# duplex auto
# speed auto
# interface GigabitEthernet0/2
# description Configured by Ansible Network
# no ip address
# interface GigabitEthernet0/3
# description Configured by Ansible Network
# shutdown
# duplex full
# speed 10
# interface GigabitEthernet0/3.100
# encapsulation dot1Q 20
# Using state Gathered
# Before state:
# -------------
# router-ios#sh running-config | section ^interface
# interface GigabitEthernet0/1
# ip address 203.0.113.27 255.255.255.0
# interface GigabitEthernet0/2
# ip address 192.0.2.1 255.255.255.0 secondary
# ip address 192.0.2.2 255.255.255.0
# ipv6 address 2001:DB8:0:3::/64
- name: Gather listed l3 interfaces with provided configurations
cisco.ios.ios_l3_interfaces:
state: gathered
# Module Execution Result:
# ------------------------
# "gathered": [
# {
# "ipv4": [
# {
# "address": "203.0.113.27 255.255.255.0"
# }
# ],
# "name": "GigabitEthernet0/1"
# },
# {
# "ipv4": [
# {
# "address": "192.0.2.1 255.255.255.0",
# "secondary": true
# },
# {
# "address": "192.0.2.2 255.255.255.0"
# }
# ],
# "ipv6": [
# {
# "address": "2001:db8:0:3::/64"
# }
# ],
# "name": "GigabitEthernet0/2"
# }
# ]
# After state:
# ------------
# router-ios#sh running-config | section ^interface
# interface GigabitEthernet0/1
# ip address 203.0.113.27 255.255.255.0
# interface GigabitEthernet0/2
# ip address 192.0.2.1 255.255.255.0 secondary
# ip address 192.0.2.2 255.255.255.0
# ipv6 address 2001:DB8:0:3::/64
# Using state Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_l3_interfaces:
config:
- name: GigabitEthernet0/1
ipv4:
- dhcp:
client_id: GigabitEthernet0/0
hostname: test.com
- name: GigabitEthernet0/2
ipv4:
- address: 198.51.100.1/24
secondary: true
- address: 198.51.100.2/24
ipv6:
- address: 2001:db8:0:3::/64
state: rendered
# Module Execution Result:
# ------------------------
# "rendered": [
# "interface GigabitEthernet0/1",
# "ip address dhcp client-id GigabitEthernet 0/0 hostname test.com",
# "interface GigabitEthernet0/2",
# "ip address 198.51.100.1 255.255.255.0 secondary",
# "ip address 198.51.100.2 255.255.255.0",
# "ipv6 address 2001:db8:0:3::/64"
# ]
# Using state Parsed
# File: parsed.cfg
# ----------------
#
# interface GigabitEthernet0/1
# ip address dhcp client-id GigabitEthernet 0/0 hostname test.com
# interface GigabitEthernet0/2
# ip address 198.51.100.1 255.255.255.0
# ip address 198.51.100.2 255.255.255.0 secondary
# ipv6 address 2001:db8:0:3::/64
- name: Parse the commands for provided configuration
cisco.ios.ios_l3_interfaces:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
# "parsed": [
# {
# "ipv4": [
# {
# "dhcp": {
# "client_id": GigabitEthernet0/0,
# "hostname": "test.com"
# }
# }
# ],
# "name": "GigabitEthernet0/1"
# },
# {
# "ipv4": [
# {
# "address": "198.51.100.1/24",
# "secondary": true
# },
# {
# "address": "198.51.100.2/24"
# }
# ],
# "ipv6": [
# {
# "address": "2001:db8:0:3::/64"
# }
# ],
# "name": "GigabitEthernet0/2"
# }
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** dictionary | when changed | The resulting configuration after module execution. **Sample:** This output will always be in the same format as the module argspec. |
| **before** dictionary | when state is *merged*, *replaced*, *overridden*, *deleted* or *purged* | The configuration prior to the module execution. **Sample:** This output will always be in the same format as the module argspec. |
| **commands** list / elements=string | when state is *merged*, *replaced*, *overridden*, *deleted* or *purged* | The set of commands pushed to the remote device. **Sample:** ['ip address 192.168.0.3 255.255.255.0', 'ipv6 address dhcp rapid-commit', 'ipv6 address fd5d:12c9:2201:1::1/64 anycast'] |
| **gathered** list / elements=string | when state is *gathered* | Facts about the network resource gathered from the remote device as structured data. **Sample:** This output will always be in the same format as the module argspec. |
| **parsed** list / elements=string | when state is *parsed* | The device native config provided in *running\_config* option parsed into structured data as per module argspec. **Sample:** This output will always be in the same format as the module argspec. |
| **rendered** list / elements=string | when state is *rendered* | The provided configuration in the task rendered in device-native format (offline). **Sample:** ['ipv6 address FD5D:12C9:2201:1::1/64', 'ip address 192.168.0.3 255.255.255.0', 'ip address autoconfig'] |
### Authors
* Sagar Paul (@KB-perByte)
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ios.ios_vlan β (deprecated, removed after 2022-06-01) Manage VLANs on IOS network devices cisco.ios.ios\_vlan β (deprecated, removed after 2022-06-01) Manage VLANs on IOS network devices
================================================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_vlan`.
New in version 1.0.0: of cisco.ios
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Newer and updated modules released with more functionality in Ansible 2.9
Alternative
ios\_vlans
Synopsis
--------
* This module provides declarative management of VLANs on Cisco IOS network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** list / elements=dictionary | | List of VLANs definitions. |
| | **associated\_interfaces** list / elements=string | | This is a intent option and checks the operational state of the for given vlan `name` for associated interfaces. If the value in the `associated_interfaces` does not match with the operational state of vlan interfaces on device it will result in failure. |
| | **delay** integer | | Delay the play should wait to check for declarative intent params values. |
| | **interfaces** list / elements=string | | List of interfaces that should be associated to the VLAN. |
| | **name** string | | Name of the VLAN. |
| | **state** string | **Choices:*** present
* absent
* active
* suspend
| State of the VLAN configuration. |
| | **vlan\_id** string / required | | ID of the VLAN. Range 1-4094. |
| **associated\_interfaces** list / elements=string | | This is a intent option and checks the operational state of the for given vlan `name` for associated interfaces. If the value in the `associated_interfaces` does not match with the operational state of vlan interfaces on device it will result in failure. |
| **delay** integer | **Default:**10 | Delay the play should wait to check for declarative intent params values. |
| **interfaces** list / elements=string | | List of interfaces that should be associated to the VLAN. |
| **name** string | | Name of the VLAN. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **purge** boolean | **Choices:*** **no** β
* yes
| Purge VLANs not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** β
* absent
* active
* suspend
| State of the VLAN configuration. |
| **vlan\_id** integer | | ID of the VLAN. Range 1-4094. |
Notes
-----
Note
* Tested against IOS 15.2
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: Create vlan
cisco.ios.ios_vlan:
vlan_id: 100
name: test-vlan
state: present
- name: Add interfaces to VLAN
cisco.ios.ios_vlan:
vlan_id: 100
interfaces:
- GigabitEthernet0/0
- GigabitEthernet0/1
- name: Check if interfaces is assigned to VLAN
cisco.ios.ios_vlan:
vlan_id: 100
associated_interfaces:
- GigabitEthernet0/0
- GigabitEthernet0/1
- name: Delete vlan
cisco.ios.ios_vlan:
vlan_id: 100
state: absent
- name: Add vlan using aggregate
cisco.ios.ios_vlan:
aggregate:
- {vlan_id: 100, name: test-vlan, interfaces: [GigabitEthernet0/1, GigabitEthernet0/2],
delay: 15, state: suspend}
- {vlan_id: 101, name: test-vlan, interfaces: GigabitEthernet0/3}
- name: Move interfaces to a different VLAN
cisco.ios.ios_vlan:
vlan_id: 102
interfaces:
- GigabitEthernet0/0
- GigabitEthernet0/1
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['vlan 100', 'name test-vlan'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Trishna Guha (@trishnaguha)
ansible cisco.ios.ios_banner β Manage multiline banners on Cisco IOS devices cisco.ios.ios\_banner β Manage multiline banners on Cisco IOS devices
=====================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_banner`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This will configure both login and motd banners on remote devices running Cisco IOS. It allows playbooks to add or remote banner text from the active running configuration.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **banner** string / required | **Choices:*** login
* motd
* exec
* incoming
* slip-ppp
| Specifies which banner should be configured on the remote device. In Ansible 2.4 and earlier only *login* and *motd* were supported. |
| **multiline\_delimiter** string | **Default:**"@" | Specify the delimiting character than will be used for configuration. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **state** string | **Choices:*** **present** β
* absent
| Specifies whether or not the configuration is present in the current devices active running configuration. |
| **text** string | | The banner text that should be present in the remote device running configuration. This argument accepts a multiline string, with no empty lines. Requires *state=present*. |
Notes
-----
Note
* Tested against IOS 15.6
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: Configure the login banner
cisco.ios.ios_banner:
banner: login
text: |
this is my login banner
that contains a multiline
string
state: present
- name: Remove the motd banner
cisco.ios.ios_banner:
banner: motd
state: absent
- name: Configure banner from file
cisco.ios.ios_banner:
banner: motd
text: "{{ lookup('file', './config_partial/raw_banner.cfg') }}"
state: present
- name: Configure the login banner using delimiter
cisco.ios.ios_banner:
banner: login
multiline_delimiter: x
text: this is my login banner
state: present
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['banner login', 'this is my login banner', 'that contains a multiline', 'string'] |
### Authors
* Ricardo Carrillo Cruz (@rcarrillocruz)
ansible cisco.ios.ios_bgp_global β Global BGP resource module cisco.ios.ios\_bgp\_global β Global BGP resource module
=======================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_bgp_global`.
New in version 1.3.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module configures and manages the attributes of global bgp on Cisco IOS.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** dictionary | | A list of configurations for global bgp. |
| | **aggregate\_address** dictionary | | Configure BGP aggregate entries |
| | | **address** string | | Aggregate address |
| | | **advertise\_map** string | | Set condition to advertise attribute |
| | | **as\_confed\_set** boolean | **Choices:*** no
* yes
| Generate AS confed set path information |
| | | **as\_set** boolean | **Choices:*** no
* yes
| Generate AS set path information |
| | | **attribute\_map** string | | Set attributes of aggregate |
| | | **netmask** string | | Aggregate mask |
| | | **summary\_only** boolean | **Choices:*** no
* yes
| Filter more specific routes from updates |
| | | **suppress\_map** string | | Conditionally filter more specific routes from updates |
| | **as\_number** string / required | | Autonomous system number. |
| | **auto\_summary** boolean | **Choices:*** no
* yes
| Enable automatic network number summarization |
| | **bgp** dictionary | | Enable address family and enter its config mode |
| | | **additional\_paths** dictionary | | Additional paths in the BGP table |
| | | | **install** boolean | **Choices:*** no
* yes
| Additional paths to install into RIB |
| | | | **receive** boolean | **Choices:*** no
* yes
| Receive additional paths from neighbors |
| | | | **select** dictionary | | Selection criteria to pick the paths |
| | | | | **all** boolean | **Choices:*** no
* yes
| Select all available paths |
| | | | | **best** integer | | Select best N paths (2-3). |
| | | | | **best\_external** boolean | **Choices:*** no
* yes
| Select best-external path |
| | | | | **group\_best** boolean | **Choices:*** no
* yes
| Select group-best path |
| | | | **send** boolean | **Choices:*** no
* yes
| Send additional paths to neighbors |
| | | **advertise\_best\_external** boolean | **Choices:*** no
* yes
| Advertise best external path to internal peers |
| | | **aggregate\_timer** integer | | Configure Aggregation Timer Please refer vendor documentation for valid values |
| | | **always\_compare\_med** boolean | **Choices:*** no
* yes
| Allow comparing MED from different neighbors |
| | | **asnotation** boolean | **Choices:*** no
* yes
| Change the default asplain notation asdot notation |
| | | **bestpath** list / elements=dictionary | | Change the default bestpath selection |
| | | | **aigp** boolean | **Choices:*** no
* yes
| if both paths doesn't have aigp ignore on bestpath comparision ignore |
| | | | **compare\_routerid** boolean | **Choices:*** no
* yes
| Compare router-id for identical EBGP paths |
| | | | **cost\_community** boolean | **Choices:*** no
* yes
| cost community |
| | | | **igp\_metric** boolean | **Choices:*** no
* yes
| igp metric Ignore igp metric in bestpath selection |
| | | | **med** dictionary | | MED attribute |
| | | | | **confed** boolean | **Choices:*** no
* yes
| Compare MED among confederation paths |
| | | | | **missing\_as\_worst** boolean | **Choices:*** no
* yes
| Treat missing MED as the least preferred one |
| | | **client\_to\_client** dictionary | | Configure client to client route reflection |
| | | | **all** boolean | **Choices:*** no
* yes
| inter-cluster and intra-cluster (default) |
| | | | **intra\_cluster** string | | intra cluster reflection intra-cluster reflection for cluster-id |
| | | | **set** boolean | **Choices:*** no
* yes
| set reflection of routes allowed |
| | | **cluster\_id** boolean | **Choices:*** no
* yes
| Configure Route-Reflector Cluster-id (peers may reset) A.B.C.D/Please refer vendor documentation for valid Route-Reflector Cluster-id |
| | | **confederation** dictionary | | AS confederation parameters |
| | | | **identifier** string | | Set routing domain confederation AS AS number |
| | | | **peers** string | | Peer ASs in BGP confederation AS number |
| | | **consistency\_checker** dictionary | | Consistency-checker |
| | | | **auto\_repair** dictionary | | Auto-Repair |
| | | | | **interval** integer | | Set the bgp consistency checker Please refer vendor documentation for valid values |
| | | | | **set** boolean | **Choices:*** no
* yes
| Enable Auto-Repair |
| | | | **error\_message** dictionary | | Log Error-Msg |
| | | | | **interval** integer | | Set the bgp consistency checker Please refer vendor documentation for valid values |
| | | | | **set** boolean | **Choices:*** no
* yes
| Enable Error-Msg |
| | | **dampening** dictionary | | Enable route-flap dampening |
| | | | **max\_suppress** integer | | Maximum duration to suppress a stable route Please refer vendor documentation for valid values |
| | | | **penalty\_half\_time** integer | | Half-life time for the penalty Please refer vendor documentation for valid values |
| | | | **reuse\_route\_val** integer | | Value to start reusing a route Please refer vendor documentation for valid values |
| | | | **route\_map** string | | Route-map to specify criteria for dampening |
| | | | **suppress\_route\_val** integer | | Value to start suppressing a route Please refer vendor documentation for valid values |
| | | **deterministic\_med** boolean | **Choices:*** no
* yes
| Pick the best-MED path among paths advertised from the neighboring AS |
| | | **dmzlink\_bw** boolean | **Choices:*** no
* yes
| Use DMZ Link Bandwidth as weight for BGP multipaths |
| | | **enforce\_first\_as** boolean | **Choices:*** no
* yes
| Enforce the first AS for EBGP routes(default) |
| | | **enhanced\_error** boolean | **Choices:*** no
* yes
| Enabled BGP Enhanced error handling |
| | | **fast\_external\_fallover** boolean | **Choices:*** no
* yes
| Immediately reset session if a link to a directly connected external peer goes down |
| | | **graceful\_restart** dictionary | | Graceful restart capability parameters |
| | | | **extended** boolean | **Choices:*** no
* yes
| Enable Graceful-Restart Extension |
| | | | **restart\_time** integer | | Set the max time needed to restart and come back up Please refer vendor documentation for valid values |
| | | | **set** boolean | **Choices:*** no
* yes
| Set Graceful-Restart |
| | | | **stalepath\_time** integer | | Set the max time to hold onto restarting peer's stale paths Please refer vendor documentation for valid values |
| | | **graceful\_shutdown** dictionary | | Graceful shutdown capability parameters |
| | | | **community** string | | Set Community for Gshut routes community number/community number in aa:nn format |
| | | | **local\_preference** integer | | Set Local Preference for Gshut routes Please refer vendor documentation for valid values |
| | | | **neighbors** dictionary | | Gracefully shut down all neigbors |
| | | | | **activate** boolean | **Choices:*** no
* yes
| Activate graceful shutdown of all neigbors |
| | | | | **time** integer | | time in seconds Please refer vendor documentation for valid values |
| | | | **vrfs** dictionary | | Gracefully shut down all vrf neigbors |
| | | | | **activate** boolean | **Choices:*** no
* yes
| Activate graceful shutdown of all neigbors |
| | | | | **time** integer | | time in seconds Please refer vendor documentation for valid values |
| | | **inject\_map** dictionary | | Routemap which specifies prefixes to inject |
| | | | **copy\_attributes** boolean | **Choices:*** no
* yes
| Copy attributes from aggregate |
| | | | **exist\_map\_name** string | | route-map name |
| | | | **name** string | | route-map name |
| | | **listen** dictionary | | Neighbor subnet range listener |
| | | | **limit** integer | | Set the max limit for the dynamic subnet range neighbors Please refer vendor documentation for valid values |
| | | | **range** dictionary | | Subnet network range |
| | | | | **ipv4\_with\_subnet** string | | IPv4 subnet range(A.B.C.D/nn) |
| | | | | **ipv6\_with\_subnet** string | | IPv6 subnet range(X:X:X:X::X/<0-128>) |
| | | | | **peer\_group** string | | Member of the peer-group |
| | | **log\_neighbor\_changes** boolean | **Choices:*** no
* yes
| Log neighbor up/down and reset reason |
| | | **maxas\_limit** integer | | Allow AS-PATH attribute from any neighbor imposing a limit on number of ASes Please refer vendor documentation for valid values |
| | | **maxcommunity\_limit** integer | | Allow COMMUNITY attribute from any neighbor imposing a limit on number of communities Please refer vendor documentation for valid values |
| | | **maxextcommunity\_limit** integer | | Allow EXTENDED COMMUNITY attribute from any neighbor imposing a limit on number of extended communities Please refer vendor documentation for valid values |
| | | **nexthop** dictionary | | Nexthop tracking commands |
| | | | **route\_map** string | | Route map for valid nexthops |
| | | | **trigger** dictionary | | nexthop trackings |
| | | | | **delay** integer | | Set the delay to tigger nexthop tracking Please refer vendor documentation for valid values |
| | | | | **enable** boolean | **Choices:*** no
* yes
| Enable nexthop tracking |
| | | **nopeerup\_delay** list / elements=dictionary | | Set how long BGP will wait for the first peer to come up before beginning the update delay or graceful restart timers (in seconds) |
| | | | **cold\_boot** integer | | How long to wait for the first peer to come up upon a cold boot Please refer vendor documentation for valid values |
| | | | **nsf\_switchover** integer | | How long to wait for the first peer, post NSF switchover Please refer vendor documentation for valid values |
| | | | **post\_boot** integer | | How long to wait for the first peer to come up once the system is already booted and all peers go down Please refer vendor documentation for valid values |
| | | | **user\_initiated** integer | | How long to wait for the first peer, post a manual clear of BGP peers by the admin user Please refer vendor documentation for valid values |
| | | **recursion** boolean | **Choices:*** no
* yes
| recursion rule for the nexthops recursion via host for the nexthops |
| | | **redistribute\_internal** boolean | **Choices:*** no
* yes
| Allow redistribution of iBGP into IGPs (dangerous) |
| | | **refresh** dictionary | | refresh |
| | | | **max\_eor\_time** integer | | Configure refresh max-eor time Please refer vendor documentation for valid values |
| | | | **stalepath\_time** integer | | Configure refresh stale-path time Please refer vendor documentation for valid values |
| | | **regexp** boolean | **Choices:*** no
* yes
| Select regular expression engine Enable bounded-execution-time regular expression engine |
| | | **route\_map** boolean | **Choices:*** no
* yes
| route-map control commands Have route-map set commands take priority over BGP commands such as next-hop unchanged |
| | | **router\_id** dictionary | | Override configured router identifier (peers will reset) |
| | | | **address** string | | Manually configured router identifier(A.B.C.D) |
| | | | **interface** string | | Use IPv4 address on interface |
| | | | **vrf** boolean | **Choices:*** no
* yes
| vrf-specific router id configuration Automatically assign per-vrf bgp router id |
| | | **scan\_time** integer | | Configure background scanner interval Please refer vendor documentation for valid values |
| | | **slow\_peer** dictionary | | Configure slow-peer |
| | | | **detection** dictionary | | Slow-peer detection |
| | | | | **set** boolean | **Choices:*** no
* yes
| Slow-peer detection |
| | | | | **threshold** integer | | Set the slow-peer detection threshold Please refer vendor documentation for valid values |
| | | | **split\_update\_group** dictionary | | Configure slow-peer split-update-group |
| | | | | **dynamic** boolean | **Choices:*** no
* yes
| Dynamically split the slow peer to slow-update group |
| | | | | **permanent** integer | | Keep the slow-peer permanently in slow-update group |
| | | **snmp** boolean | **Choices:*** no
* yes
| BGP SNMP options BGP SNMP trap options Use cbgpPeer2Type as part of index for traps |
| | | **soft\_reconfig\_backup** boolean | **Choices:*** no
* yes
| Use soft-reconfiguration inbound only when route-refresh is not negotiated |
| | | **sso** boolean | **Choices:*** no
* yes
| Stateful Switchover Enable SSO only for Route-Refresh capable peers |
| | | **suppress\_inactive** boolean | **Choices:*** no
* yes
| Suppress routes that are not in the routing table |
| | | **transport** boolean | **Choices:*** no
* yes
| Global enable/disable transport session parameters Transport path MTU discovery |
| | | **update\_delay** integer | | Set the max initial delay for sending update Please refer vendor documentation for valid values |
| | | **update\_group** boolean | **Choices:*** no
* yes
| Manage peers in bgp update groups Split update groups based on Policy Keep peers with as-override in different update groups |
| | | **upgrade\_cli** dictionary | | Upgrade to hierarchical AFI mode |
| | | | **af\_mode** boolean | **Choices:*** no
* yes
| Upgrade to AFI mode |
| | | | **set** boolean | **Choices:*** no
* yes
| enable upgrade to hierarchical AFI mode |
| | **bmp** dictionary | | BGP Monitoring Protocol) |
| | | **buffer\_size** integer | | BMP Buffer Size Please refer vendor documentation for valid values |
| | | **initial\_refresh** dictionary | | Initial Refresh options |
| | | | **delay** integer | | Delay before Initial Refresh |
| | | | **skip** boolean | **Choices:*** no
* yes
| skip all refreshes |
| | | **server** integer | | Server Information Please refer vendor documentation for valid values |
| | **default\_information** boolean | **Choices:*** no
* yes
| Control distribution of default information Distribute a default route |
| | **default\_metric** integer | | Set metric of redistributed routes Please refer vendor documentation for valid values |
| | **distance** dictionary | | Define an administrative distance |
| | | **admin** dictionary | | Administrative distance |
| | | | **acl** string | | IP Standard access list number IP Standard expanded access list number Standard access-list name |
| | | | **address** string | | IP Source address (A.B.C.D) |
| | | | **distance** integer | | Administrative distance Please refer vendor documentation for valid values |
| | | | **wildcard\_bit** string | | Wildcard bits (A.B.C.D) |
| | | **bgp** dictionary | | BGP distance |
| | | | **routes\_external** integer | | Distance for routes external to the AS Please refer vendor documentation for valid values |
| | | | **routes\_internal** integer | | Distance for routes internal to the AS Please refer vendor documentation for valid values |
| | | | **routes\_local** integer | | Distance for local routes Please refer vendor documentation for valid values |
| | | **mbgp** dictionary | | MBGP distance |
| | | | **routes\_external** integer | | Distance for routes external to the AS Please refer vendor documentation for valid values |
| | | | **routes\_internal** integer | | Distance for routes internal to the AS Please refer vendor documentation for valid values |
| | | | **routes\_local** integer | | Distance for local routes Please refer vendor documentation for valid values |
| | **distribute\_list** dictionary | | Filter networks in routing updates |
| | | **acl** string | | IP access list number/name |
| | | **in** boolean | **Choices:*** no
* yes
| Filter incoming routing updates |
| | | **interface** string | | interface details |
| | | **out** boolean | **Choices:*** no
* yes
| Filter outgoing routing updates |
| | **maximum\_paths** dictionary | | Forward packets over multiple paths |
| | | **eibgp** integer | | Both eBGP and iBGP paths as multipath |
| | | **ibgp** integer | | iBGP-multipath |
| | | **paths** integer | | Number of paths |
| | **maximum\_secondary\_paths** dictionary | | Maximum secondary paths |
| | | **eibgp** integer | | Both eBGP and iBGP paths as secondary multipath |
| | | **ibgp** integer | | iBGP-secondary-multipath |
| | | **paths** integer | | Number of secondary paths |
| | **neighbor** list / elements=dictionary | | Specify a neighbor router |
| | | **activate** boolean | **Choices:*** no
* yes
| Enable the Address Family for this Neighbor |
| | | **additional\_paths** dictionary | | Negotiate additional paths capabilities with this neighbor |
| | | | **disable** boolean | **Choices:*** no
* yes
| Disable additional paths for this neighbor |
| | | | **receive** boolean | **Choices:*** no
* yes
| Receive additional paths from neighbors |
| | | | **send** boolean | **Choices:*** no
* yes
| Send additional paths to neighbors |
| | | **address** string | | Neighbor address (A.B.C.D) |
| | | **advertise** dictionary | | Advertise to this neighbor |
| | | | **additional\_paths** dictionary | | Advertise additional paths |
| | | | | **all** boolean | **Choices:*** no
* yes
| Select all available paths |
| | | | | **best** integer | | Select best N paths (2-3). |
| | | | | **group\_best** boolean | **Choices:*** no
* yes
| Select group-best path |
| | | | **best\_external** boolean | **Choices:*** no
* yes
| Advertise best-external (at RRs best-internal) path |
| | | | **diverse\_path** dictionary | | Advertise additional paths |
| | | | | **backup** boolean | **Choices:*** no
* yes
| Diverse path can be backup path |
| | | | | **mpath** boolean | **Choices:*** no
* yes
| Diverse path can be multipath |
| | | **advertise\_map** dictionary | | specify route-map for conditional advertisement |
| | | | **exist\_map** string | | advertise prefix only if prefix is in the condition exists condition route-map name |
| | | | **name** string | | advertise route-map name |
| | | | **non\_exist\_map** string | | advertise prefix only if prefix in the condition does not exist condition route-map name |
| | | **advertisement\_interval** integer | | Minimum interval between sending BGP routing updates |
| | | **aigp** dictionary | | AIGP on neighbor |
| | | | **enable** boolean | **Choices:*** no
* yes
| Enable AIGP |
| | | | **send** dictionary | | Cost community or MED carrying AIGP VALUE |
| | | | | **cost\_community** dictionary | | Cost extended community carrying AIGP Value |
| | | | | | **id** integer | | Community ID Please refer vendor documentation for valid values |
| | | | | | **poi** dictionary | | Point of Insertion |
| | | | | | | **igp\_cost** boolean | **Choices:*** no
* yes
| Point of Insertion After IGP |
| | | | | | | **pre\_bestpath** boolean | **Choices:*** no
* yes
| Point of Insertion At Beginning |
| | | | | | | **transitive** boolean | **Choices:*** no
* yes
| Cost community is Transitive |
| | | | | **med** boolean | **Choices:*** no
* yes
| Med carrying AIGP Value |
| | | **allow\_policy** boolean | **Choices:*** no
* yes
| Enable the policy support for this IBGP Neighbor |
| | | **allowas\_in** integer | | Accept as-path with my AS present in it |
| | | **as\_override** boolean | **Choices:*** no
* yes
| Override matching AS-number while sending update Maintain Split Horizon while sending update |
| | | **bmp\_activate** dictionary | | Activate the BMP monitoring for a BGP peer |
| | | | **all** boolean | **Choices:*** no
* yes
| Activate BMP monitoring for all servers |
| | | | **server** integer | | Activate BMP for server BMP Server Number Please refer vendor documentation for valid values |
| | | **capability** dictionary | | Advertise capability to the peer Advertise ORF capability to the peer Advertise prefixlist ORF capability to this neighbor |
| | | | **both** boolean | **Choices:*** no
* yes
| Capability to SEND and RECEIVE the ORF to/from this neighbor |
| | | | **receive** boolean | **Choices:*** no
* yes
| Capability to RECEIVE the ORF from this neighbor |
| | | | **send** boolean | **Choices:*** no
* yes
| Capability to SEND the ORF to this neighbor |
| | | **cluster\_id** string | | Configure Route-Reflector Cluster-id (peers may reset) Route-Reflector Cluster-id as 32 bit quantity, or Route-Reflector Cluster-id in IP address format (A.B.C.D) |
| | | **default\_originate** dictionary | | Originate default route to this neighbor |
| | | | **route\_map** string | | Route-map to specify criteria to originate default |
| | | | **set** boolean | **Choices:*** no
* yes
| Originate default route to this neighbor |
| | | **description** string | | Neighbor specific description |
| | | **disable\_connected\_check** boolean | **Choices:*** no
* yes
| one-hop away EBGP peer using loopback address |
| | | **distribute\_list** dictionary | | Filter updates to/from this neighbor |
| | | | **acl** string | | IP access list number/name |
| | | | **in** boolean | **Choices:*** no
* yes
| Filter incoming updates |
| | | | **out** boolean | **Choices:*** no
* yes
| Filter outgoing updates |
| | | **dmzlink\_bw** boolean | **Choices:*** no
* yes
| Propagate the DMZ link bandwidth |
| | | **ebgp\_multihop** dictionary | | Allow EBGP neighbors not on directly connected networks |
| | | | **enable** boolean | **Choices:*** no
* yes
| Allow EBGP neighbors not on directly connected networks |
| | | | **hop\_count** integer | | Maximum hop count Please refer vendor documentation for valid values |
| | | **fall\_over** dictionary | | Session fall on peer route lost |
| | | | **bfd** dictionary | | Use BFD to detect failure |
| | | | | **multi\_hop** boolean | **Choices:*** no
* yes
| Force BFD multi-hop to detect failure |
| | | | | **set** boolean | **Choices:*** no
* yes
| set bfd |
| | | | | **single\_hop** boolean | **Choices:*** no
* yes
| Force BFD single-hop to detect failure |
| | | | **route\_map** string | | Route map for peer route |
| | | **filter\_list** dictionary | | Establish BGP filters |
| | | | **in** boolean | **Choices:*** no
* yes
| Filter incoming updates |
| | | | **out** boolean | **Choices:*** no
* yes
| Filter outgoing updates |
| | | | **path\_acl** string | | AS path access list |
| | | **ha\_mode** dictionary | | high availability mode |
| | | | **disable** boolean | **Choices:*** no
* yes
| disable graceful-restart |
| | | | **set** boolean | **Choices:*** no
* yes
| set ha-mode and graceful-restart for this peer |
| | | **inherit** string | | Inherit a template Inherit a peer-session template and Template name |
| | | **ipv6\_adddress** string | | Neighbor ipv6 address (X:X:X:X::X) |
| | | **local\_as** dictionary | | Specify a local-as number |
| | | | **dual\_as** boolean | **Choices:*** no
* yes
| Accept either real AS or local AS from the ebgp peer |
| | | | **no\_prepend** dictionary | | Do not prepend local-as to updates from ebgp peers |
| | | | | **replace\_as** boolean | **Choices:*** no
* yes
| Replace real AS with local AS in the EBGP updates |
| | | | | **set** boolean | **Choices:*** no
* yes
| Set prepend |
| | | | **number** integer | | AS number used as local AS Please refer vendor documentation for valid values |
| | | | **set** boolean | **Choices:*** no
* yes
| set local-as number |
| | | **log\_neighbor\_changes** dictionary | | Log neighbor up/down and reset reason |
| | | | **disable** boolean | **Choices:*** no
* yes
| disable Log neighbor up/down and reset |
| | | | **set** boolean | **Choices:*** no
* yes
| set Log neighbor up/down and reset |
| | | **maximum\_prefix** dictionary | | Maximum number of prefixes accepted from this peer |
| | | | **max\_no** integer | | maximum no. of prefix limit |
| | | | **restart** integer | | Restart bgp connection after limit is exceeded |
| | | | **threshold\_val** integer | | Threshold value (%) at which to generate a warning msg |
| | | | **warning\_only** boolean | **Choices:*** no
* yes
| Only give warning message when limit is exceeded |
| | | **next\_hop\_self** dictionary | | Disable the next hop calculation for this neighbor |
| | | | **all** boolean | **Choices:*** no
* yes
| Enable next-hop-self for both eBGP and iBGP received paths |
| | | | **set** boolean | **Choices:*** no
* yes
| Enable next-hop-self |
| | | **next\_hop\_unchanged** dictionary | | Propagate next hop unchanged for iBGP paths to this neighbor Propagate next hop unchanged for all paths (iBGP and eBGP) to this neighbor |
| | | | **allpaths** boolean | **Choices:*** no
* yes
| Propagate next hop unchanged for all paths (iBGP and eBGP) to this neighbor |
| | | | **set** boolean | **Choices:*** no
* yes
| Enable next-hop-unchanged |
| | | **password** string | | Set a password |
| | | **path\_attribute** dictionary | | BGP optional attribute filtering |
| | | | **discard** dictionary | | Discard matching path-attribute for this neighbor |
| | | | | **in** boolean | **Choices:*** no
* yes
| Perform inbound path-attribute filtering |
| | | | | **range** dictionary | | path attribute range |
| | | | | | **end** integer | | path attribute range end value Please refer vendor documentation for valid values |
| | | | | | **start** integer | | path attribute range start value Please refer vendor documentation for valid values |
| | | | | **type** integer | | path attribute type Please refer vendor documentation for valid values |
| | | | **treat\_as\_withdraw** dictionary | | Treat-as-withdraw matching path-attribute for this neighbor |
| | | | | **in** boolean | **Choices:*** no
* yes
| Perform inbound path-attribute filtering |
| | | | | **range** dictionary | | path attribute range |
| | | | | | **end** integer | | path attribute range end value Please refer vendor documentation for valid values |
| | | | | | **start** integer | | path attribute range start value Please refer vendor documentation for valid values |
| | | | | **type** integer | | path attribute type Please refer vendor documentation for valid values |
| | | **peer\_group** string | | Member of the peer-group |
| | | **remote\_as** integer | | Specify a BGP neighbor AS of remote neighbor |
| | | **remove\_private\_as** dictionary | | Remove private AS number from outbound updates |
| | | | **all** boolean | **Choices:*** no
* yes
| Remove all private AS numbers |
| | | | **replace\_as** boolean | **Choices:*** no
* yes
| Replace all private AS numbers with local AS |
| | | | **set** boolean | **Choices:*** no
* yes
| Remove private AS number |
| | | **route\_map** dictionary | | Apply route map to neighbor |
| | | | **in** boolean | **Choices:*** no
* yes
| Apply map to incoming routes |
| | | | **name** string | | Replace all private AS numbers with local AS |
| | | | **out** boolean | **Choices:*** no
* yes
| Apply map to outbound routes |
| | | **route\_reflector\_client** boolean | **Choices:*** no
* yes
| Configure a neighbor as Route Reflector client |
| | | **route\_server\_client** dictionary | | Configure a neighbor as Route Server client |
| | | | **context** string | | Specify Route Server context for neighbor Route Server context name |
| | | | **set** boolean | **Choices:*** no
* yes
| Set Route Server client |
| | | **send\_community** dictionary | | Send Community attribute to this neighbor |
| | | | **both** boolean | **Choices:*** no
* yes
| Send Standard and Extended Community attributes |
| | | | **extended** boolean | **Choices:*** no
* yes
| Send Extended Community attribute |
| | | | **set** boolean | **Choices:*** no
* yes
| Set send Community attribute to this neighbor |
| | | | **standard** boolean | **Choices:*** no
* yes
| Send Standard Community attribute |
| | | **send\_label** dictionary | | Send NLRI + MPLS Label to this peer |
| | | | **explicit\_null** boolean | **Choices:*** no
* yes
| Advertise Explicit Null label in place of Implicit Null |
| | | | **set** boolean | **Choices:*** no
* yes
| Set send NLRI + MPLS Label to this peer |
| | | **shutdown** dictionary | | Administratively shut down this neighbor |
| | | | **graceful** integer | | Gracefully shut down this neighbor time in seconds Please refer vendor documentation for valid values |
| | | | **set** boolean | **Choices:*** no
* yes
| shut down |
| | | **slow\_peer** dictionary | | Configure slow-peer |
| | | | **detection** dictionary | | Configure slow-peer |
| | | | | **disable** boolean | **Choices:*** no
* yes
| Disable slow-peer detection |
| | | | | **enable** boolean | **Choices:*** no
* yes
| Enable slow-peer detection |
| | | | | **threshold** integer | | Set the slow-peer detection threshold |
| | | | **split\_update\_group** dictionary | | Configure slow-peer split-update-group |
| | | | | **dynamic** dictionary | | Dynamically split the slow peer to slow-update group |
| | | | | | **disable** boolean | **Choices:*** no
* yes
| Disable slow-peer detection |
| | | | | | **enable** boolean | **Choices:*** no
* yes
| Enable slow-peer detection |
| | | | | | **permanent** boolean | **Choices:*** no
* yes
| Keep the slow-peer permanently in slow-update group |
| | | | | **static** boolean | **Choices:*** no
* yes
| Static slow-peer |
| | | **soft\_reconfiguration** boolean | **Choices:*** no
* yes
| Per neighbor soft reconfiguration Allow inbound soft reconfiguration for this neighbor |
| | | **tag** string | | Neighbor tag |
| | | **timers** dictionary | | BGP per neighbor timers |
| | | | **holdtime** integer | | Holdtime |
| | | | **interval** integer | | Keepalive interval |
| | | | **min\_holdtime** integer | | Minimum hold time from neighbor |
| | | **translate\_update** dictionary | | Translate Update to MBGP format |
| | | | **nlri** dictionary | | Specify type of nlri to translate to |
| | | | | **multicast** boolean | **Choices:*** no
* yes
| Translate Update to multicast nlri |
| | | | | **unicast** boolean | **Choices:*** no
* yes
| Process Update as unicast nlri |
| | | | **set** boolean | **Choices:*** no
* yes
| Set Translate Update |
| | | **transport** dictionary | | Transport options |
| | | | **connection\_mode** dictionary | | Specify passive or active connection |
| | | | | **active** boolean | **Choices:*** no
* yes
| Actively establish the TCP session |
| | | | | **passive** boolean | **Choices:*** no
* yes
| Passively establish the TCP session |
| | | | **multi\_session** boolean | **Choices:*** no
* yes
| Use Multi-session for transport |
| | | | **path\_mtu\_discovery** dictionary | | Use transport path MTU discovery |
| | | | | **disable** boolean | **Choices:*** no
* yes
| disable |
| | | | | **set** boolean | **Choices:*** no
* yes
| Use path MTU discovery |
| | | **ttl\_security** integer | | BGP ttl security check maximum number of hops Please refer vendor documentation for valid values |
| | | **unsuppress\_map** string | | Route-map to selectively unsuppress suppressed routes Name of route map |
| | | **version** integer | | Set the BGP version to match a neighbor Neighbor's BGP version Please refer vendor documentation for valid values |
| | | **weight** integer | | Set default weight for routes from this neighbor |
| | **redistribute** list / elements=dictionary | | Redistribute information from another routing protocol |
| | | **application** dictionary | | Application |
| | | | **metric** integer | | Metric for redistributed routes |
| | | | **name** string | | Application name |
| | | | **route\_map** string | | Route map reference |
| | | **bgp** dictionary | | Border Gateway Protocol (BGP) |
| | | | **as\_number** string | | Autonomous system number |
| | | | **metric** integer | | Metric for redistributed routes |
| | | | **route\_map** string | | Route map reference |
| | | **connected** dictionary | | Connected |
| | | | **metric** integer | | Metric for redistributed routes |
| | | | **route\_map** string | | Route map reference |
| | | **eigrp** dictionary | | Enhanced Interior Gateway Routing Protocol (EIGRP) |
| | | | **as\_number** string | | Autonomous system number |
| | | | **metric** integer | | Metric for redistributed routes |
| | | | **route\_map** string | | Route map reference |
| | | **isis** dictionary | | ISO IS-IS |
| | | | **area\_tag** string | | ISO routing area tag |
| | | | **clns** boolean | **Choices:*** no
* yes
| Redistribution of OSI dynamic routes |
| | | | **ip** boolean | **Choices:*** no
* yes
| Redistribution of IP dynamic routes |
| | | | **metric** integer | | Metric for redistributed routes |
| | | | **route\_map** string | | Route map reference |
| | | **iso\_igrp** dictionary | | IGRP for OSI networks |
| | | | **area\_tag** string | | ISO routing area tag |
| | | | **route\_map** string | | Route map reference |
| | | **lisp** dictionary | | Locator ID Separation Protocol (LISP) |
| | | | **metric** integer | | Metric for redistributed routes |
| | | | **route\_map** string | | Route map reference |
| | | **mobile** dictionary | | Mobile routes |
| | | | **metric** integer | | Metric for redistributed routes |
| | | | **route\_map** string | | Route map reference |
| | | **odr** dictionary | | On Demand stub Routes |
| | | | **metric** integer | | Metric for redistributed routes |
| | | | **route\_map** string | | Route map reference |
| | | **ospf** dictionary | | Open Shortest Path First (OSPF) |
| | | | **match** dictionary | | On Demand stub Routes |
| | | | | **external** boolean | **Choices:*** no
* yes
| Redistribute OSPF external routes |
| | | | | **internal** boolean | **Choices:*** no
* yes
| Redistribute OSPF internal routes |
| | | | | **nssa\_external** boolean | **Choices:*** no
* yes
| Redistribute OSPF NSSA external routes |
| | | | | **type\_1** boolean | **Choices:*** no
* yes
| Redistribute NSSA external type 1 routes |
| | | | | **type\_2** boolean | **Choices:*** no
* yes
| Redistribute NSSA external type 2 routes |
| | | | **metric** integer | | Metric for redistributed routes |
| | | | **process\_id** integer | | Process ID |
| | | | **route\_map** string | | Route map reference |
| | | | **vrf** string | | VPN Routing/Forwarding Instance |
| | | **ospfv3** dictionary | | OSPFv3 |
| | | | **match** dictionary | | On Demand stub Routes |
| | | | | **external** boolean | **Choices:*** no
* yes
| Redistribute OSPF external routes |
| | | | | **internal** boolean | **Choices:*** no
* yes
| Redistribute OSPF internal routes |
| | | | | **nssa\_external** boolean | **Choices:*** no
* yes
| Redistribute OSPF NSSA external routes |
| | | | | **type\_1** boolean | **Choices:*** no
* yes
| Redistribute NSSA external type 1 routes |
| | | | | **type\_2** boolean | **Choices:*** no
* yes
| Redistribute NSSA external type 2 routes |
| | | | **metric** integer | | Metric for redistributed routes |
| | | | **process\_id** integer | | Process ID |
| | | | **route\_map** string | | Route map reference |
| | | **rip** dictionary | | Routing Information Protocol (RIP) |
| | | | **metric** integer | | Metric for redistributed routes |
| | | | **route\_map** string | | Route map reference |
| | | **static** dictionary | | Static routes |
| | | | **clns** boolean | **Choices:*** no
* yes
| Redistribution of OSI static routes |
| | | | **ip** boolean | **Choices:*** no
* yes
| Redistribution of IP static routes |
| | | | **metric** integer | | Metric for redistributed routes |
| | | | **route\_map** string | | Route map reference |
| | | **vrf** dictionary | | Specify a source VRF |
| | | | **global** boolean | **Choices:*** no
* yes
| global VRF |
| | | | **name** string | | Source VRF name |
| | **route\_server\_context** dictionary | | Enter route server context command mode |
| | | **address\_family** dictionary | | Enter address family command mode |
| | | | **afi** string | **Choices:*** ipv4
* ipv6
| Address family |
| | | | **import\_map** string | | Import matching routes using a route map Name of route map |
| | | | **modifier** string | **Choices:*** multicast
* unicast
| Address Family modifier |
| | | **description** string | | Textual description of the router server context |
| | | **name** string | | Name of route server context |
| | **scope** dictionary | | Enter scope command mode |
| | | **global** boolean | **Choices:*** no
* yes
| Global scope |
| | | **vrf** string | | VRF scope VPN Routing/Forwarding instance name |
| | **synchronization** boolean | **Choices:*** no
* yes
| Perform IGP synchronization |
| | **table\_map** dictionary | | Map external entry attributes into routing table |
| | | **filter** boolean | **Choices:*** no
* yes
| Selective route download |
| | | **name** string | | route-map name |
| | **template** dictionary | | Enter template command mode |
| | | **peer\_policy** string | | Template configuration for policy parameters |
| | | **peer\_session** string | | Template configuration for session parameters |
| | **timers** dictionary | | Adjust routing timers BGP timers |
| | | **holdtime** integer | | Holdtime |
| | | **keepalive** integer | | Keepalive interval |
| | | **min\_holdtime** integer | | Minimum hold time from neighbor |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **sh running-config | section ^router bgp**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* deleted
* purged
* gathered
* rendered
* parsed
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL
Examples
--------
```
# Using merged
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
- name: Merge provided configuration with device configuration
cisco.ios.ios_bgp_global:
config:
as_number: 65000
bgp:
advertise_best_external: true
bestpath:
- compare_routerid: true
nopeerup_delay:
- post_boot: 10
dampening:
penalty_half_time: 1
reuse_route_val: 1
suppress_route_val: 1
max_suppress: 1
graceful_shutdown:
neighbors:
time: 50
community: 100
local_preference: 100
neighbor:
- address: 198.51.100.1
description: merge neighbor
remote_as: 100
aigp:
send:
cost_community:
id: 100
poi:
igp_cost: true
transitive: true
route_map:
name: test-route
out: true
state: merged
# Commands fired:
# ---------------
#
# "commands": [
# "router bgp 65000",
# "bgp dampening 1 1 1 1",
# "bgp graceful-shutdown all neighbors 50 community 100 local-preference 100",
# "bgp advertise-best-external",
# "bgp nopeerup-delay post-boot 10",
# "bgp bestpath compare-routerid",
# "neighbor 198.51.100.1 remote-as 100",
# "neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "neighbor 198.51.100.1 description merge neighbor",
# "neighbor 198.51.100.1 route-map test-route out"
# ]
# After state:
# ------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
# Using replaced
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: Replaces device configuration of listed global BGP with provided configuration
cisco.ios.ios_bgp_global:
config:
as_number: 65000
bgp:
advertise_best_external: true
bestpath:
- med:
confed: true
log_neighbor_changes: true
nopeerup_delay:
- post_boot: 10
cold_boot: 20
neighbor:
- address: 192.0.2.1
description: replace neighbor
remote_as: 100
slow_peer:
detection:
disable: true
state: replaced
# Commands fired:
# ---------------
#
# "commands": [
# "router bgp 65000"
# "no bgp dampening 1 1 1 1"
# "no timers bgp 100 200 150"
# "no bgp bestpath compare-routerid"
# "bgp bestpath med confed"
# "bgp nopeerup-delay cold-boot 20"
# "no neighbor 198.51.100.1 remote-as 100"
# "neighbor 192.0.2.1 remote-as 100"
# "no bgp graceful-shutdown all neighbors 50 local-preference 100 community 100"
# "no neighbor 198.51.100.1 route-map test-route out"
# "no neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive"
# "no neighbor 198.51.100.1 description merge neighbor"
# "neighbor 192.0.2.1 slow-peer detection disable"
# "neighbor 192.0.2.1 description replace neighbor"
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp log-neighbor-changes
# bgp nopeerup-delay cold-boot 20
# bgp nopeerup-delay post-boot 10
# bgp bestpath med confed
# bgp advertise-best-external
# redistribute connected metric 10
# neighbor 192.0.2.1 remote-as 100
# neighbor 192.0.2.1 description replace neighbor
# neighbor 192.0.2.1 slow-peer detection disable
# Using Deleted
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: "Delete global BGP (Note: This won't delete the configured global BGP)"
cisco.ios.ios_bgp_global:
config:
as_number: 65000
state: deleted
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "no bgp dampening 1 1 1 1",
# "no bgp graceful-shutdown all neighbors 50 community 100 local-preference 100",
# "no bgp advertise-best-external",
# "no bgp bestpath compare-routerid",
# "no bgp nopeerup-delay post-boot 10",
# "no neighbor 198.51.100.1 remote-as 100",
# "no neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "no neighbor 198.51.100.1 description merge neighbor",
# "no neighbor 198.51.100.1 route-map test-route out"
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# Using Deleted without any config passed
#"(NOTE: This will delete all of configured global BGP)"
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: "Delete global BGP without config"
cisco.ios.ios_bgp_global:
state: deleted
# Commands fired:
# ---------------
# "commands": [
# "router bgp 65000",
# "no bgp dampening 1 1 1 1",
# "no bgp graceful-shutdown all neighbors 50 community 100 local-preference 100",
# "no bgp advertise-best-external",
# "no bgp bestpath compare-routerid",
# "no bgp nopeerup-delay post-boot 10",
# "no neighbor 198.51.100.1 remote-as 100",
# "no neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "no neighbor 198.51.100.1 description merge neighbor",
# "no neighbor 198.51.100.1 route-map test-route out"
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# Using Purged
#"(NOTE: This WILL delete the configured global BGP)"
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: 'Delete the configured global BGP (Note: This WILL delete the the configured
global BGP)'
cisco.ios.ios_bgp_global:
state: purged
# Commands fired:
# ---------------
# "commands": [
# "no router bgp 65000",
# ]
# After state:
# -------------
#
# vios#sh running-config | section ^router bgp
# Using Gathered
# Before state:
# -------------
#
# vios#sh running-config | section ^router bgp
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: Gather listed global BGP with provided configurations
cisco.ios.ios_bgp_global:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": {
# "as_number": "65000",
# "bgp": {
# "advertise_best_external": true,
# "bestpath": [
# {
# "compare_routerid": true
# }
# ],
# "dampening": {
# "max_suppress": 1,
# "penalty_half_time": 1,
# "reuse_route_val": 1,
# "suppress_route_val": 1
# },
# "graceful_shutdown": {
# "community": "100",
# "local_preference": 100,
# "neighbors": {
# "time": 50
# }
# },
# "nopeerup_delay": [
# {
# "post_boot": 10
# }
# ]
# },
# "neighbor": [
# {
# "address": "198.51.100.1",
# "aigp": {
# "send": {
# "cost_community": {
# "id": 100,
# "poi": {
# "igp_cost": true,
# "transitive": true
# }
# }
# }
# },
# "description": "merge neighbor",
# "remote_as": 100,
# "route_map": {
# "name": "test-route",
# "out": true
# }
# }
# ]
# }
# Using Rendered
- name: Rendered the provided configuration with the existing running configuration
cisco.ios.ios_bgp_global:
config:
as_number: 65000
bgp:
advertise_best_external: true
bestpath:
- compare_routerid: true
nopeerup_delay:
- post_boot: 10
dampening:
penalty_half_time: 1
reuse_route_val: 1
suppress_route_val: 1
max_suppress: 1
graceful_shutdown:
neighbors:
time: 50
community: 100
local_preference: 100
neighbor:
- address: 198.51.100.1
description: merge neighbor
remote_as: 100
aigp:
send:
cost_community:
id: 100
poi:
igp_cost: true
transitive: true
route_map:
name: test-route
out: true
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "router bgp 65000",
# "bgp dampening 1 1 1 1",
# "bgp graceful-shutdown all neighbors 50 community 100 local-preference 100",
# "bgp advertise-best-external",
# "bgp nopeerup-delay post-boot 10",
# "bgp bestpath compare-routerid",
# "neighbor 198.51.100.1 remote-as 100",
# "neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive",
# "neighbor 198.51.100.1 description merge neighbor",
# "neighbor 198.51.100.1 route-map test-route out"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# router bgp 65000
# bgp nopeerup-delay post-boot 10
# bgp graceful-shutdown all neighbors 50 local-preference 100 community 100
# bgp bestpath compare-routerid
# bgp dampening 1 1 1 1
# bgp advertise-best-external
# neighbor 198.51.100.1 remote-as 100
# neighbor 198.51.100.1 description merge neighbor
# neighbor 198.51.100.1 aigp send cost-community 100 poi igp-cost transitive
# neighbor 198.51.100.1 route-map test-route out
- name: Parse the commands for provided configuration
cisco.ios.ios_bgp_global:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": {
# "as_number": "65000",
# "bgp": {
# "advertise_best_external": true,
# "bestpath": [
# {
# "compare_routerid": true
# }
# ],
# "dampening": {
# "max_suppress": 1,
# "penalty_half_time": 1,
# "reuse_route_val": 1,
# "suppress_route_val": 1
# },
# "graceful_shutdown": {
# "community": "100",
# "local_preference": 100,
# "neighbors": {
# "time": 50
# }
# },
# "nopeerup_delay": [
# {
# "post_boot": 10
# }
# ]
# },
# "neighbor": [
# {
# "address": "198.51.100.1",
# "aigp": {
# "send": {
# "cost_community": {
# "id": 100,
# "poi": {
# "igp_cost": true,
# "transitive": true
# }
# }
# }
# },
# "description": "merge neighbor",
# "remote_as": 100,
# "route_map": {
# "name": "test-route",
# "out": true
# }
# }
# ]
# }
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device **Sample:** ['router bgp 65000', 'bgp nopeerup-delay post-boot 10', 'bgp advertise-best-external'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ios.ios_command β Run commands on remote devices running Cisco IOS cisco.ios.ios\_command β Run commands on remote devices running Cisco IOS
=========================================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_command`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Sends arbitrary commands to an ios node and returns the results read from the device. This module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met.
* This module does not support running commands in configuration mode. Please use M(ios\_config) to configure IOS devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **commands** list / elements=raw / required | | List of commands to send to the remote ios device over the configured provider. The resulting output from the command is returned. If the *wait\_for* argument is provided, the module is not returned until the condition is satisfied or the number of retries has expired. If a command sent to the device requires answering a prompt, it is possible to pass a dict containing *command*, *answer* and *prompt*. Common answers are 'y' or "\r" (carriage return, must be double quotes). See examples. |
| **interval** integer | **Default:**1 | Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified conditions, the interval indicates how long to wait before trying the command again. |
| **match** string | **Choices:*** any
* **all** β
| The *match* argument is used in conjunction with the *wait\_for* argument to specify the match policy. Valid values are `all` or `any`. If the value is set to `all` then all conditionals in the wait\_for must be satisfied. If the value is set to `any` then only one of the values must be satisfied. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [https://docs.ansible.com/ansible/latest/network/user\_guide/platform\_ios.html](../../../network/user_guide/platform_ios). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** **no** β
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **retries** integer | **Default:**10 | Specifies the number of retries a command should by tried before it is considered failed. The command is run on the target device every retry and evaluated against the *wait\_for* conditions. |
| **wait\_for** list / elements=string | | List of conditions to evaluate against the output of the command. The task will wait for each condition to be true before moving forward. If the conditional is not true within the configured number of retries, the task fails. See examples.
aliases: waitfor |
Notes
-----
Note
* Tested against IOS 15.6
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
* For more information on using Ansible to manage Cisco devices see the [Cisco integration page](https://www.ansible.com/integrations/networks/cisco).
Examples
--------
```
- name: run show version on remote devices
cisco.ios.ios_command:
commands: show version
- name: run show version and check to see if output contains IOS
cisco.ios.ios_command:
commands: show version
wait_for: result[0] contains IOS
- name: run multiple commands on remote nodes
cisco.ios.ios_command:
commands:
- show version
- show interfaces
- name: run multiple commands and evaluate the output
cisco.ios.ios_command:
commands:
- show version
- show interfaces
wait_for:
- result[0] contains IOS
- result[1] contains Loopback0
- name: run commands that require answering a prompt
cisco.ios.ios_command:
commands:
- command: 'clear counters GigabitEthernet0/1'
prompt: 'Clear "show interface" counters on this interface \[confirm\]'
answer: 'y'
- command: 'clear counters GigabitEthernet0/2'
prompt: '[confirm]'
answer: '\r'
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **failed\_conditions** list / elements=string | failed | The list of conditionals that have failed **Sample:** ['...', '...'] |
| **stdout** list / elements=string | always apart from low level errors (such as action plugin) | The set of responses from the commands **Sample:** ['...', '...'] |
| **stdout\_lines** list / elements=string | always apart from low level errors (such as action plugin) | The value of stdout split into a list **Sample:** [['...', '...'], ['...'], ['...']] |
### Authors
* Peter Sprygada (@privateip)
ansible cisco.ios.ios_lag_interfaces β LAG interfaces resource module cisco.ios.ios\_lag\_interfaces β LAG interfaces resource module
===============================================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_lag_interfaces`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module manages properties of Link Aggregation Group on Cisco IOS devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A list of link aggregation group configurations. |
| | **members** list / elements=dictionary | | Interface options for the link aggregation group. |
| | | **link** integer | | Assign a link identifier used for load-balancing. Refer to vendor documentation for valid values. NOTE, parameter only supported on Cisco IOS XE platform. |
| | | **member** string | | Interface member of the link aggregation group. |
| | | **mode** string / required | **Choices:*** auto
* on
* desirable
* active
* passive
| Etherchannel Mode of the interface for link aggregation. On mode has to be quoted as 'on' or else pyyaml will convert to True before it gets to Ansible. |
| | **name** string / required | | ID of Ethernet Channel of interfaces. Refer to vendor documentation for valid port values. |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **show running-config | section ^interface**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* rendered
* parsed
* gathered
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL.
Examples
--------
```
# Using merged
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface GigabitEthernet0/1
# shutdown
# interface GigabitEthernet0/2
# shutdown
# interface GigabitEthernet0/3
# shutdown
# interface GigabitEthernet0/4
# shutdown
- name: Merge provided configuration with device configuration
cisco.ios.ios_lag_interfaces:
config:
- name: 10
members:
- member: GigabitEthernet0/1
mode: auto
- member: GigabitEthernet0/2
mode: auto
- name: 20
members:
- member: GigabitEthernet0/3
mode: on
- name: 30
members:
- member: GigabitEthernet0/4
mode: active
state: merged
# After state:
# ------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# channel-group 10 mode auto
# interface GigabitEthernet0/2
# shutdown
# channel-group 10 mode auto
# interface GigabitEthernet0/3
# shutdown
# channel-group 20 mode on
# interface GigabitEthernet0/4
# shutdown
# channel-group 30 mode active
# Using overridden
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# channel-group 10 mode auto
# interface GigabitEthernet0/2
# shutdown
# channel-group 10 mode auto
# interface GigabitEthernet0/3
# shutdown
# channel-group 20 mode on
# interface GigabitEthernet0/4
# shutdown
# channel-group 30 mode active
- name: Override device configuration of all interfaces with provided configuration
cisco.ios.ios_lag_interfaces:
config:
- name: 20
members:
- member: GigabitEthernet0/2
mode: auto
- member: GigabitEthernet0/3
mode: auto
state: overridden
# After state:
# ------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# interface GigabitEthernet0/2
# shutdown
# channel-group 20 mode auto
# interface GigabitEthernet0/3
# shutdown
# channel-group 20 mode auto
# interface GigabitEthernet0/4
# shutdown
# Using replaced
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# channel-group 10 mode auto
# interface GigabitEthernet0/2
# shutdown
# channel-group 10 mode auto
# interface GigabitEthernet0/3
# shutdown
# channel-group 20 mode on
# interface GigabitEthernet0/4
# shutdown
# channel-group 30 mode active
- name: Replaces device configuration of listed interfaces with provided configuration
cisco.ios.ios_lag_interfaces:
config:
- name: 40
members:
- member: GigabitEthernet0/3
mode: auto
state: replaced
# After state:
# ------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface Port-channel40
# interface GigabitEthernet0/1
# shutdown
# channel-group 10 mode auto
# interface GigabitEthernet0/2
# shutdown
# channel-group 10 mode auto
# interface GigabitEthernet0/3
# shutdown
# channel-group 40 mode on
# interface GigabitEthernet0/4
# shutdown
# channel-group 30 mode active
# Using Deleted
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# channel-group 10 mode auto
# interface GigabitEthernet0/2
# shutdown
# channel-group 10 mode auto
# interface GigabitEthernet0/3
# shutdown
# channel-group 20 mode on
# interface GigabitEthernet0/4
# shutdown
# channel-group 30 mode active
- name: "Delete LAG attributes of given interfaces (Note: This won't delete the interface itself)"
cisco.ios.ios_lag_interfaces:
config:
- name: 10
- name: 20
state: deleted
# After state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# interface GigabitEthernet0/2
# shutdown
# interface GigabitEthernet0/3
# shutdown
# interface GigabitEthernet0/4
# shutdown
# channel-group 30 mode active
# Using Deleted without any config passed
#"(NOTE: This will delete all of configured LLDP module attributes)"
#
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# channel-group 10 mode auto
# interface GigabitEthernet0/2
# shutdown
# channel-group 10 mode auto
# interface GigabitEthernet0/3
# shutdown
# channel-group 20 mode on
# interface GigabitEthernet0/4
# shutdown
# channel-group 30 mode active
- name: "Delete all configured LAG attributes for interfaces (Note: This won't delete the interface itself)"
cisco.ios.ios_lag_interfaces:
state: deleted
# After state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel10
# interface Port-channel20
# interface Port-channel30
# interface GigabitEthernet0/1
# shutdown
# interface GigabitEthernet0/2
# shutdown
# interface GigabitEthernet0/3
# shutdown
# interface GigabitEthernet0/4
# shutdown
# Using Gathered
# Before state:
# -------------
#
# vios#show running-config | section ^interface
# interface Port-channel11
# interface Port-channel22
# interface GigabitEthernet0/1
# shutdown
# channel-group 11 mode active
# interface GigabitEthernet0/2
# shutdown
# channel-group 22 mode active
- name: Gather listed LAG interfaces with provided configurations
cisco.ios.ios_lag_interfaces:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "members": [
# {
# "member": "GigabitEthernet0/1",
# "mode": "active"
# }
# ],
# "name": "Port-channel11"
# },
# {
# "members": [
# {
# "member": "GigabitEthernet0/2",
# "mode": "active"
# }
# ],
# "name": "Port-channel22"
# }
# ]
# After state:
# ------------
#
# vios#sh running-config | section ^interface
# interface Port-channel11
# interface Port-channel22
# interface GigabitEthernet0/1
# shutdown
# channel-group 11 mode active
# interface GigabitEthernet0/2
# shutdown
# channel-group 22 mode active
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_lag_interfaces:
config:
- name: Port-channel11
members:
- member: GigabitEthernet0/1
mode: active
- name: Port-channel22
members:
- member: GigabitEthernet0/2
mode: passive
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "interface GigabitEthernet0/1",
# "channel-group 11 mode active",
# "interface GigabitEthernet0/2",
# "channel-group 22 mode passive",
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# interface GigabitEthernet0/1
# channel-group 11 mode active
# interface GigabitEthernet0/2
# channel-group 22 mode passive
- name: Parse the commands for provided configuration
cisco.ios.ios_lag_interfaces:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "members": [
# {
# "member": "GigabitEthernet0/1",
# "mode": "active"
# }
# ],
# "name": "Port-channel11"
# },
# {
# "members": [
# {
# "member": "GigabitEthernet0/2",
# "mode": "passive"
# }
# ],
# "name": "Port-channel22"
# }
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device **Sample:** ['interface GigabitEthernet0/1', 'channel-group 1 mode active'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ios.ios_ospfv2 β OSPFv2 resource module cisco.ios.ios\_ospfv2 β OSPFv2 resource module
==============================================
Note
This plugin is part of the [cisco.ios collection](https://galaxy.ansible.com/cisco/ios) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ios`.
To use it in a playbook, specify: `cisco.ios.ios_ospfv2`.
New in version 1.0.0: of cisco.ios
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module configures and manages the Open Shortest Path First (OSPF) version 2 on IOS platforms.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** dictionary | | A dictionary of OSPF options. |
| | **processes** list / elements=dictionary | | List of OSPF instance configurations. |
| | | **address\_family** dictionary | | Router Address Family configuration mode |
| | | | **default** boolean | **Choices:*** no
* yes
| Set a command to its defaults |
| | | | **snmp\_context** string | | Modify snmp parameters Configure SNMP context name |
| | | | **topology** dictionary | | Associate the routing protocol to a topology instance |
| | | | | **base** boolean | **Choices:*** no
* yes
| Entering router topology sub mode |
| | | | | **name** string | | Routing topology instance name |
| | | | | **tid** boolean | **Choices:*** no
* yes
| Configuring the routing protocol topology tid Note, please refer vendor documentation for valid values |
| | | **adjacency** dictionary | | To configure control adjacency formation |
| | | | **max\_adjacency** integer | | Maximum number of adjacencies allowed to be forming Please refer vendor documentation for valid values |
| | | | **min\_adjacency** integer | | Initial number of adjacencies allowed to be forming in an area Please refer vendor documentation for valid values |
| | | | **none** boolean | **Choices:*** no
* yes
| No initial |
| | | **areas** list / elements=dictionary | | OSPF area parameters |
| | | | **area\_id** string | | OSPF area ID as a decimal value. Please refer vendor documentation of Valid values. OSPF area ID in IP address format(e.g. A.B.C.D) |
| | | | **authentication** dictionary | | Area authentication |
| | | | | **enable** boolean | **Choices:*** no
* yes
| Enable area authentication |
| | | | | **message\_digest** boolean | **Choices:*** no
* yes
| Use IPsec authentication |
| | | | **capability** boolean | **Choices:*** no
* yes
| Enable area specific capability Enable exclusion of links from base topology |
| | | | **default\_cost** integer | | Set the summary default-cost of a NSSA/stub area Stub's advertised external route metric Note, please refer vendor documentation for respective valid values |
| | | | **filter\_list** list / elements=dictionary | | Filter networks between OSPF areas |
| | | | | **direction** string / required | **Choices:*** in
* out
| The direction to apply on the filter networks sent to and from this area. |
| | | | | **name** string | | Name of an IP prefix-list |
| | | | **nssa** dictionary | | Specify a NSSA area |
| | | | | **default\_information\_originate** dictionary | | Originate Type 7 default into NSSA area |
| | | | | | **metric** integer | | OSPF default metric |
| | | | | | **metric\_type** integer | **Choices:*** 1
* 2
| OSPF metric type for default routes OSPF Link State type |
| | | | | | **nssa\_only** boolean | **Choices:*** no
* yes
| Limit default advertisement to this NSSA area |
| | | | | **no\_ext\_capability** boolean | **Choices:*** no
* yes
| Do not send domain specific capabilities into NSSA |
| | | | | **no\_redistribution** boolean | **Choices:*** no
* yes
| No redistribution into this NSSA area |
| | | | | **no\_summary** boolean | **Choices:*** no
* yes
| Do not send summary LSA into NSSA |
| | | | | **set** boolean | **Choices:*** no
* yes
| Enable a NSSA area |
| | | | | **translate** string | **Choices:*** always
* suppress-fa
| Translate LSA Always translate LSAs on this ABR Suppress forwarding address in translated LSAs |
| | | | **ranges** list / elements=dictionary | | Summarize routes matching address/mask (border routers only) |
| | | | | **address** string | | IP address to match |
| | | | | **advertise** boolean | **Choices:*** no
* yes
| Advertise this range (default) Since, advertise when enabled is not shown in running-config idempotency won't be maintained for the play in the second or next run of the play. |
| | | | | **cost** integer | | User specified metric for this range |
| | | | | **netmask** string | | IP mask for address |
| | | | | **not\_advertise** boolean | **Choices:*** no
* yes
| DoNotAdvertise this range |
| | | | **sham\_link** dictionary | | Define a sham link and its parameters |
| | | | | **cost** integer | | Associate a cost with the sham-link Cost of the sham-link Note, please refer vendor documentation for respective valid values |
| | | | | **destination** string | | IP addr associated with sham-link destination (A.B.C.D) |
| | | | | **source** string | | IP addr associated with sham-link source (A.B.C.D) |
| | | | | **ttl\_security** integer | | TTL security check Maximum number of IP hops allowed |
| | | | **stub** dictionary | | Specify a stub area Backbone can not be configured as stub area |
| | | | | **no\_ext\_capability** boolean | **Choices:*** no
* yes
| Do not send domain specific capabilities into stub area |
| | | | | **no\_summary** boolean | **Choices:*** no
* yes
| Do not send summary LSA into stub area |
| | | | | **set** boolean | **Choices:*** no
* yes
| Enable a stub area |
| | | **auto\_cost** dictionary | | Calculate OSPF interface cost according to bandwidth |
| | | | **reference\_bandwidth** integer | | Use reference bandwidth method to assign OSPF cost Note, refer vendor documentation for respective valid values |
| | | | **set** boolean | **Choices:*** no
* yes
| Enable OSPF auto-cost |
| | | **bfd** boolean | **Choices:*** no
* yes
| BFD configuration commands Enable BFD on all interfaces |
| | | **capability** dictionary | | Enable specific OSPF feature |
| | | | **lls** boolean | **Choices:*** no
* yes
| Link-local Signaling (LLS) support |
| | | | **opaque** boolean | **Choices:*** no
* yes
| Opaque LSA |
| | | | **transit** boolean | **Choices:*** no
* yes
| Transit Area |
| | | | **vrf\_lite** boolean | **Choices:*** no
* yes
| Do not perform PE specific checks |
| | | **compatible** dictionary | | OSPF router compatibility list |
| | | | **rfc1583** boolean | **Choices:*** no
* yes
| compatible with RFC 1583 |
| | | | **rfc1587** boolean | **Choices:*** no
* yes
| compatible with RFC 1587 |
| | | | **rfc5243** boolean | **Choices:*** no
* yes
| supports DBD exchange optimization |
| | | **default\_information** dictionary | | Control distribution of default information |
| | | | **always** boolean | **Choices:*** no
* yes
| Always advertise default route |
| | | | **metric** integer | | OSPF default metric Note, refer vendor documentation for respective valid values |
| | | | **metric\_type** integer | | OSPF metric type for default routes Note, please refer vendor documentation for respective valid range |
| | | | **originate** boolean | **Choices:*** no
* yes
| Distribute a default route |
| | | | **route\_map** string | | Route-map reference name |
| | | **default\_metric** integer | | Set metric of redistributed routes |
| | | **discard\_route** dictionary | | Enable or disable discard-route installation |
| | | | **external** integer | | Discard route for redistributed summarised routes Administrative distance for redistributed summarised routes Note, please refer vendor documentation for respective valid range |
| | | | **internal** integer | | Discard route for summarised internal routes Administrative distance for summarised internal routes Note, please refer vendor documentation for respective valid range |
| | | | **set** boolean | **Choices:*** no
* yes
| Enable discard-route installation |
| | | **distance** dictionary | | Define an administrative distance |
| | | | **admin\_distance** dictionary | | OSPF Administrative distance |
| | | | | **acl** string | | Access-list name/number |
| | | | | **address** string | | IP Source address |
| | | | | **distance** integer | | Administrative distance |
| | | | | **wildcard\_bits** string | | Wildcard bits |
| | | | **ospf** dictionary | | OSPF distance |
| | | | | **external** integer | | External type 5 and type 7 routes |
| | | | | **inter\_area** integer | | Inter-area routes |
| | | | | **intra\_area** integer | | Intra-area routes |
| | | **distribute\_list** dictionary | | Filter networks in routing updates |
| | | | **acls** list / elements=dictionary | | IP access list |
| | | | | **direction** string / required | **Choices:*** in
* out
| Filter incoming and outgoing routing updates. |
| | | | | **interface** string | | Interface configuration (GigabitEthernet A/B) Valid with incoming traffic |
| | | | | **name** string / required | | IP access list name/number |
| | | | | **protocol** string | | Protocol config (bgp 1). Valid with outgoing traffic |
| | | | **prefix** dictionary | | Filter prefixes in routing updates |
| | | | | **direction** string / required | **Choices:*** in
* out
| Filter incoming and outgoing routing updates. |
| | | | | **gateway\_name** string | | Gateway name for filtering incoming updates based on gateway |
| | | | | **interface** string | | Interface configuration (GigabitEthernet A/B) Valid with incoming traffic |
| | | | | **name** string / required | | Name of an IP prefix-list |
| | | | | **protocol** string | | Protocol config (bgp 1). Valid with outgoing traffic |
| | | | **route\_map** dictionary | | Filter prefixes in routing updates |
| | | | | **name** string / required | | Route-map name |
| | | **domain\_id** dictionary | | OSPF domain-id |
| | | | **ip\_address** dictionary | | IP address |
| | | | | **address** string | | OSPF domain ID in IP address format |
| | | | | **secondary** boolean | **Choices:*** no
* yes
| Secondary Domain-ID |
| | | | **null** boolean | **Choices:*** no
* yes
| Null Domain-ID |
| | | **domain\_tag** integer | | OSPF domain-tag which is OSPF domain tag - 32-bit value Note, please refer vendor documentation for respective valid range |
| | | **event\_log** dictionary | | Event Logging |
| | | | **enable** boolean | **Choices:*** no
* yes
| Enable event Logging |
| | | | **one\_shot** boolean | **Choices:*** no
* yes
| Disable Logging When Log Buffer Becomes Full |
| | | | **pause** boolean | **Choices:*** no
* yes
| Pause Event Logging |
| | | | **size** integer | | Maximum Number of Events Stored in the Event Log Note, refer vendor documentation for respective valid values |
| | | **help** boolean | **Choices:*** no
* yes
| Description of the interactive help system |
| | | **ignore** boolean | **Choices:*** no
* yes
| Do not complain about specific event Do not complain upon receiving LSA of the specified type, MOSPF Type 6 LSA |
| | | **interface\_id** boolean | **Choices:*** no
* yes
| Source of the interface ID SNMP MIB ifIndex |
| | | **ispf** boolean | **Choices:*** no
* yes
| Enable incremental SPF computation |
| | | **limit** dictionary | | Limit a specific OSPF feature and LS update, DBD, and LS request retransmissions |
| | | | **dc** dictionary | | Demand circuit retransmissions |
| | | | | **disable** boolean | **Choices:*** no
* yes
| Disble the feature |
| | | | | **number** integer | | The maximum number of retransmissions |
| | | | **non\_dc** dictionary | | Non-demand-circuit retransmissions |
| | | | | **disable** boolean | **Choices:*** no
* yes
| Disble the feature |
| | | | | **number** integer | | The maximum number of retransmissions |
| | | **local\_rib\_criteria** dictionary | | Enable or disable usage of local RIB as route criteria |
| | | | **enable** boolean | **Choices:*** no
* yes
| Enable usage of local RIB as route criteria |
| | | | **forwarding\_address** boolean | **Choices:*** no
* yes
| Local RIB used to validate external/NSSA forwarding addresses |
| | | | **inter\_area\_summary** boolean | **Choices:*** no
* yes
| Local RIB used as criteria for inter-area summaries |
| | | | **nssa\_translation** boolean | **Choices:*** no
* yes
| Local RIB used as criteria for NSSA translation |
| | | **log\_adjacency\_changes** dictionary | | Log changes in adjacency state |
| | | | **detail** boolean | **Choices:*** no
* yes
| Log all state changes |
| | | | **set** boolean | **Choices:*** no
* yes
| Log changes in adjacency state |
| | | **max\_lsa** dictionary | | Maximum number of non self-generated LSAs to accept |
| | | | **ignore\_count** integer | | Maximum number of times adjacencies can be suppressed Note, refer vendor documentation for respective valid values |
| | | | **ignore\_time** integer | | Number of minutes during which all adjacencies are suppressed Note, refer vendor documentation for respective valid values |
| | | | **number** integer | | Maximum number of non self-generated LSAs to accept Note, refer vendor documentation for respective valid values |
| | | | **reset\_time** integer | | Number of minutes after which ignore-count is reset to zero Note, refer vendor documentation for respective valid values |
| | | | **threshold\_value** integer | | Threshold value (%) at which to generate a warning msg Note, refer vendor documentation for respective valid values |
| | | | **warning\_only** boolean | **Choices:*** no
* yes
| Only give a warning message when limit is exceeded |
| | | **max\_metric** dictionary | | Set maximum metric |
| | | | **external\_lsa** integer | | Override external-lsa metric with max-metric value Overriding metric in external-LSAs Note, refer vendor documentation for respective valid values |
| | | | **include\_stub** boolean | **Choices:*** no
* yes
| Set maximum metric for stub links in router-LSAs |
| | | | **on\_startup** dictionary | | Set maximum metric temporarily after reboot |
| | | | | **time** integer | | Time, in seconds, router-LSAs are originated with max-metric Note, please refer vendor documentation for respective valid range |
| | | | | **wait\_for\_bgp** boolean | **Choices:*** no
* yes
| Let BGP decide when to originate router-LSA with normal metric |
| | | | **router\_lsa** boolean / required | **Choices:*** no
* yes
| Maximum metric in self-originated router-LSAs |
| | | | **summary\_lsa** integer | | Override summary-lsa metric with max-metric value Note, please refer vendor documentation for respective valid range |
| | | **maximum\_paths** integer | | Forward packets over multiple paths Number of paths |
| | | **mpls** dictionary | | Configure MPLS routing protocol parameters |
| | | | **ldp** dictionary | | routing protocol commands for MPLS LDP |
| | | | | **autoconfig** dictionary | | routing protocol commands for MPLS LDP |
| | | | | | **area** string | | Configure an OSPF area to run MPLS LDP |
| | | | | | **set** boolean | **Choices:*** no
* yes
| Configure LDP automatic configuration and set the config |
| | | | | **sync** boolean | **Choices:*** no
* yes
| Configure LDP-IGP Synchronization |
| | | | **traffic\_eng** dictionary | | Let BGP decide when to originate router-LSA with normal metric |
| | | | | **area** string | | Configure an ospf area to run MPLS Traffic Engineering OSPF area ID as a decimal value or in IP address format |
| | | | | **autoroute\_exclude** string | | MPLS TE autoroute exclude Filter prefixes based on name of an IP prefix-list |
| | | | | **interface** dictionary | | MPLS TE interface configuration for this OSPF process |
| | | | | | **area** integer | | Advertise MPLS TE information for this interface into area OSPF area ID as a decimal value |
| | | | | | **interface\_type** string | | TE Interface configuration (GigabitEthernet A/B) |
| | | | | **mesh\_group** dictionary | | Traffic Engineering Mesh-Group advertisement |
| | | | | | **area** string | | configure flooding scope as area |
| | | | | | **id** integer | | Mesh Group Id |
| | | | | | **interface** string | | Interface configuration (GigabitEthernet A/B) |
| | | | | **multicast\_intact** boolean | **Choices:*** no
* yes
| MPLS TE and PIM interaction |
| | | | | **router\_id\_interface** string | | Router Interface configuration (GigabitEthernet A/B) |
| | | **neighbor** dictionary | | Specify a neighbor router |
| | | | **address** string | | Neighbor address (A.B.C.D) |
| | | | **cost** integer | | OSPF cost for point-to-multipoint neighbor metric Note, please refer vendor documentation for respective valid range |
| | | | **database\_filter** boolean | **Choices:*** no
* yes
| Filter OSPF LSA during synchronization and flooding for point-to-multipoint neighbor Filter all outgoing LSA |
| | | | **poll\_interval** integer | | OSPF dead-router polling interval of non-broadcast neighbor in Seconds |
| | | | **priority** integer | | OSPF priority of non-broadcast neighbor priority |
| | | **network** list / elements=dictionary | | Enable routing on an IP network |
| | | | **address** string | | Network number |
| | | | **area** string | | Set the OSPF area ID |
| | | | **wildcard\_bits** string | | OSPF wild card bits |
| | | **nsf** dictionary | | Non-stop forwarding |
| | | | **cisco** dictionary | | Cisco Non-stop forwarding |
| | | | | **disable** boolean | **Choices:*** no
* yes
| disable helper support |
| | | | | **helper** boolean | **Choices:*** no
* yes
| helper support |
| | | | **ietf** dictionary | | IETF graceful restart |
| | | | | **disable** boolean | **Choices:*** no
* yes
| disable helper support |
| | | | | **helper** boolean | **Choices:*** no
* yes
| helper support |
| | | | | **strict\_lsa\_checking** boolean | **Choices:*** no
* yes
| enable helper strict LSA checking |
| | | **passive\_interface** string | | passive\_interface param is deprecated and a newer param passive\_interfaces with added functionality's is introduced, please meke use of the new available passive\_interfaces instead. Suppress routing updates on an interface (GigabitEthernet A/B) Interface name with respective interface number |
| | | **passive\_interfaces** dictionary | | Suppress routing updates on an interface |
| | | | **default** boolean | **Choices:*** no
* yes
| Suppress routing updates on all interfaces |
| | | | **interface** dictionary | | Suppress/Un-Suppress routing updates on interface |
| | | | | **name** list / elements=string | | Name of interface (GigabitEthernet A/B) |
| | | | | **set\_interface** boolean | **Choices:*** no
* yes
| Suppress/Un-Suppress routing updates |
| | | **prefix\_suppression** boolean | **Choices:*** no
* yes
| Enable prefix suppression |
| | | **priority** integer | | OSPF topology priority Note, refer vendor documentation for respective valid values |
| | | **process\_id** integer / required | | Process ID |
| | | **queue\_depth** dictionary | | Hello/Router process queue depth |
| | | | **hello** dictionary | | OSPF Hello process queue depth |
| | | | | **max\_packets** integer | | maximum number of packets in the queue |
| | | | | **unlimited** boolean | **Choices:*** no
* yes
| Unlimited queue depth |
| | | | **update** dictionary | | OSPF Router process queue depth |
| | | | | **max\_packets** integer | | maximum number of packets in the queue |
| | | | | **unlimited** boolean | **Choices:*** no
* yes
| Unlimited queue depth |
| | | **router\_id** string | | Router-id address for this OSPF process OSPF router-id in IP address format (A.B.C.D) |
| | | **shutdown** boolean | **Choices:*** no
* yes
| Shutdown the router process |
| | | **summary\_address** dictionary | | Configure IP address summaries |
| | | | **address** string | | IP summary address |
| | | | **mask** string | | IP Summary mask |
| | | | **not\_advertise** boolean | **Choices:*** no
* yes
| Do not advertise or translate |
| | | | **nssa\_only** boolean | **Choices:*** no
* yes
| Limit summary to NSSA areas |
| | | | **tag** integer | | Set tag |
| | | **timers** dictionary | | Adjust routing timers |
| | | | **lsa** integer | | OSPF LSA timers, arrival timer The minimum interval in milliseconds between accepting the same LSA Note, refer vendor documentation for respective valid values |
| | | | **pacing** dictionary | | OSPF pacing timers |
| | | | | **flood** integer | | OSPF flood pacing timer The minimum interval in msec to pace limit flooding on interface Note, refer vendor documentation for respective valid values |
| | | | | **lsa\_group** integer | | OSPF LSA group pacing timer Interval in sec between group of LSA being refreshed or maxaged Note, refer vendor documentation for respective valid values |
| | | | | **retransmission** integer | | OSPF retransmission pacing timer The minimum interval in msec between neighbor retransmissions Note, refer vendor documentation for respective valid values |
| | | | **throttle** dictionary | | OSPF throttle timers |
| | | | | **lsa** dictionary | | OSPF LSA throttle timers |
| | | | | | **first\_delay** integer | | Delay to generate first occurrence of LSA in milliseconds Note, refer vendor documentation for respective valid values |
| | | | | | **max\_delay** integer | | Maximum delay between originating the same LSA in milliseconds Note, refer vendor documentation for respective valid values |
| | | | | | **min\_delay** integer | | Minimum delay between originating the same LSA in milliseconds Note, refer vendor documentation for respective valid values |
| | | | | **spf** dictionary | | OSPF SPF throttle timers - Delay between receiving a change to SPF calculation in milliseconds - Note, refer vendor documentation for respective valid values |
| | | | | | **between\_delay** integer | | Delay between first and second SPF calculation in milliseconds Note, refer vendor documentation for respective valid values |
| | | | | | **max\_delay** integer | | Maximum wait time in milliseconds for SPF calculations Note, refer vendor documentation for respective valid values |
| | | | | | **receive\_delay** integer | | Delay between receiving a change to SPF calculation in milliseconds Note, refer vendor documentation for respective valid values |
| | | **traffic\_share** boolean | **Choices:*** no
* yes
| How to compute traffic share over alternate paths All traffic shared among min metric paths Use different interfaces for equal-cost paths |
| | | **ttl\_security** dictionary | | TTL security check |
| | | | **hops** integer | | Maximum number of IP hops allowed Note, refer vendor documentation for respective valid values |
| | | | **set** boolean | **Choices:*** no
* yes
| Enable TTL Security on all interfaces |
| | | **vrf** string | | Specify parameters for a VPN Routing/Forwarding instance |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the IOS device by executing the command **sh running-config | section ^router ospf**. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* gathered
* parsed
* rendered
| The state the configuration should be left in The states *rendered*, *gathered* and *parsed* does not perform any change on the device. The state *rendered* will transform the configuration in `config` option to platform specific CLI commands which will be returned in the *rendered* key within the result. For state *rendered* active connection to remote host is not required. The state *gathered* will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the *gathered* key within the result. The state *parsed* reads the configuration from `running_config` option and transforms it into JSON format as per the resource module parameters and the value is returned in the *parsed* key within the result. The value of `running_config` option should be the same format as the output of command *show running-config | include ip route|ipv6 route* executed on device. For state *parsed* active connection to remote host is not required. |
Notes
-----
Note
* Tested against Cisco IOSv Version 15.2 on VIRL.
Examples
--------
```
# Using deleted
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Delete provided OSPF V2 processes
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 1
- process_id: 200
vrf: blue
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "no router ospf 1"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# Using deleted without any config passed (NOTE: This will delete all OSPFV2 configuration from device)
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Delete all OSPF processes
cisco.ios.ios_ospfv2:
state: deleted
# Commands Fired:
# ---------------
#
# "commands": [
# "no router ospf 200 vrf blue",
# "no router ospf 1"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^router ospf
# router-ios#
# Using merged
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router-ios#
- name: Merge provided OSPF V2 configuration
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 1
max_metric:
router_lsa: true
on_startup:
time: 110
areas:
- area_id: '5'
capability: true
authentication:
enable: true
- area_id: '10'
authentication:
message_digest: true
nssa:
default_information_originate:
metric: 10
translate: suppress-fa
default_cost: 10
filter_list:
- name: test_prefix_in
direction: in
- name: test_prefix_out
direction: out
network:
address: 198.51.100.0
wildcard_bits: 0.0.0.255
area: 5
default_information:
originate: true
passive_interfaces:
default: true
interface:
set_interface: False
name:
- GigabitEthernet0/1
- GigabitEthernet0/2
- process_id: 200
vrf: blue
domain_id:
ip_address:
address: 192.0.3.1
max_metric:
router_lsa: true
on_startup:
time: 100
auto_cost:
reference_bandwidth: 4
areas:
- area_id: '10'
capability: true
distribute_list:
acls:
- name: 10
direction: out
- name: 123
direction: in
state: merged
# Commands Fired:
# ---------------
#
# "commands": [
# "router ospf 200 vrf blue",
# "auto-cost reference-bandwidth 4",
# "distribute-list 10 out",
# "distribute-list 123 in",
# "domain-id 192.0.3.1",
# "max-metric router-lsa on-startup 100",
# "area 10 capability default-exclusion",
# "router ospf 1",
# "default-information originate",
# "max-metric router-lsa on-startup 110",
# "network 198.51.100.0 0.0.0.255 area 5",
# "area 10 authentication message-digest",
# "area 10 default-cost 10",
# "area 10 nssa translate type7 suppress-fa",
# "area 10 nssa default-information-originate metric 10",
# "area 10 filter-list prefix test_prefix_out out",
# "area 10 filter-list prefix test_prefix_in in",
# "area 5 authentication",
# "area 5 capability default-exclusion"
# "passive-interface default"
# "no passive-interface GigabitEthernet0/1"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
# passive-interface default
# no passive-interface GigabitEthernet0/1
# no passive-interface GigabitEthernet0/2
# Using overridden
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Override provided OSPF V2 configuration
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 200
vrf: blue
domain_id:
ip_address:
address: 192.0.4.1
max_metric:
router_lsa: true
on_startup:
time: 200
maximum_paths: 15
ttl_security:
hops: 7
areas:
- area_id: '10'
default_cost: 10
authentication:
message_digest: true
- process_id: 100
vrf: ospf_vrf
domain_id:
ip_address:
address: 192.0.5.1
auto_cost:
reference_bandwidth: 5
areas:
- area_id: '5'
authentication:
message_digest: true
nssa:
default_information_originate:
metric: 10
translate: suppress-fa
state: overridden
# Commands Fired:
# ---------------
#
# "commands": [
# "no router ospf 1",
# "router ospf 100 vrf ospf_vrf",
# "auto-cost reference-bandwidth 5",
# "domain-id 192.0.5.1",
# "area 5 authentication message-digest",
# "area 5 nssa translate type7 suppress-fa",
# "area 5 nssa default-information-originate metric 10",
# "router ospf 200 vrf blue",
# "no auto-cost reference-bandwidth 4",
# "no distribute-list 10 out",
# "no distribute-list 123 in",
# "domain-id 192.0.4.1",
# "max-metric router-lsa on-startup 200",
# "maximum-paths 15",
# "ttl-security all-interfaces hops 7",
# "area 10 authentication message-digest",
# "no area 10 capability default-exclusion",
# "area 10 default-cost 10"
# ]
# After state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.4.1
# max-metric router-lsa on-startup 200
# ttl-security all-interfaces hops 7
# area 10 authentication message-digest
# area 10 default-cost 10
# maximum-paths 15
# router ospf 100 vrf ospf_vrf
# domain-id 192.0.5.1
# auto-cost reference-bandwidth 5
# area 5 authentication message-digest
# area 5 nssa default-information-originate metric 10
# area 5 nssa translate type7 suppress-fa
# Using replaced
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Replaced provided OSPF V2 configuration
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 200
vrf: blue
domain_id:
ip_address:
address: 192.0.4.1
max_metric:
router_lsa: true
on_startup:
time: 200
maximum_paths: 15
ttl_security:
hops: 7
areas:
- area_id: '10'
default_cost: 10
authentication:
message_digest: true
- process_id: 100
vrf: ospf_vrf
domain_id:
ip_address:
address: 192.0.5.1
auto_cost:
reference_bandwidth: 5
areas:
- area_id: '5'
authentication:
message_digest: true
nssa:
default_information_originate:
metric: 10
translate: suppress-fa
state: replaced
# Commands Fired:
# ---------------
# "commands": [
# "router ospf 100 vrf ospf_vrf",
# "auto-cost reference-bandwidth 5",
# "domain-id 192.0.5.1",
# "area 5 authentication message-digest",
# "area 5 nssa translate type7 suppress-fa",
# "area 5 nssa default-information-originate metric 10",
# "router ospf 200 vrf blue",
# "no auto-cost reference-bandwidth 4",
# "no distribute-list 10 out",
# "no distribute-list 123 in",
# "domain-id 192.0.4.1",
# "max-metric router-lsa on-startup 200",
# "maximum-paths 15",
# "ttl-security all-interfaces hops 7",
# "area 10 authentication message-digest",
# "no area 10 capability default-exclusion",
# "area 10 default-cost 10"
# ]
# After state:
# -------------
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.4.1
# max-metric router-lsa on-startup 200
# ttl-security all-interfaces hops 7
# area 10 authentication message-digest
# area 10 default-cost 10
# maximum-paths 15
# router ospf 100 vrf ospf_vrf
# domain-id 192.0.5.1
# auto-cost reference-bandwidth 5
# area 5 authentication message-digest
# area 5 nssa default-information-originate metric 10
# area 5 nssa translate type7 suppress-fa
# router ospf 1
# max-metric router-lsa on-startup 110
# area 5 capability default-exclusion
# area 5 authentication
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_in in
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
# Using Gathered
# Before state:
# -------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
- name: Gather OSPFV2 provided configurations
cisco.ios.ios_ospfv2:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": {
# "processes": [
# {
# "areas": [
# {
# "area_id": "5",
# "authentication": {
# "enable": true
# },
# "capability": true
# },
# {
# "area_id": "10",
# "authentication": {
# "message_digest": true
# },
# "default_cost": 10,
# "filter_list": [
# {
# "direction": "in",
# "name": "test_prefix_in"
# },
# {
# "direction": "out",
# "name": "test_prefix_out"
# }
# ],
# "nssa": {
# "default_information_originate": {
# "metric": 10
# },
# "translate": "suppress-fa"
# }
# }
# ],
# "default_information": {
# "originate": true
# },
# "max_metric": {
# "on_startup": {
# "time": 110
# },
# "router_lsa": true
# },
# "network": {
# "address": "198.51.100.0",
# "area": "5",
# "wildcard_bits": "0.0.0.255"
# },
# "process_id": 1
# },
# {
# "areas": [
# {
# "area_id": "10",
# "capability": true
# }
# ],
# "auto_cost": {
# "reference_bandwidth": 4
# },
# "distribute_list": {
# "acls": [
# {
# "direction": "out",
# "name": "10"
# },
# {
# "direction": "in",
# "name": "123"
# }
# ]
# },
# "domain_id": {
# "ip_address": {
# "address": "192.0.3.1"
# }
# },
# "max_metric": {
# "on_startup": {
# "time": 100
# },
# "router_lsa": true
# },
# "process_id": 200,
# "vrf": "blue"
# }
# ]
# }
# After state:
# ------------
#
# router-ios#sh running-config | section ^router ospf
# router ospf 200 vrf blue
# domain-id 192.0.3.1
# max-metric router-lsa on-startup 100
# auto-cost reference-bandwidth 4
# area 10 capability default-exclusion
# distribute-list 10 out
# distribute-list 123 in
# router ospf 1
# max-metric router-lsa on-startup 110
# area 10 authentication message-digest
# area 10 nssa default-information-originate metric 10
# area 10 nssa translate type7 suppress-fa
# area 10 default-cost 10
# area 10 filter-list prefix test_prefix_out out
# network 198.51.100.0 0.0.0.255 area 5
# default-information originate
# Using Rendered
- name: Render the commands for provided configuration
cisco.ios.ios_ospfv2:
config:
processes:
- process_id: 1
max_metric:
router_lsa: true
on_startup:
time: 110
areas:
- area_id: '5'
capability: true
authentication:
enable: true
- area_id: '10'
authentication:
message_digest: true
nssa:
default_information_originate:
metric: 10
translate: suppress-fa
default_cost: 10
filter_list:
- name: test_prefix_in
direction: in
- name: test_prefix_out
direction: out
network:
address: 198.51.100.0
wildcard_bits: 0.0.0.255
area: 5
default_information:
originate: true
- process_id: 200
vrf: blue
domain_id:
ip_address:
address: 192.0.3.1
max_metric:
router_lsa: true
on_startup:
time: 100
auto_cost:
reference_bandwidth: 4
areas:
- area_id: '10'
capability: true
distribute_list:
acls:
- name: 10
direction: out
- name: 123
direction: in
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "router ospf 200 vrf blue",
# "auto-cost reference-bandwidth 4",
# "distribute-list 10 out",
# "distribute-list 123 in",
# "domain-id 192.0.3.1",
# "max-metric router-lsa on-startup 100",
# "area 10 capability default-exclusion",
# "router ospf 1",
# "default-information originate",
# "max-metric router-lsa on-startup 110",
# "network 198.51.100.0 0.0.0.255 area 5",
# "area 10 authentication message-digest",
# "area 10 default-cost 10",
# "area 10 nssa translate type7 suppress-fa",
# "area 10 nssa default-information-originate metric 10",
# "area 10 filter-list prefix test_prefix_out out",
# "area 10 filter-list prefix test_prefix_in in",
# "area 5 authentication",
# "area 5 capability default-exclusion"
# ]
# Using Parsed
# File: parsed.cfg
# ----------------
#
# router ospf 100
# auto-cost reference-bandwidth 5
# domain-id 192.0.5.1
# area 5 authentication message-digest
# area 5 nssa translate type7 suppress-fa
# area 5 nssa default-information-originate metric 10
- name: Parse the provided configuration with the existing running configuration
cisco.ios.ios_ospfv2:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": {
# "processes": [
# {
# "areas": [
# {
# "area_id": "5",
# "authentication": {
# "message_digest": true
# },
# "nssa": {
# "default_information_originate": {
# "metric": 10
# },
# "translate": "suppress-fa"
# }
# }
# ],
# "auto_cost": {
# "reference_bandwidth": 5
# },
# "domain_id": {
# "ip_address": {
# "address": "192.0.5.1"
# }
# },
# "process_id": 100
# }
# ]
# }
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** dictionary | when changed | The resulting configuration model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** dictionary | always | The configuration prior to the model invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device. **Sample:** ['router ospf 200 vrf blue', 'auto-cost reference-bandwidth 5', 'domain-id 192.0.4.1'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.meraki.meraki_mx_malware β Manage Malware Protection in the Meraki cloud cisco.meraki.meraki\_mx\_malware β Manage Malware Protection in the Meraki cloud
================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mx_malware`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Fully configure malware protection in a Meraki environment.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **allowed\_files** list / elements=dictionary | | List of files to whitelist. |
| | **comment** string | | Human readable information about file. |
| | **sha256** string | | 256-bit hash of file.
aliases: hash |
| **allowed\_urls** list / elements=dictionary | | List of URLs to whitelist. |
| | **comment** string | | Human readable information about URL. |
| | **url** string | | URL string to allow. |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **mode** string | **Choices:*** disabled
* enabled
| Enabled or disabled state of malware protection. |
| **net\_id** string | | ID of network which configuration is applied to. |
| **net\_name** string | | Name of network which configuration is applied to.
aliases: network |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** absent
* present
* **query** β
| Specifies whether object should be queried, created/modified, or removed. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* Some of the options are likely only used for developers within Meraki.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Enable malware protection
meraki_malware:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
mode: enabled
delegate_to: localhost
- name: Set whitelisted url
meraki_malware:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
mode: enabled
allowed_urls:
- url: www.ansible.com
comment: Ansible
- url: www.google.com
comment: Google
delegate_to: localhost
- name: Set whitelisted file
meraki_malware:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
mode: enabled
allowed_files:
- sha256: e82c5f7d75004727e1f3b94426b9a11c8bc4c312a9170ac9a73abace40aef503
comment: random zip
delegate_to: localhost
- name: Get malware settings
meraki_malware:
auth_key: abc123
state: query
org_name: YourNet
net_name: YourOrg
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | List of administrators. |
| | **allowed\_files** complex | success | List of files which are whitelisted. |
| | | **comment** string | success | Comment about the whitelisted entity **Sample:** TPS report |
| | | **sha256** string | success | sha256 hash of whitelisted file. **Sample:** e82c5f7d75004727e1f3b94426b9a11c8bc4c312a9170ac9a73abace40aef503 |
| | **allowed\_urls** complex | success | List of URLs which are whitelisted. |
| | | **comment** string | success | Comment about the whitelisted entity **Sample:** Corporate HQ |
| | | **url** string | success | URL of whitelisted site. **Sample:** site.com |
| | **mode** string | success | Mode to enable or disable malware scanning. **Sample:** enabled |
### Authors
* Kevin Breit (@kbreit)
ansible Cisco.Meraki Cisco.Meraki
============
Collection version 2.5.0
Plugin Index
------------
These are the plugins in the cisco.meraki collection
### Modules
* [meraki\_admin](meraki_admin_module#ansible-collections-cisco-meraki-meraki-admin-module) β Manage administrators in the Meraki cloud
* [meraki\_alert](meraki_alert_module#ansible-collections-cisco-meraki-meraki-alert-module) β Manage alerts in the Meraki cloud
* [meraki\_config\_template](meraki_config_template_module#ansible-collections-cisco-meraki-meraki-config-template-module) β Manage configuration templates in the Meraki cloud
* [meraki\_device](meraki_device_module#ansible-collections-cisco-meraki-meraki-device-module) β Manage devices in the Meraki cloud
* [meraki\_firewalled\_services](meraki_firewalled_services_module#ansible-collections-cisco-meraki-meraki-firewalled-services-module) β Edit firewall policies for administrative network services
* [meraki\_management\_interface](meraki_management_interface_module#ansible-collections-cisco-meraki-meraki-management-interface-module) β Configure Meraki management interfaces
* [meraki\_mr\_l3\_firewall](meraki_mr_l3_firewall_module#ansible-collections-cisco-meraki-meraki-mr-l3-firewall-module) β Manage MR access point layer 3 firewalls in the Meraki cloud
* [meraki\_mr\_rf\_profile](meraki_mr_rf_profile_module#ansible-collections-cisco-meraki-meraki-mr-rf-profile-module) β Manage RF profiles for Meraki wireless networks
* [meraki\_mr\_settings](meraki_mr_settings_module#ansible-collections-cisco-meraki-meraki-mr-settings-module) β Manage general settings for Meraki wireless networks
* [meraki\_mr\_ssid](meraki_mr_ssid_module#ansible-collections-cisco-meraki-meraki-mr-ssid-module) β Manage wireless SSIDs in the Meraki cloud
* [meraki\_ms\_access\_list](meraki_ms_access_list_module#ansible-collections-cisco-meraki-meraki-ms-access-list-module) β Manage access lists for Meraki switches in the Meraki cloud
* [meraki\_ms\_l3\_interface](meraki_ms_l3_interface_module#ansible-collections-cisco-meraki-meraki-ms-l3-interface-module) β Manage routed interfaces on MS switches
* [meraki\_ms\_link\_aggregation](meraki_ms_link_aggregation_module#ansible-collections-cisco-meraki-meraki-ms-link-aggregation-module) β Manage link aggregations on MS switches
* [meraki\_ms\_ospf](meraki_ms_ospf_module#ansible-collections-cisco-meraki-meraki-ms-ospf-module) β Manage OSPF configuration on MS switches
* [meraki\_ms\_stack](meraki_ms_stack_module#ansible-collections-cisco-meraki-meraki-ms-stack-module) β Modify switch stacking configuration in Meraki.
* [meraki\_ms\_stack\_l3\_interface](meraki_ms_stack_l3_interface_module#ansible-collections-cisco-meraki-meraki-ms-stack-l3-interface-module) β Manage routed interfaces on MS switches
* [meraki\_ms\_storm\_control](meraki_ms_storm_control_module#ansible-collections-cisco-meraki-meraki-ms-storm-control-module) β Manage storm control configuration on a switch in the Meraki cloud
* [meraki\_ms\_switchport](meraki_ms_switchport_module#ansible-collections-cisco-meraki-meraki-ms-switchport-module) β Manage switchports on a switch in the Meraki cloud
* [meraki\_mx\_content\_filtering](meraki_mx_content_filtering_module#ansible-collections-cisco-meraki-meraki-mx-content-filtering-module) β Edit Meraki MX content filtering policies
* [meraki\_mx\_intrusion\_prevention](meraki_mx_intrusion_prevention_module#ansible-collections-cisco-meraki-meraki-mx-intrusion-prevention-module) β Manage intrustion prevention in the Meraki cloud
* [meraki\_mx\_l2\_interface](meraki_mx_l2_interface_module#ansible-collections-cisco-meraki-meraki-mx-l2-interface-module) β Configure MX layer 2 interfaces
* [meraki\_mx\_l3\_firewall](meraki_mx_l3_firewall_module#ansible-collections-cisco-meraki-meraki-mx-l3-firewall-module) β Manage MX appliance layer 3 firewalls in the Meraki cloud
* [meraki\_mx\_l7\_firewall](meraki_mx_l7_firewall_module#ansible-collections-cisco-meraki-meraki-mx-l7-firewall-module) β Manage MX appliance layer 7 firewalls in the Meraki cloud
* [meraki\_mx\_malware](meraki_mx_malware_module#ansible-collections-cisco-meraki-meraki-mx-malware-module) β Manage Malware Protection in the Meraki cloud
* [meraki\_mx\_nat](meraki_mx_nat_module#ansible-collections-cisco-meraki-meraki-mx-nat-module) β Manage NAT rules in Meraki cloud
* [meraki\_mx\_site\_to\_site\_firewall](meraki_mx_site_to_site_firewall_module#ansible-collections-cisco-meraki-meraki-mx-site-to-site-firewall-module) β Manage MX appliance firewall rules for site-to-site VPNs
* [meraki\_mx\_site\_to\_site\_vpn](meraki_mx_site_to_site_vpn_module#ansible-collections-cisco-meraki-meraki-mx-site-to-site-vpn-module) β Manage AutoVPN connections in Meraki
* [meraki\_mx\_static\_route](meraki_mx_static_route_module#ansible-collections-cisco-meraki-meraki-mx-static-route-module) β Manage static routes in the Meraki cloud
* [meraki\_mx\_uplink\_bandwidth](meraki_mx_uplink_bandwidth_module#ansible-collections-cisco-meraki-meraki-mx-uplink-bandwidth-module) β Manage uplinks on Meraki MX appliances
* [meraki\_mx\_vlan](meraki_mx_vlan_module#ansible-collections-cisco-meraki-meraki-mx-vlan-module) β Manage VLANs in the Meraki cloud
* [meraki\_network](meraki_network_module#ansible-collections-cisco-meraki-meraki-network-module) β Manage networks in the Meraki cloud
* [meraki\_organization](meraki_organization_module#ansible-collections-cisco-meraki-meraki-organization-module) β Manage organizations in the Meraki cloud
* [meraki\_snmp](meraki_snmp_module#ansible-collections-cisco-meraki-meraki-snmp-module) β Manage organizations in the Meraki cloud
* [meraki\_syslog](meraki_syslog_module#ansible-collections-cisco-meraki-meraki-syslog-module) β Manage syslog server settings in the Meraki cloud.
* [meraki\_webhook](meraki_webhook_module#ansible-collections-cisco-meraki-meraki-webhook-module) β Manage webhooks configured in the Meraki cloud
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible cisco.meraki.meraki_mx_site_to_site_firewall β Manage MX appliance firewall rules for site-to-site VPNs cisco.meraki.meraki\_mx\_site\_to\_site\_firewall β Manage MX appliance firewall rules for site-to-site VPNs
============================================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mx_site_to_site_firewall`.
New in version 1.0.0: of cisco.meraki
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for creation, management, and visibility into firewall rules for site-to-site VPNs implemented on Meraki MX firewalls.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **rules** list / elements=dictionary | | List of firewall rules. |
| | **comment** string | | Optional comment to describe the firewall rule. |
| | **dest\_cidr** string | | Comma separated list of CIDR notation destination networks.
`Any` must be capitalized. |
| | **dest\_port** string | | Comma separated list of destination port numbers to match against.
`Any` must be capitalized. |
| | **policy** string | **Choices:*** allow
* deny
| Policy to apply if rule is hit. |
| | **protocol** string | **Choices:*** any
* icmp
* tcp
* udp
| Protocol to match against. |
| | **src\_cidr** string | | Comma separated list of CIDR notation source networks.
`Any` must be capitalized. |
| | **src\_port** string | | Comma separated list of source port numbers to match against.
`Any` must be capitalized. |
| | **syslog\_enabled** boolean | **Choices:*** **no** β
* yes
| Whether to log hints against the firewall rule. Only applicable if a syslog server is specified against the network. |
| **state** string | **Choices:*** **present** β
* query
| Create or modify an organization. |
| **syslog\_default\_rule** boolean | **Choices:*** no
* yes
| Whether to log hits against the default firewall rule. Only applicable if a syslog server is specified against the network. This is not shown in response from Meraki. Instead, refer to the `syslog_enabled` value in the default rule. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* Module assumes a complete list of firewall rules are passed as a parameter.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query firewall rules
meraki_mx_site_to_site_firewall:
auth_key: abc123
org_name: YourOrg
state: query
delegate_to: localhost
- name: Set two firewall rules
meraki_mx_site_to_site_firewall:
auth_key: abc123
org_name: YourOrg
state: present
rules:
- comment: Block traffic to server
src_cidr: 192.0.1.0/24
src_port: any
dest_cidr: 192.0.2.2/32
dest_port: any
protocol: any
policy: deny
- comment: Allow traffic to group of servers
src_cidr: 192.0.1.0/24
src_port: any
dest_cidr: 192.0.2.0/24
dest_port: any
protocol: any
policy: permit
delegate_to: localhost
- name: Set one firewall rule and enable logging of the default rule
meraki_mx_site_to_site_firewall:
auth_key: abc123
org_name: YourOrg
state: present
rules:
- comment: Block traffic to server
src_cidr: 192.0.1.0/24
src_port: any
dest_cidr: 192.0.2.2/32
dest_port: any
protocol: any
policy: deny
syslog_default_rule: yes
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Firewall rules associated to network. |
| | **rules** complex | success | List of firewall rules associated to network. |
| | | **comment** string | always | Comment to describe the firewall rule. **Sample:** Block traffic to server |
| | | **dest\_cidr** string | always | Comma separated list of CIDR notation destination networks. **Sample:** 192.0.1.1/32,192.0.1.2/32 |
| | | **dest\_port** string | always | Comma separated list of destination ports. **Sample:** 80,443 |
| | | **policy** string | always | Action to take when rule is matched. |
| | | **protocol** string | always | Network protocol for which to match against. **Sample:** tcp |
| | | **src\_cidr** string | always | Comma separated list of CIDR notation source networks. **Sample:** 192.0.1.1/32,192.0.1.2/32 |
| | | **src\_port** string | always | Comma separated list of source ports. **Sample:** 80,443 |
| | | **syslog\_enabled** boolean | always | Whether to log to syslog when rule is matched. **Sample:** True |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_alert β Manage alerts in the Meraki cloud cisco.meraki.meraki\_alert β Manage alerts in the Meraki cloud
==============================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_alert`.
New in version 2.1.0: of cisco.meraki
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for creation, management, and visibility into alert settings within Meraki.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **alerts** list / elements=dictionary | | Alert-specific configuration for each type. |
| | **alert\_destinations** dictionary | | A hash of destinations for this specific alert. |
| | | **all\_admins** boolean | **Choices:*** no
* yes
| If true, all network admins will receive emails. |
| | | **emails** list / elements=string | | A list of emails that will recieve the alert(s). |
| | | **http\_server\_ids** list / elements=string | | A list of HTTP server IDs to send a Webhook to. |
| | | **snmp** boolean | **Choices:*** no
* yes
| If true, then an SNMP trap will be sent if there is an SNMP trap server configured for this network. |
| | **alert\_type** string | | The type of alert. |
| | **enabled** boolean | **Choices:*** no
* yes
| A boolean depicting if the alert is turned on or off. |
| | **filters** raw | | A hash of specific configuration data for the alert. Only filters specific to the alert will be updated. No validation checks occur against `filters`. |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **default\_destinations** dictionary | | Properties for destinations when alert specific destinations aren't specified. |
| | **all\_admins** boolean | **Choices:*** no
* yes
| If true, all network admins will receive emails. |
| | **emails** list / elements=string | | A list of emails that will recieve the alert(s). |
| | **http\_server\_ids** list / elements=string | | A list of HTTP server IDs to send a Webhook to. |
| | **snmp** boolean | **Choices:*** no
* yes
| If true, then an SNMP trap will be sent if there is an SNMP trap server configured for this network. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **net\_id** string | | ID number of a network. |
| **net\_name** string | | Name of a network.
aliases: name, network |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** **present** β
* query
| Create or modify an alert. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Update settings
meraki_alert:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: present
default_destinations:
emails:
- 'youremail@yourcorp'
- 'youremail2@yourcorp'
all_admins: yes
snmp: no
alerts:
- type: "gatewayDown"
enabled: yes
filters:
timeout: 60
alert_destinations:
emails:
- 'youremail@yourcorp'
- 'youremail2@yourcorp'
all_admins: yes
snmp: no
- type: "usageAlert"
enabled: yes
filters:
period: 1200
threshold: 104857600
alert_destinations:
emails:
- 'youremail@yourcorp'
- 'youremail2@yourcorp'
all_admins: yes
snmp: no
- name: Query all settings
meraki_alert:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: query
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | info | Information about the created or manipulated object. |
| | **alerts** complex | success | Alert-specific configuration for each type. |
| | | **alert\_destinations** complex | success | A hash of destinations for this specific alert. |
| | | | **all\_admins** boolean | success | If true, all network admins will receive emails. |
| | | | **emails** list / elements=string | success | A list of emails that will recieve the alert(s). |
| | | | **http\_server\_ids** list / elements=string | success | A list of HTTP server IDs to send a Webhook to. |
| | | | **snmp** boolean | success | If true, then an SNMP trap will be sent if there is an SNMP trap server configured for this network. |
| | | **enabled** boolean | success | A boolean depicting if the alert is turned on or off. |
| | | **filters** complex | success | A hash of specific configuration data for the alert. Only filters specific to the alert will be updated. No validation checks occur against `filters`. |
| | | **type** string | success | The type of alert. |
| | **default\_destinations** complex | success | Properties for destinations when alert specific destinations aren't specified. |
| | | **all\_admins** boolean | success | If true, all network admins will receive emails. **Sample:** True |
| | | **emails** list / elements=string | success | A list of emails that will recieve the alert(s). |
| | | **http\_server\_ids** list / elements=string | success | A list of HTTP server IDs to send a Webhook to. |
| | | **snmp** boolean | success | If true, then an SNMP trap will be sent if there is an SNMP trap server configured for this network. **Sample:** True |
### Authors
* Kevin Breit (@kbreit)
| programming_docs |
ansible cisco.meraki.meraki_ms_stack β Modify switch stacking configuration in Meraki. cisco.meraki.meraki\_ms\_stack β Modify switch stacking configuration in Meraki.
================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_ms_stack`.
New in version 1.3.0: of cisco.meraki
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for modification of Meraki MS switch stacks.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **name** string | | Name of stack. |
| **net\_id** string | | ID of network which MX firewall is in. |
| **net\_name** string | | Name of network which MX firewall is in. |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **serials** list / elements=string | | List of switch serial numbers which should be included or removed from a stack. |
| **stack\_id** string | | ID of stack which is to be modified or deleted. |
| **state** string | **Choices:*** **present** β
* query
* absent
| Create or modify an organization. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* Not all actions are idempotent. Specifically, creating a new stack will error if any switch is already in a stack.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Create new stack
meraki_switch_stack:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
name: Test stack
serials:
- "ABCD-1231-4579"
- "ASDF-4321-0987"
- name: Add switch to stack
meraki_switch_stack:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
stack_id: ABC12340987
serials:
- "ABCD-1231-4579"
- name: Remove switch from stack
meraki_switch_stack:
auth_key: abc123
state: absent
org_name: YourOrg
net_name: YourNet
stack_id: ABC12340987
serials:
- "ABCD-1231-4579"
- name: Query one stack
meraki_switch_stack:
auth_key: abc123
state: query
org_name: YourOrg
net_name: YourNet
stack_id: ABC12340987
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | VPN settings. |
| | **id** string | always | ID of switch stack. **Sample:** 7636 |
| | **name** string | always | Descriptive name of switch stack. **Sample:** MyStack |
| | **serials** list / elements=string | always | List of serial numbers in switch stack. **Sample:** ['QBZY-XWVU-TSRQ', 'QBAB-CDEF-GHIJ'] |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_ms_storm_control β Manage storm control configuration on a switch in the Meraki cloud cisco.meraki.meraki\_ms\_storm\_control β Manage storm control configuration on a switch in the Meraki cloud
============================================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_ms_storm_control`.
New in version 0.0.1: of cisco.meraki
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for management of storm control settings for Meraki MS switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **broadcast\_threshold** integer | | Percentage (1 to 99) of total available port bandwidth for broadcast traffic type. Default value 100 percent rate is to clear the configuration. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **multicast\_threshold** integer | | Percentage (1 to 99) of total available port bandwidth for multicast traffic type. Default value 100 percent rate is to clear the configuration. |
| **net\_id** string | | ID of network. |
| **net\_name** string | | Name of network. |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** **query** β
* present
| Specifies whether storm control configuration should be queried or modified. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **unknown\_unicast\_threshold** integer | | Percentage (1 to 99) of total available port bandwidth for unknown unicast traffic type. Default value 100 percent rate is to clear the configuration. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Set broadcast settings
meraki_switch_storm_control:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
broadcast_threshold: 75
multicast_threshold: 70
unknown_unicast_threshold: 65
delegate_to: localhost
- name: Query storm control settings
meraki_switch_storm_control:
auth_key: abc123
state: query
org_name: YourOrg
net_name: YourNet
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Information queried or updated storm control configuration. |
| | **broadcast\_threshold** integer | success | Percentage (1 to 99) of total available port bandwidth for broadcast traffic type. Default value 100 percent rate is to clear the configuration. **Sample:** 42 |
| | **multicast\_threshold** integer | success | Percentage (1 to 99) of total available port bandwidth for multicast traffic type. Default value 100 percent rate is to clear the configuration. **Sample:** 42 |
| | **unknown\_unicast\_threshold** integer | success | Percentage (1 to 99) of total available port bandwidth for unknown unicast traffic type. Default value 100 percent rate is to clear the configuration. **Sample:** 42 |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_ms_access_list β Manage access lists for Meraki switches in the Meraki cloud cisco.meraki.meraki\_ms\_access\_list β Manage access lists for Meraki switches in the Meraki cloud
===================================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_ms_access_list`.
New in version 0.1.0: of cisco.meraki
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Configure and query information about access lists on Meraki switches within the Meraki cloud.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **net\_id** string | | ID of network which configuration is applied to. |
| **net\_name** string | | Name of network which configuration is applied to.
aliases: network |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **rules** list / elements=dictionary | | List of access control rules. |
| | **comment** string | | Description of the rule. |
| | **dst\_cidr** string | | CIDR notation of source IP address to match. |
| | **dst\_port** string | | Port number of destination port to match. May be a port number or 'any'. |
| | **ip\_version** string | **Choices:*** any
* ipv4
* ipv6
| Type of IP packets to match. |
| | **policy** string | **Choices:*** allow
* deny
| Action to take on matching traffic. |
| | **protocol** string | **Choices:*** any
* tcp
* udp
| Type of protocol to match. |
| | **src\_cidr** string | | CIDR notation of source IP address to match. |
| | **src\_port** string | | Port number of source port to match. May be a port number or 'any'. |
| | **vlan** string | | Incoming traffic VLAN. May be any port between 1-4095 or 'any'. |
| **state** string | **Choices:*** absent
* present
* **query** β
| Specifies whether object should be queried, created/modified, or removed. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* Some of the options are likely only used for developers within Meraki.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Set access list
meraki_switch_access_list:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
rules:
- comment: Fake rule
policy: allow
ip_version: ipv4
protocol: udp
src_cidr: 192.0.1.0/24
src_port: "4242"
dst_cidr: 1.2.3.4/32
dst_port: "80"
vlan: "100"
delegate_to: localhost
- name: Query access lists
meraki_switch_access_list:
auth_key: abc123
state: query
org_name: YourOrg
net_name: YourNet
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | List of administrators. |
| | **rules** list / elements=string | success | List of access control rules. |
| | | **comment** string | success | Description of the rule. **Sample:** User rule |
| | | **dst\_cidr** string | success | CIDR notation of source IP address to match. **Sample:** 1.2.3.4/32 |
| | | **dst\_port** string | success | Port number of destination port to match. **Sample:** 80 |
| | | **ip\_version** string | success | Type of IP packets to match. **Sample:** ipv4 |
| | | **policy** string | success | Action to take on matching traffic. **Sample:** allow |
| | | **protocol** string | success | Type of protocol to match. **Sample:** udp |
| | | **src\_cidr** string | success | CIDR notation of source IP address to match. **Sample:** 192.0.1.0/24 |
| | | **src\_port** string | success | Port number of source port to match. **Sample:** 1234 |
| | | **vlan** string | success | Incoming traffic VLAN. **Sample:** 100 |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_ms_link_aggregation β Manage link aggregations on MS switches cisco.meraki.meraki\_ms\_link\_aggregation β Manage link aggregations on MS switches
====================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_ms_link_aggregation`.
New in version 1.2.0: of cisco.meraki
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for management of MS switch link aggregations in a Meraki environment.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **lag\_id** string | | ID of lag to query or modify. |
| **net\_id** string | | ID of network. |
| **net\_name** string | | Name of network. |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** absent
* query
* **present** β
| Specifies whether SNMP information should be queried or modified. |
| **switch\_ports** list / elements=dictionary | | List of switchports to include in link aggregation. |
| | **port\_id** string | | Port number which should be included in link aggregation. |
| | **serial** string | | Serial number of switch to own link aggregation. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* Switch profile ports are not supported in this module.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Create LAG
meraki_ms_link_aggregation:
auth_key: '{{auth_key}}'
state: present
org_name: '{{test_org_name}}'
net_name: '{{test_switch_net_name}}'
switch_ports:
- serial: '{{serial_switch}}'
port_id: "1"
- serial: '{{serial_switch}}'
port_id: "2"
delegate_to: localhost
- name: Update LAG
meraki_ms_link_aggregation:
auth_key: '{{auth_key}}'
state: present
org_name: '{{test_org_name}}'
net_name: '{{test_switch_net_name}}'
lag_id: '{{lag_id}}'
switch_ports:
- serial: '{{serial_switch}}'
port_id: "1"
- serial: '{{serial_switch}}'
port_id: "2"
- serial: '{{serial_switch}}'
port_id: "3"
- serial: '{{serial_switch}}'
port_id: "4"
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | List of aggregated links. |
| | **id** string | success | ID of link aggregation. **Sample:** MTK3M4A2ZDdfM3== |
| | **switch\_ports** complex | success | List of switch ports to be included in link aggregation. |
| | | **port\_id** string | success | Port number. **Sample:** 1 |
| | | **serial** string | success | Serial number of switch on which port resides. **Sample:** ABCD-1234-WXYZ |
### Authors
* Kevin Breit (@kbreit)
| programming_docs |
ansible cisco.meraki.meraki_mx_static_route β Manage static routes in the Meraki cloud cisco.meraki.meraki\_mx\_static\_route β Manage static routes in the Meraki cloud
=================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mx_static_route`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for creation, management, and visibility into static routes within Meraki.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **enabled** boolean | **Choices:*** no
* yes
| Indicates whether static route is enabled within a network. |
| **fixed\_ip\_assignments** list / elements=dictionary | | List of fixed MAC to IP bindings for DHCP. |
| | **ip** string | | IP address of endpoint. |
| | **mac** string | | MAC address of endpoint. |
| | **name** string | | Hostname of endpoint. |
| **gateway\_ip** string | | IP address of the gateway for the subnet. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **name** string | | Descriptive name of the static route. |
| **net\_id** string | | ID number of a network. |
| **net\_name** string | | Name of a network. |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **reserved\_ip\_ranges** list / elements=dictionary | | List of IP ranges reserved for static IP assignments. |
| | **comment** string | | Human readable description of reservation range. |
| | **end** string | | Last IP address of reserved range. |
| | **start** string | | First IP address of reserved range. |
| **route\_id** string | | Unique ID of static route. |
| **state** string | **Choices:*** absent
* query
* **present** β
| Create or modify an organization. |
| **subnet** string | | CIDR notation based subnet for static route. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Create static_route
meraki_static_route:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
name: Test Route
subnet: 192.0.1.0/24
gateway_ip: 192.168.128.1
delegate_to: localhost
- name: Update static route with fixed IP assignment
meraki_static_route:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
route_id: d6fa4821-1234-4dfa-af6b-ae8b16c20c39
fixed_ip_assignments:
- mac: aa:bb:cc:dd:ee:ff
ip: 192.0.1.11
comment: Server
delegate_to: localhost
- name: Query static routes
meraki_static_route:
auth_key: abc123
state: query
org_name: YourOrg
net_name: YourNet
delegate_to: localhost
- name: Delete static routes
meraki_static_route:
auth_key: abc123
state: absent
org_name: YourOrg
net_name: YourNet
route_id: '{{item}}'
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | info | Information about the created or manipulated object. |
| | **enabled** boolean | query or update | Enabled state of static route. **Sample:** True |
| | **fixedIpAssignments** complex | query or update | List of static MAC to IP address bindings. |
| | | **mac** complex | query or update | Key is MAC address of endpoint. |
| | | | **ip** string | query or update | IP address to be bound to the endpoint. **Sample:** 192.0.1.11 |
| | | | **name** string | query or update | Hostname given to the endpoint. **Sample:** JimLaptop |
| | **gatewayIp** string | success | Next hop IP address. **Sample:** 192.1.1.1 |
| | **id** string | success | Unique identification string assigned to each static route. **Sample:** d6fa4821-1234-4dfa-af6b-ae8b16c20c39 |
| | **name** string | success | Name of static route. **Sample:** Data Center static route |
| | **net\_id** string | query or update | Identification string of network. **Sample:** N\_12345 |
| | **reservedIpRanges** complex | query or update | List of IP address ranges which are reserved for static assignment. |
| | | **comment** string | query or update | Human readable description of range. **Sample:** Server range |
| | | **end** string | query or update | Last address in reservation range, inclusive. **Sample:** 192.0.1.10 |
| | | **start** string | query or update | First address in reservation range, inclusive. **Sample:** 192.0.1.2 |
| | **subnet** string | success | CIDR notation subnet for static route. **Sample:** 192.0.1.0/24 |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_ms_switchport β Manage switchports on a switch in the Meraki cloud cisco.meraki.meraki\_ms\_switchport β Manage switchports on a switch in the Meraki cloud
========================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_ms_switchport`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for management of switchports settings for Meraki MS switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_policy\_number** integer | | Number of the access policy to apply. Only applicable to access port types. |
| **access\_policy\_type** string | **Choices:*** Open
* Custom access policy
* MAC allow list
* Sticky MAC allow list
| Type of access policy to apply to port. |
| **allowed\_vlans** list / elements=string | **Default:**"all" | List of VLAN numbers to be allowed on switchport. |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **enabled** boolean | **Choices:*** no
* **yes** β
| Whether a switchport should be enabled or disabled. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **isolation\_enabled** boolean | **Choices:*** **no** β
* yes
| Isolation status of switchport. |
| **link\_negotiation** string | **Choices:*** **Auto negotiate** β
* 100 Megabit (auto)
* 100 Megabit full duplex (forced)
| Link speed for the switchport. |
| **mac\_allow\_list** dictionary | | MAC addresses list that are allowed on a port. Only applicable to access port type. Only applicable to access\_policy\_type "MAC allow list". |
| | **macs** list / elements=string | | List of MAC addresses to update with based on state option. |
| | **state** string | **Choices:*** merged
* **replaced** β
* deleted
| The state the configuration should be left in. Merged, MAC addresses provided will be added to the current allow list. Replaced, All MAC addresses are overwritten, only the MAC addresses provided with exist in the allow list. Deleted, Remove the MAC addresses provided from the current allow list. |
| **name** string | | Switchport description.
aliases: description |
| **number** string | | Port number. |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **poe\_enabled** boolean | **Choices:*** no
* **yes** β
| Enable or disable Power Over Ethernet on a port. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **rstp\_enabled** boolean | **Choices:*** no
* **yes** β
| Enable or disable Rapid Spanning Tree Protocol on a port. |
| **serial** string / required | | Serial nubmer of the switch. |
| **state** string | **Choices:*** **query** β
* present
| Specifies whether a switchport should be queried or modified. |
| **sticky\_mac\_allow\_list** dictionary | | MAC addresses list that are allowed on a port. Only applicable to access port type. Only applicable to access\_policy\_type "Sticky MAC allow list". |
| | **macs** list / elements=string | | List of MAC addresses to update with based on state option. |
| | **state** string | **Choices:*** merged
* **replaced** β
* deleted
| The state the configuration should be left in. Merged, MAC addresses provided will be added to the current allow list. Replaced, All MAC addresses are overwritten, only the MAC addresses provided with exist in the allow list. Deleted, Remove the MAC addresses provided from the current allow list. |
| **sticky\_mac\_allow\_list\_limit** integer | | The number of MAC addresses allowed in the sticky port allow list. Only applicable to access port type. Only applicable to access\_policy\_type "Sticky MAC allow list". The value must be equal to or greater then the list size of sticky\_mac\_allow\_list. Value will be checked for validity, during processing. |
| **stp\_guard** string | **Choices:*** **disabled** β
* root guard
* bpdu guard
* loop guard
| Set state of STP guard. |
| **tags** list / elements=string | | List of tags to assign to a port. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **type** string | **Choices:*** **access** β
* trunk
| Set port type. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
| **vlan** integer | | VLAN number assigned to port. If a port is of type trunk, the specified VLAN is the native VLAN. |
| **voice\_vlan** integer | | VLAN number assigned to a port for voice traffic. Only applicable to access port type. Only applicable if voice\_vlan\_state is set to present. |
| **voice\_vlan\_state** string | **Choices:*** absent
* **present** β
| Specifies whether voice vlan configuration should be present or absent. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query information about all switchports on a switch
meraki_switchport:
auth_key: abc12345
state: query
serial: ABC-123
delegate_to: localhost
- name: Query information about all switchports on a switch
meraki_switchport:
auth_key: abc12345
state: query
serial: ABC-123
number: 2
delegate_to: localhost
- name: Name switchport
meraki_switchport:
auth_key: abc12345
state: present
serial: ABC-123
number: 7
name: Test Port
delegate_to: localhost
- name: Configure access port with voice VLAN
meraki_switchport:
auth_key: abc12345
state: present
serial: ABC-123
number: 7
enabled: true
name: Test Port
tags: desktop
type: access
vlan: 10
voice_vlan: 11
delegate_to: localhost
- name: Check access port for idempotency
meraki_switchport:
auth_key: abc12345
state: present
serial: ABC-123
number: 7
enabled: true
name: Test Port
tags: desktop
type: access
vlan: 10
voice_vlan: 11
delegate_to: localhost
- name: Configure trunk port with specific VLANs
meraki_switchport:
auth_key: abc12345
state: present
serial: ABC-123
number: 7
enabled: true
name: Server port
tags: server
type: trunk
allowed_vlans:
- 10
- 15
- 20
delegate_to: localhost
- name: Configure access port with sticky MAC allow list and limit.
meraki_switchport:
auth_key: abc12345
state: present
serial: ABC-123
number: 5
sticky_mac_allow_limit: 3
sticky_mac_allow_list:
macs:
- aa:aa:bb:bb:cc:cc
- bb:bb:aa:aa:cc:cc
- 11:aa:bb:bb:cc:cc
state: replaced
delegate_to: localhost
- name: Delete an existing MAC address from the sticky MAC allow list.
meraki_switchport:
auth_key: abc12345
state: present
serial: ABC-123
number: 5
sticky_mac_allow_list:
macs:
- aa:aa:bb:bb:cc:cc
state: deleted
delegate_to: localhost
- name: Add a MAC address to sticky MAC allow list.
meraki_switchport:
auth_key: abc12345
state: present
serial: ABC-123
number: 5
sticky_mac_allow_list:
macs:
- 22:22:bb:bb:cc:cc
state: merged
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Information queried or updated switchports. |
| | **access\_policy\_number** integer | success | Number of assigned access policy. Only applicable to access ports. **Sample:** 1234 |
| | **access\_policy\_type** string | success, when assigned | Type of access policy assigned to port **Sample:** MAC allow list |
| | **allowed\_vlans** string | success, when port is set as access | List of VLANs allowed on an access port **Sample:** all |
| | **enabled** boolean | success | Enabled state of port. **Sample:** True |
| | **isolation\_enabled** boolean | success | Port isolation status of port. **Sample:** True |
| | **link\_negotiation** string | success | Link speed for the port. **Sample:** Auto negotiate |
| | **mac\_allow\_list** list / elements=string | success | List of MAC addresses currently allowed on a non-sticky port. Used with access\_policy\_type of MAC allow list. **Sample:** ['11:aa:bb:bb:cc:cc', '22:aa:bb:bb:cc:cc', '33:aa:bb:bb:cc:cc'] |
| | **name** string | success | Human friendly description of port. **Sample:** Jim Phone Port |
| | **number** integer | success | Number of port. **Sample:** 1 |
| | **poe\_enabled** boolean | success | Power Over Ethernet enabled state of port. **Sample:** True |
| | **port\_schedule\_id** string | success | Unique ID of assigned port schedule |
| | **rstp\_enabled** boolean | success | Enabled or disabled state of Rapid Spanning Tree Protocol (RSTP) **Sample:** True |
| | **sticky\_mac\_allow\_list** list / elements=string | success | List of MAC addresses currently allowed on a sticky port. Used with access\_policy\_type of Sticky MAC allow list. **Sample:** ['11:aa:bb:bb:cc:cc', '22:aa:bb:bb:cc:cc', '33:aa:bb:bb:cc:cc'] |
| | **sticky\_mac\_allow\_list\_limit** integer | success | Number of MAC addresses allowed on a sticky port. **Sample:** 6 |
| | **stp\_guard** string | success | State of STP guard **Sample:** Root Guard |
| | **tags** list / elements=string | success | List of tags assigned to port. **Sample:** ['phone', 'marketing'] |
| | **type** string | success | Type of switchport. **Sample:** trunk |
| | **udld** string | success | Alert state of UDLD **Sample:** Alert only |
| | **vlan** integer | success | VLAN assigned to port. **Sample:** 10 |
| | **voice\_vlan** integer | success | VLAN assigned to port with voice VLAN enabled devices. **Sample:** 20 |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_mx_vlan β Manage VLANs in the Meraki cloud cisco.meraki.meraki\_mx\_vlan β Manage VLANs in the Meraki cloud
================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mx_vlan`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, edit, query, or delete VLANs in a Meraki environment.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **appliance\_ip** string | | IP address of appliance. Address must be within subnet specified in `subnet` parameter. |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **dhcp\_boot\_filename** string | | Filename to boot from for DHCP boot |
| **dhcp\_boot\_next\_server** string | | DHCP boot option to direct boot clients to the server to load boot file from. |
| **dhcp\_boot\_options\_enabled** boolean | **Choices:*** no
* yes
| Enable DHCP boot options |
| **dhcp\_handling** string | **Choices:*** Run a DHCP server
* Relay DHCP to another server
* Do not respond to DHCP requests
* none
* server
* relay
| How to handle DHCP packets on network. |
| **dhcp\_lease\_time** string | **Choices:*** 30 minutes
* 1 hour
* 4 hours
* 12 hours
* 1 day
* 1 week
| DHCP lease timer setting |
| **dhcp\_options** list / elements=dictionary | | List of DHCP option values |
| | **code** integer | | DHCP option number. |
| | **type** string | **Choices:*** text
* ip
* hex
* integer
| Type of value for DHCP option. |
| | **value** string | | Value for DHCP option. |
| **dhcp\_relay\_server\_ips** list / elements=string | | IP addresses to forward DHCP packets to. |
| **dns\_nameservers** string | | Semi-colon delimited list of DNS IP addresses. Specify one of the following options for preprogrammed DNS entries opendns, google\_dns, upstream\_dns |
| **fixed\_ip\_assignments** list / elements=dictionary | | Static IP address assignments to be distributed via DHCP by MAC address. |
| | **ip** string | | IP address for fixed IP assignment binding. |
| | **mac** string | | MAC address for fixed IP assignment binding. |
| | **name** string | | Descriptive name of IP assignment binding. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **name** string | | Name of VLAN.
aliases: vlan\_name |
| **net\_id** string | | ID of network which VLAN is in or should be in. |
| **net\_name** string | | Name of network which VLAN is in or should be in.
aliases: network |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **reserved\_ip\_range** list / elements=dictionary | | IP address ranges which should be reserve and not distributed via DHCP. |
| | **comment** string | | Description of IP addresses reservation |
| | **end** string | | Last IP address of reserved IP address range, inclusive. |
| | **start** string | | First IP address of reserved IP address range, inclusive. |
| **state** string | **Choices:*** absent
* present
* **query** β
| Specifies whether object should be queried, created/modified, or removed. |
| **subnet** string | | CIDR notation of network subnet. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
| **vlan\_id** integer | | ID number of VLAN. ID should be between 1-4096. |
| **vpn\_nat\_subnet** string | | The translated VPN subnet if VPN and VPN subnet translation are enabled on the VLAN. |
Notes
-----
Note
* Merakiβs API will return an error if VLANs arenβt enabled on a network. VLANs are returned properly if VLANs are enabled on a network.
* Some of the options are likely only used for developers within Meraki.
* Merakiβs API defaults to networks having VLAN support disabled and there is no way to enable VLANs support in the API. VLAN support must be enabled manually.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query all VLANs in a network.
meraki_vlan:
auth_key: abc12345
org_name: YourOrg
net_name: YourNet
state: query
delegate_to: localhost
- name: Query information about a single VLAN by ID.
meraki_vlan:
auth_key: abc12345
org_name: YourOrg
net_name: YourNet
vlan_id: 2
state: query
delegate_to: localhost
- name: Create a VLAN.
meraki_vlan:
auth_key: abc12345
org_name: YourOrg
net_name: YourNet
state: present
vlan_id: 2
name: TestVLAN
subnet: 192.0.1.0/24
appliance_ip: 192.0.1.1
delegate_to: localhost
- name: Update a VLAN.
meraki_vlan:
auth_key: abc12345
org_name: YourOrg
net_name: YourNet
state: present
vlan_id: 2
name: TestVLAN
subnet: 192.0.1.0/24
appliance_ip: 192.168.250.2
fixed_ip_assignments:
- mac: "13:37:de:ad:be:ef"
ip: 192.168.250.10
name: fixed_ip
reserved_ip_range:
- start: 192.168.250.10
end: 192.168.250.20
comment: reserved_range
dns_nameservers: opendns
delegate_to: localhost
- name: Enable DHCP on VLAN with options
meraki_vlan:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
vlan_id: 2
name: TestVLAN
subnet: 192.168.250.0/24
appliance_ip: 192.168.250.2
dhcp_handling: server
dhcp_lease_time: 1 hour
dhcp_boot_options_enabled: false
dhcp_options:
- code: 5
type: ip
value: 192.0.1.1
delegate_to: localhost
- name: Delete a VLAN.
meraki_vlan:
auth_key: abc12345
org_name: YourOrg
net_name: YourNet
state: absent
vlan_id: 2
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **response** complex | success | Information about the organization which was created or modified |
| | **appliance\_ip** string | success | IP address of Meraki appliance in the VLAN **Sample:** 192.0.1.1 |
| | **dhcp\_boot\_filename** string | success | Filename for boot file. **Sample:** boot.txt |
| | **dhcp\_boot\_next\_server** string | success | DHCP boot option to direct boot clients to the server to load the boot file from. **Sample:** 192.0.1.2 |
| | **dhcp\_boot\_options\_enabled** boolean | success | Whether DHCP boot options are enabled. |
| | **dhcp\_handling** string | success | Status of DHCP server on VLAN. **Sample:** Run a DHCP server |
| | **dhcp\_lease\_time** string | success | DHCP lease time when server is active. **Sample:** 1 day |
| | **dhcp\_options** complex | success | DHCP options. |
| | | **code** integer | success | Code for DHCP option. Integer between 2 and 254. **Sample:** 43 |
| | | **type** string | success | Type for DHCP option. Choices are `text`, `ip`, `hex`, `integer`. **Sample:** text |
| | | **value** string | success | Value for the DHCP option. **Sample:** 192.0.1.2 |
| | **dnsnamservers** string | success | IP address or Meraki defined DNS servers which VLAN should use by default **Sample:** upstream\_dns |
| | **fixed\_ip\_assignments** complex | success | List of MAC addresses which have IP addresses assigned. |
| | | **macaddress** complex | success | MAC address which has IP address assigned to it. Key value is the actual MAC address. |
| | | | **ip** string | success | IP address which is assigned to the MAC address. **Sample:** 192.0.1.4 |
| | | | **name** string | success | Descriptive name for binding. **Sample:** fixed\_ip |
| | **id** integer | success | VLAN ID number. **Sample:** 2 |
| | **name** string | success | Descriptive name of VLAN. **Sample:** TestVLAN |
| | **networkId** string | success | ID number of Meraki network which VLAN is associated to. **Sample:** N\_12345 |
| | **reserved\_ip\_ranges** complex | success | List of IP address ranges which are reserved for static assignment. |
| | | **comment** string | success | Description for IP address reservation. **Sample:** reserved\_range |
| | | **end** string | success | Last IP address in reservation range. **Sample:** 192.0.1.10 |
| | | **start** string | success | First IP address in reservation range. **Sample:** 192.0.1.5 |
| | **subnet** string | success | CIDR notation IP subnet of VLAN. **Sample:** 192.0.1.0/24 |
### Authors
* Kevin Breit (@kbreit)
| programming_docs |
ansible cisco.meraki.meraki_mr_l3_firewall β Manage MR access point layer 3 firewalls in the Meraki cloud cisco.meraki.meraki\_mr\_l3\_firewall β Manage MR access point layer 3 firewalls in the Meraki cloud
====================================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mr_l3_firewall`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Allows for creation, management, and visibility into layer 3 firewalls implemented on Meraki MR access points.
* Module is not idempotent as of current release.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **allow\_lan\_access** boolean | **Choices:*** no
* **yes** β
| Sets whether devices can talk to other devices on the same LAN. |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **net\_id** string | | ID of network containing access points. |
| **net\_name** string | | Name of network containing access points. |
| **number** string | | Number of SSID to apply firewall rule to.
aliases: ssid\_number |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **rules** list / elements=dictionary | | List of firewall rules. |
| | **comment** string | | Optional comment describing the firewall rule. |
| | **dest\_cidr** string | | Comma-separated list of CIDR notation networks to match. |
| | **dest\_port** string | | Comma-seperated list of destination ports to match. |
| | **policy** string | **Choices:*** allow
* deny
| Specifies the action that should be taken when rule is hit. |
| | **protocol** string | **Choices:*** any
* icmp
* tcp
* udp
| Specifies protocol to match against. |
| **ssid\_name** string | | Name of SSID to apply firewall rule to.
aliases: ssid |
| **state** string | **Choices:*** **present** β
* query
| Create or modify an organization. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Create single firewall rule
meraki_mr_l3_firewall:
auth_key: abc123
state: present
org_name: YourOrg
net_id: 12345
number: 1
rules:
- comment: Integration test rule
policy: allow
protocol: tcp
dest_port: 80
dest_cidr: 192.0.2.0/24
allow_lan_access: no
delegate_to: localhost
- name: Enable local LAN access
meraki_mr_l3_firewall:
auth_key: abc123
state: present
org_name: YourOrg
net_id: 123
number: 1
rules:
allow_lan_access: yes
delegate_to: localhost
- name: Query firewall rules
meraki_mr_l3_firewall:
auth_key: abc123
state: query
org_name: YourOrg
net_name: YourNet
number: 1
delegate_to: localhost
```
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_device β Manage devices in the Meraki cloud cisco.meraki.meraki\_device β Manage devices in the Meraki cloud
================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_device`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Visibility into devices associated to a Meraki environment.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **address** string | | Postal address of device's location. |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **hostname** string | | Hostname of network device to search for.
aliases: name |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **lat** float | | Latitude of device's geographic location. Use negative number for southern hemisphere.
aliases: latitude |
| **lldp\_cdp\_timespan** integer | | Timespan, in seconds, used to query LLDP and CDP information. Must be less than 1 month. |
| **lng** float | | Longitude of device's geographic location. Use negative number for western hemisphere.
aliases: longitude |
| **model** string | | Model of network device to search for. |
| **move\_map\_marker** boolean | **Choices:*** no
* yes
| Whether or not to set the latitude and longitude of a device based on the new address. Only applies when `lat` and `lng` are not specified. |
| **net\_id** string | | ID of a network. |
| **net\_name** string | | Name of a network.
aliases: network |
| **note** string | | Informational notes about a device. Limited to 255 characters. |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **query** string | **Choices:*** lldp\_cdp
* uplink
| Specifies what information should be queried. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **serial** string | | Serial number of a device to query. |
| **state** string | **Choices:*** absent
* present
* **query** β
| Query an organization. |
| **tags** list / elements=string | | Space delimited list of tags to assign to device. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* This module does not support claiming of devices or licenses into a Meraki organization.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query all devices in an organization.
meraki_device:
auth_key: abc12345
org_name: YourOrg
state: query
delegate_to: localhost
- name: Query all devices in a network.
meraki_device:
auth_key: abc12345
org_name: YourOrg
net_name: YourNet
state: query
delegate_to: localhost
- name: Query a device by serial number.
meraki_device:
auth_key: abc12345
org_name: YourOrg
net_name: YourNet
serial: ABC-123
state: query
delegate_to: localhost
- name: Lookup uplink information about a device.
meraki_device:
auth_key: abc12345
org_name: YourOrg
net_name: YourNet
serial_uplink: ABC-123
state: query
delegate_to: localhost
- name: Lookup LLDP and CDP information about devices connected to specified device.
meraki_device:
auth_key: abc12345
org_name: YourOrg
net_name: YourNet
serial_lldp_cdp: ABC-123
state: query
delegate_to: localhost
- name: Lookup a device by hostname.
meraki_device:
auth_key: abc12345
org_name: YourOrg
net_name: YourNet
hostname: main-switch
state: query
delegate_to: localhost
- name: Query all devices of a specific model.
meraki_device:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
model: MR26
state: query
delegate_to: localhost
- name: Update information about a device.
meraki_device:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: present
serial: '{{serial}}'
name: mr26
address: 1060 W. Addison St., Chicago, IL
lat: 41.948038
lng: -87.65568
tags: recently-added
delegate_to: localhost
- name: Claim a device into a network.
meraki_device:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
serial: ABC-123
state: present
delegate_to: localhost
- name: Remove a device from a network.
meraki_device:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
serial: ABC-123
state: absent
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **response** dictionary | info | Data returned from Meraki dashboard. |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_admin β Manage administrators in the Meraki cloud cisco.meraki.meraki\_admin β Manage administrators in the Meraki cloud
======================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_admin`.
New in version 1.0.0: of cisco.meraki
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for creation, management, and visibility into administrators within Meraki.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **email** string | | Email address for the dashboard administrator. Email cannot be updated. Required when creating or editing an administrator. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **name** string | | Name of the dashboard administrator. Required when creating a new administrator. |
| **networks** list / elements=dictionary | | List of networks the administrator has privileges on. When creating a new administrator, `org_name`, `network`, or `tags` must be specified. |
| | **access** string | | The privilege of the dashboard administrator on the network. Valid options are `full`, `read-only`, or `none`. |
| | **id** string | | Network ID for which administrator should have privileges assigned. |
| | **network** string | | Network name for which administrator should have privileges assigned. |
| **org\_access** string | **Choices:*** full
* none
* read-only
| Privileges assigned to the administrator in the organization.
aliases: orgAccess |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization. Used when `name` should refer to another object. When creating a new administrator, `org_name`, `network`, or `tags` must be specified.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string / required | **Choices:*** absent
* present
* query
| Create or modify, or delete an organization If `state` is `absent`, name takes priority over email if both are specified. |
| **tags** list / elements=dictionary | | Tags the administrator has privileges on. When creating a new administrator, `org_name`, `network`, or `tags` must be specified. If `none` is specified, `network` or `tags` must be specified. |
| | **access** string | | The privilege of the dashboard administrator for the tag. |
| | **tag** string | | Object tag which privileges should be assigned. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query information about all administrators associated to the organization
meraki_admin:
auth_key: abc12345
org_name: YourOrg
state: query
delegate_to: localhost
- name: Query information about a single administrator by name
meraki_admin:
auth_key: abc12345
org_id: 12345
state: query
name: Jane Doe
- name: Query information about a single administrator by email
meraki_admin:
auth_key: abc12345
org_name: YourOrg
state: query
email: [email protected]
- name: Create new administrator with organization access
meraki_admin:
auth_key: abc12345
org_name: YourOrg
state: present
name: Jane Doe
org_access: read-only
email: [email protected]
- name: Create new administrator with organization access
meraki_admin:
auth_key: abc12345
org_name: YourOrg
state: present
name: Jane Doe
org_access: read-only
email: [email protected]
- name: Create a new administrator with organization access
meraki_admin:
auth_key: abc12345
org_name: YourOrg
state: present
name: Jane Doe
org_access: read-only
email: [email protected]
- name: Revoke access to an organization for an administrator
meraki_admin:
auth_key: abc12345
org_name: YourOrg
state: absent
email: [email protected]
- name: Create a new administrator with full access to two tags
meraki_admin:
auth_key: abc12345
org_name: YourOrg
state: present
name: Jane Doe
orgAccess: read-only
email: [email protected]
tags:
- tag: tenant
access: full
- tag: corporate
access: read-only
- name: Create a new administrator with full access to a network
meraki_admin:
auth_key: abc12345
org_name: YourOrg
state: present
name: Jane Doe
orgAccess: read-only
email: [email protected]
networks:
- id: N_12345
access: full
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | List of administrators. |
| | **account\_status** string | success | Status of account. **Sample:** ok |
| | **email** string | success | Email address of administrator. **Sample:** [email protected] |
| | **has\_api\_key** boolean | success | Defines whether administrator has an API assigned to their account. |
| | **id** string | success | Unique identification number of administrator. **Sample:** 1234567890 |
| | **last\_active** string | success | Date and time of time the administrator was active within Dashboard. **Sample:** 2019-01-28 14:58:56 -0800 |
| | **name** string | success | Given name of administrator. **Sample:** John Doe |
| | **networks** complex | success | List of networks administrator has access on. |
| | | **access** string | when network permissions are set | Access level of administrator. Options are 'full', 'read-only', or 'none'. **Sample:** read-only |
| | | **id** string | when network permissions are set | The network ID. **Sample:** N\_0123456789 |
| | **org\_access** string | success | The privilege of the dashboard administrator on the organization. Options are 'full', 'read-only', or 'none'. **Sample:** full |
| | **tags** complex | success | Tags the administrator has access on. |
| | | **access** string | when tag permissions are set | Access level of administrator. Options are 'full', 'read-only', or 'none'. **Sample:** full |
| | | **tag** string | when tag permissions are set | Tag name. **Sample:** production |
| | **two\_factor\_auth\_enabled** boolean | success | Enabled state of two-factor authentication for administrator. |
### Authors
* Kevin Breit (@kbreit)
| programming_docs |
ansible cisco.meraki.meraki_organization β Manage organizations in the Meraki cloud cisco.meraki.meraki\_organization β Manage organizations in the Meraki cloud
============================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_organization`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for creation, management, and visibility into organizations within Meraki.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **clone** string | | Organization to clone to a new organization. |
| **delete\_confirm** string | | ID of organization required for confirmation before deletion. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **org\_id** string | | ID of organization.
aliases: id |
| **org\_name** string | | Name of organization. If `clone` is specified, `org_name` is the name of the new organization.
aliases: name, organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Create or modify an organization.
`org_id` must be specified if multiple organizations of the same name exist.
`absent` WILL DELETE YOUR ENTIRE ORGANIZATION, AND ALL ASSOCIATED OBJECTS, WITHOUT CONFIRMATION. USE WITH CAUTION. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Create a new organization named YourOrg
meraki_organization:
auth_key: abc12345
org_name: YourOrg
state: present
delegate_to: localhost
- name: Delete an organization named YourOrg
meraki_organization:
auth_key: abc12345
org_name: YourOrg
state: absent
delegate_to: localhost
- name: Query information about all organizations associated to the user
meraki_organization:
auth_key: abc12345
state: query
delegate_to: localhost
- name: Query information about a single organization named YourOrg
meraki_organization:
auth_key: abc12345
org_name: YourOrg
state: query
delegate_to: localhost
- name: Rename an organization to RenamedOrg
meraki_organization:
auth_key: abc12345
org_id: 987654321
org_name: RenamedOrg
state: present
delegate_to: localhost
- name: Clone an organization named Org to a new one called ClonedOrg
meraki_organization:
auth_key: abc12345
clone: Org
org_name: ClonedOrg
state: present
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Information about the organization which was created or modified |
| | **id** integer | success | Unique identification number of organization **Sample:** 2930418 |
| | **name** string | success | Name of organization **Sample:** YourOrg |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_network β Manage networks in the Meraki cloud cisco.meraki.meraki\_network β Manage networks in the Meraki cloud
==================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_network`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for creation, management, and visibility into networks within Meraki.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **enable\_vlans** boolean | **Choices:*** no
* yes
| Boolean value specifying whether VLANs should be supported on a network. Requires `net_name` or `net_id` to be specified. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **local\_status\_page\_enabled** boolean | **Choices:*** no
* yes
| - Enables the local device status pages (U[my.meraki.com](my.meraki.com), U[ap.meraki.com](ap.meraki.com), U[switch.meraki.com](switch.meraki.com), U[wired.meraki.com](wired.meraki.com)). - Only can be specified on its own or with `remote_status_page_enabled`. |
| **net\_id** string | | ID number of a network. |
| **net\_name** string | | Name of a network.
aliases: name, network |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **remote\_status\_page\_enabled** boolean | **Choices:*** no
* yes
| Enables access to the device status page ([http://device LAN IP](http://device%20LAN%20IP)). Can only be set if `local_status_page_enabled:` is set to `yes`. Only can be specified on its own or with `local_status_page_enabled`. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Create or modify an organization. |
| **tags** list / elements=string | | List of tags to assign to network.
`tags` name conflicts with the tags parameter in Ansible. Indentation problems may cause unexpected behaviors. Ansible 2.8 converts this to a list from a comma separated list. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **timezone** string | | Timezone associated to network. See <https://en.wikipedia.org/wiki/List_of_tz_database_time_zones> for a list of valid timezones. |
| **type** list / elements=string | **Choices:*** appliance
* switch
* wireless
| Type of network device network manages. Required when creating a network. As of Ansible 2.8, `combined` type is no longer accepted. As of Ansible 2.8, changes to this parameter are no longer idempotent.
aliases: net\_type |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- delegate_to: localhost
block:
- name: List all networks associated to the YourOrg organization
meraki_network:
auth_key: abc12345
state: query
org_name: YourOrg
- name: Query network named MyNet in the YourOrg organization
meraki_network:
auth_key: abc12345
state: query
org_name: YourOrg
net_name: MyNet
- name: Create network named MyNet in the YourOrg organization
meraki_network:
auth_key: abc12345
state: present
org_name: YourOrg
net_name: MyNet
type: switch
timezone: America/Chicago
tags: production, chicago
- name: Create combined network named MyNet in the YourOrg organization
meraki_network:
auth_key: abc12345
state: present
org_name: YourOrg
net_name: MyNet
type:
- switch
- appliance
timezone: America/Chicago
tags: production, chicago
- name: Enable VLANs on a network
meraki_network:
auth_key: abc12345
state: query
org_name: YourOrg
net_name: MyNet
enable_vlans: yes
- name: Modify local status page enabled state
meraki_network:
auth_key: abc12345
state: query
org_name: YourOrg
net_name: MyNet
local_status_page_enabled: yes
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | info | Information about the created or manipulated object. |
| | **id** string | success | Identification string of network. **Sample:** N\_12345 |
| | **local\_status\_page\_enabled** boolean | success | States whether <my.meraki.com> and other device portals should be enabled. **Sample:** True |
| | **name** string | success | Written name of network. **Sample:** YourNet |
| | **organization\_id** string | success | Organization ID which owns the network. **Sample:** 0987654321 |
| | **remote\_status\_page\_enabled** boolean | success | Enables access to the device status page. **Sample:** True |
| | **tags** list / elements=string | success | Space delimited tags assigned to network. **Sample:** ['production'] |
| | **time\_zone** string | success | Timezone where network resides. **Sample:** America/Chicago |
| | **type** list / elements=string | success | Functional type of network. **Sample:** ['switch'] |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_management_interface β Configure Meraki management interfaces cisco.meraki.meraki\_management\_interface β Configure Meraki management interfaces
===================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_management_interface`.
New in version 1.1.0: of cisco.meraki
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for configuration of management interfaces on Meraki MX, MS, and MR devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **net\_id** string | | ID of the network to bind or unbind configuration template to. |
| **net\_name** string | | Name of the network to bind or unbind configuration template to. |
| **org\_id** string | | ID of organization associated to a configuration template. |
| **org\_name** string | | Name of organization containing the configuration template.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **serial** string / required | | serial number of the device to configure. |
| **state** string | **Choices:*** absent
* **query** β
* present
| Specifies whether configuration template information should be queried, modified, or deleted. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
| **wan1** dictionary | | Management interface details for management interface.
aliases: mgmt1 |
| | **static\_dns** list / elements=string | | DNS servers to use. Allows for a maximum of 2 addresses. |
| | **static\_gateway\_ip** string | | IP address for default gateway. Valid only if `using_static_ip` is `True`. |
| | **static\_ip** string | | IP address assigned to Management interface. Valid only if `using_static_ip` is `True`. |
| | **static\_subnet\_mask** string | | Netmask for static IP address. Valid only if `using_static_ip` is `True`. |
| | **using\_static\_ip** boolean | **Choices:*** no
* yes
| Configures the interface to use static IP or DHCP. |
| | **vlan** integer | | VLAN number to use for the management network. |
| | **wan\_enabled** string | **Choices:*** disabled
* enabled
* not configured
| States whether the management interface is enabled. Only valid for MX devices. |
| **wan2** dictionary | | Management interface details for management interface.
aliases: mgmt2 |
| | **static\_dns** list / elements=string | | DNS servers to use. Allows for a maximum of 2 addresses. |
| | **static\_gateway\_ip** string | | IP address for default gateway. Valid only if `using_static_ip` is `True`. |
| | **static\_ip** string | | IP address assigned to Management interface. Valid only if `using_static_ip` is `True`. |
| | **static\_subnet\_mask** string | | Netmask for static IP address. Valid only if `using_static_ip` is `True`. |
| | **using\_static\_ip** boolean | **Choices:*** no
* yes
| Configures the interface to use static IP or DHCP. |
| | **vlan** integer | | VLAN number to use for the management network. |
| | **wan\_enabled** string | **Choices:*** disabled
* enabled
* not configured
| States whether the management interface is enabled. Only valid for MX devices. |
Notes
-----
Note
* `WAN2` parameter is only valid for MX appliances.
* `wan_enabled` should not be provided for non-MX devies.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Set WAN2 as static IP
meraki_management_interface:
auth_key: abc123
state: present
org_name: YourOrg
net_id: YourNetId
serial: AAAA-BBBB-CCCC
wan2:
wan_enabled: enabled
using_static_ip: yes
static_ip: 192.168.16.195
static_gateway_ip: 192.168.16.1
static_subnet_mask: 255.255.255.0
static_dns:
- 1.1.1.1
vlan: 1
delegate_to: localhost
- name: Query management information
meraki_management_interface:
auth_key: abc123
state: query
org_name: YourOrg
net_id: YourNetId
serial: AAAA-BBBB-CCCC
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Information about queried object. |
| | **wan1** complex | success | Management configuration for WAN1 interface |
| | | **static\_dns** list / elements=string | only if static IP assignment is used | List of DNS IP addresses **Sample:** ['1.1.1.1'] |
| | | **static\_gateway\_ip** string | only if static IP assignment is used | Assigned static gateway IP **Sample:** 192.0.1.1 |
| | | **static\_ip** string | only if static IP assignment is used | Assigned static IP **Sample:** 192.0.1.2 |
| | | **static\_subnet\_mask** string | only if static IP assignment is used | Assigned netmask for static IP **Sample:** 255.255.255.0 |
| | | **using\_static\_ip** boolean | success | Boolean value of whether static IP assignment is used on interface **Sample:** True |
| | | **vlan** integer | success | VLAN tag id of management VLAN **Sample:** 2 |
| | | **wan\_enabled** string | success | Enabled state of interface **Sample:** enabled |
| | **wan2** complex | success | Management configuration for WAN1 interface |
| | | **static\_dns** list / elements=string | only if static IP assignment is used | List of DNS IP addresses **Sample:** ['1.1.1.1'] |
| | | **static\_gateway\_ip** string | only if static IP assignment is used | Assigned static gateway IP **Sample:** 192.0.1.1 |
| | | **static\_ip** string | only if static IP assignment is used | Assigned static IP **Sample:** 192.0.1.2 |
| | | **static\_subnet\_mask** string | only if static IP assignment is used | Assigned netmask for static IP **Sample:** 255.255.255.0 |
| | | **using\_static\_ip** boolean | success | Boolean value of whether static IP assignment is used on interface **Sample:** True |
| | | **vlan** integer | success | VLAN tag id of management VLAN **Sample:** 2 |
| | | **wan\_enabled** string | success | Enabled state of interface **Sample:** enabled |
### Authors
* Kevin Breit (@kbreit)
| programming_docs |
ansible cisco.meraki.meraki_mx_uplink_bandwidth β Manage uplinks on Meraki MX appliances cisco.meraki.meraki\_mx\_uplink\_bandwidth β Manage uplinks on Meraki MX appliances
===================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mx_uplink_bandwidth`.
New in version 1.1.0: of cisco.meraki
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Configure and query information about uplinks on Meraki MX appliances.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **cellular** dictionary | | Configuration of cellular uplink |
| | **bandwidth\_limits** dictionary | | Structure for configuring bandwidth limits |
| | | **limit\_down** integer | | Maximum download speed for interface |
| | | **limit\_up** integer | | Maximum upload speed for interface |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **net\_id** string | | ID of network which VLAN is in or should be in. |
| **net\_name** string | | Name of network which VLAN is in or should be in.
aliases: network |
| **org\_id** string | | ID of organization associated to a network. |
| **org\_name** string | | Name of organization associated to a network.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** absent
* present
* **query** β
| Specifies whether object should be queried, created/modified, or removed. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
| **wan1** dictionary | | Configuration of WAN1 uplink |
| | **bandwidth\_limits** dictionary | | Structure for configuring bandwidth limits |
| | | **limit\_down** integer | | Maximum download speed for interface |
| | | **limit\_up** integer | | Maximum upload speed for interface |
| **wan2** dictionary | | Configuration of WAN2 uplink |
| | **bandwidth\_limits** dictionary | | Structure for configuring bandwidth limits |
| | | **limit\_down** integer | | Maximum download speed for interface |
| | | **limit\_up** integer | | Maximum upload speed for interface |
Notes
-----
Note
* Some of the options are likely only used for developers within Meraki.
* Module was formerly named M(meraki\_mx\_uplink).
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Set MX uplink settings
meraki_mx_uplink_bandwidth:
auth_key: '{{auth_key}}'
state: present
org_name: '{{test_org_name}}'
net_name: '{{test_net_name}} - Uplink'
wan1:
bandwidth_limits:
limit_down: 1000000
limit_up: 1000
cellular:
bandwidth_limits:
limit_down: 0
limit_up: 0
delegate_to: localhost
- name: Query MX uplink settings
meraki_mx_uplink_bandwidth:
auth_key: '{{auth_key}}'
state: query
org_name: '{{test_org_name}}'
net_name: '{{test_net_name}} - Uplink'
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Information about the organization which was created or modified |
| | **cellular** complex | success | cellular interface |
| | | **bandwidth\_limits** complex | success | Structure for uplink bandwidth limits |
| | | | **limit\_down** integer | success | Download bandwidth limit |
| | | | **limit\_up** integer | success | Upload bandwidth limit |
| | **wan1** complex | success | WAN1 interface |
| | | **bandwidth\_limits** complex | success | Structure for uplink bandwidth limits |
| | | | **limit\_down** integer | success | Download bandwidth limit |
| | | | **limit\_up** integer | success | Upload bandwidth limit |
| | **wan2** complex | success | WAN2 interface |
| | | **bandwidth\_limits** complex | success | Structure for uplink bandwidth limits |
| | | | **limit\_down** integer | success | Download bandwidth limit |
| | | | **limit\_up** integer | success | Upload bandwidth limit |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_snmp β Manage organizations in the Meraki cloud cisco.meraki.meraki\_snmp β Manage organizations in the Meraki cloud
====================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_snmp`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for management of SNMP settings for Meraki.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access** string | **Choices:*** community
* none
* users
| Type of SNMP access. |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **community\_string** string | | SNMP community string. Only relevant if `access` is set to `community`. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **net\_id** string | | ID of network. |
| **net\_name** string | | Name of network. |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **peer\_ips** list / elements=string | | List of IP addresses which can perform SNMP queries. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** query
* **present** β
| Specifies whether SNMP information should be queried or modified. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **users** list / elements=dictionary | | Information about users with access to SNMP. Only relevant if `access` is set to `users`. |
| | **passphrase** string | | Passphrase for user SNMP access. |
| | **username** string | | Username of user with access. |
| **v2c\_enabled** boolean | **Choices:*** no
* yes
| Specifies whether SNMPv2c is enabled. |
| **v3\_auth\_mode** string | **Choices:*** MD5
* SHA
| Sets authentication mode for SNMPv3. |
| **v3\_auth\_pass** string | | Authentication password for SNMPv3. Must be at least 8 characters long. |
| **v3\_enabled** boolean | **Choices:*** no
* yes
| Specifies whether SNMPv3 is enabled. |
| **v3\_priv\_mode** string | **Choices:*** DES
* AES128
| Specifies privacy mode for SNMPv3. |
| **v3\_priv\_pass** string | | Privacy password for SNMPv3. Must be at least 8 characters long. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query SNMP values
meraki_snmp:
auth_key: abc12345
org_name: YourOrg
state: query
delegate_to: localhost
- name: Enable SNMPv2
meraki_snmp:
auth_key: abc12345
org_name: YourOrg
state: present
v2c_enabled: yes
delegate_to: localhost
- name: Disable SNMPv2
meraki_snmp:
auth_key: abc12345
org_name: YourOrg
state: present
v2c_enabled: no
delegate_to: localhost
- name: Enable SNMPv3
meraki_snmp:
auth_key: abc12345
org_name: YourOrg
state: present
v3_enabled: true
v3_auth_mode: SHA
v3_auth_pass: ansiblepass
v3_priv_mode: AES128
v3_priv_pass: ansiblepass
peer_ips: 192.0.1.1;192.0.1.2
delegate_to: localhost
- name: Set network access type to community string
meraki_snmp:
auth_key: abc1235
org_name: YourOrg
net_name: YourNet
state: present
access: community
community_string: abc123
delegate_to: localhost
- name: Set network access type to username
meraki_snmp:
auth_key: abc1235
org_name: YourOrg
net_name: YourNet
state: present
access: users
users:
- username: ansibleuser
passphrase: ansiblepass
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | always | Information about SNMP settings. |
| | **access** string | success, when network specified | Type of SNMP access. |
| | **community\_string** string | success, when network specified | SNMP community string. Only relevant if `access` is set to `community`. |
| | **hostname** string | success and no network specified. | Hostname of SNMP server. **Sample:** n1.meraki.com |
| | **peer\_ips** string | success and no network specified. | Semi-colon delimited list of IPs which can poll SNMP information. **Sample:** 192.0.1.1 |
| | **port** string | success and no network specified. | Port number of SNMP. **Sample:** 16100 |
| | **users** complex | success | Information about users with access to SNMP. Only relevant if `access` is set to `users`. |
| | | **passphrase** string | success, when network specified | Passphrase for user SNMP access. |
| | | **username** string | success, when network specified | Username of user with access. |
| | **v2\_community\_string** string | When SNMPv2c is enabled and no network specified. | Automatically generated community string for SNMPv2c. **Sample:** o/8zd-JaSb |
| | **v2c\_enabled** boolean | success and no network specified. | Shows enabled state of SNMPv2c **Sample:** True |
| | **v3\_auth\_mode** string | success and no network specified. | The SNMP version 3 authentication mode either MD5 or SHA. **Sample:** SHA |
| | **v3\_enabled** boolean | success and no network specified. | Shows enabled state of SNMPv3 **Sample:** True |
| | **v3\_priv\_mode** string | success and no network specified. | The SNMP version 3 privacy mode DES or AES128. **Sample:** AES128 |
| | **v3\_user** string | When SNMPv3c is enabled and no network specified. | Automatically generated username for SNMPv3. **Sample:** o/8zd-JaSb |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_firewalled_services β Edit firewall policies for administrative network services cisco.meraki.meraki\_firewalled\_services β Edit firewall policies for administrative network services
======================================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_firewalled_services`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for setting policy firewalled services for Meraki network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access** string | **Choices:*** blocked
* restricted
* unrestricted
| Network service to query or modify. |
| **allowed\_ips** list / elements=string | | List of IP addresses allowed to access a service. Only used when `access` is set to restricted. |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable MERAKI\_KEY is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **net\_id** string | | ID number of a network. |
| **net\_name** string | | Name of a network.
aliases: network |
| **org\_id** string | | ID of organization associated to a network. |
| **org\_name** string | | Name of organization associated to a network.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **service** string | **Choices:*** ICMP
* SNMP
* web
| Network service to query or modify. |
| **state** string | **Choices:*** **present** β
* query
| States that a policy should be created or modified. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Set icmp service to blocked
meraki_firewalled_services:
auth_key: '{{ auth_key }}'
state: present
org_name: '{{test_org_name}}'
net_name: IntTestNetworkAppliance
service: ICMP
access: blocked
delegate_to: localhost
- name: Set icmp service to restricted
meraki_firewalled_services:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
service: web
access: restricted
allowed_ips:
- 192.0.1.1
- 192.0.1.2
delegate_to: localhost
- name: Query appliance services
meraki_firewalled_services:
auth_key: abc123
state: query
org_name: YourOrg
net_name: YourNet
delegate_to: localhost
- name: Query services
meraki_firewalled_services:
auth_key: abc123
state: query
org_name: YourOrg
net_name: YourNet
service: ICMP
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | info | List of network services. |
| | **access** string | success | Access assigned to a service type. **Sample:** unrestricted |
| | **allowed\_ips** string | success | List of IP addresses to have access to service. **Sample:** 192.0.1.0 |
| | **service** string | success | Service to apply policy to. **Sample:** ICMP |
### Authors
* Kevin Breit (@kbreit)
| programming_docs |
ansible cisco.meraki.meraki_mr_rf_profile β Manage RF profiles for Meraki wireless networks cisco.meraki.meraki\_mr\_rf\_profile β Manage RF profiles for Meraki wireless networks
======================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mr_rf_profile`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for configuration of radio frequency (RF) profiles in Meraki MR wireless networks.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **ap\_band\_settings** dictionary | | Settings that will be enabled if selectionType is set to 'ap'. |
| | **band\_steering\_enabled** boolean | **Choices:*** no
* yes
| Steers client to most open band. |
| | **mode** string | **Choices:*** 2.4ghz
* 5ghz
* dual
| Sets which RF band the AP will support.
aliases: band\_operation\_mode |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **band\_selection\_type** string | **Choices:*** ssid
* ap
| Sets whether band selection is assigned per access point or SSID. This param is required on creation. |
| **client\_balancing\_enabled** boolean | **Choices:*** no
* yes
| Steers client to best available access point. |
| **five\_ghz\_settings** dictionary | | Settings related to 5Ghz band. |
| | **channel\_width** string | **Choices:*** auto
* 20
* 40
* 80
| Sets channel width (MHz) for 5Ghz band. |
| | **max\_power** integer | | Sets max power (dBm) of 5Ghz band. Can be integer between 8 and 30. |
| | **min\_bitrate** integer | **Choices:*** 6
* 9
* 12
* 18
* 24
* 36
* 48
* 54
| Sets minimum bitrate (Mbps) of 5Ghz band. |
| | **min\_power** integer | | Sets minmimum power (dBm) of 5Ghz band. Can be integer between 8 and 30. |
| | **rxsop** integer | | The RX-SOP level controls the sensitivity of the radio. It is strongly recommended to use RX-SOP only after consulting a wireless expert. RX-SOP can be configured in the range of -65 to -95 (dBm). |
| | **valid\_auto\_channels** list / elements=integer | **Choices:*** 36
* 40
* 44
* 48
* 52
* 56
* 60
* 64
* 100
* 104
* 108
* 112
* 116
* 120
* 124
* 128
* 132
* 136
* 140
* 144
* 149
* 153
* 157
* 161
* 165
| Sets valid auto channels for 5Ghz band. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **min\_bitrate\_type** string | **Choices:*** band
* ssid
| Type of minimum bitrate. |
| **name** string | | The unique name of the new profile. This param is required on creation. |
| **net\_id** string | | ID of network. |
| **net\_name** string | | Name of network. |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **profile\_id** string | | Unique identifier of existing RF profile.
aliases: id |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** **present** β
* query
* absent
| Query, edit, or delete wireless RF profile settings. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **two\_four\_ghz\_settings** dictionary | | Settings related to 2.4Ghz band |
| | **ax\_enabled** boolean | **Choices:*** no
* yes
| Determines whether ax radio on 2.4Ghz band is on or off. |
| | **max\_power** integer | | Sets max power (dBm) of 2.4Ghz band. Can be integer between 5 and 30. |
| | **min\_bitrate** float | **Choices:*** 1
* 2
* 5.5
* 6
* 9
* 11
* 12
* 18
* 24
* 36
* 48
* 54
| Sets minimum bitrate (Mbps) of 2.4Ghz band. |
| | **min\_power** integer | | Sets minmimum power (dBm) of 2.4Ghz band. Can be integer between 5 and 30. |
| | **rxsop** integer | | The RX-SOP level controls the sensitivity of the radio. It is strongly recommended to use RX-SOP only after consulting a wireless expert. RX-SOP can be configured in the range of -65 to -95 (dBm). |
| | **valid\_auto\_channels** list / elements=integer | **Choices:*** 1
* 6
* 11
| Sets valid auto channels for 2.4Ghz band. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Create RF profile in check mode
meraki_mr_rf_profile:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: present
name: Test Profile
band_selection_type: ap
client_balancing_enabled: True
ap_band_settings:
mode: dual
band_steering_enabled: true
five_ghz_settings:
max_power: 10
min_bitrate: 12
min_power: 8
rxsop: -65
channel_width: 20
valid_auto_channels:
- 36
- 40
- 44
two_four_ghz_settings:
max_power: 10
min_bitrate: 12
min_power: 8
rxsop: -65
ax_enabled: false
valid_auto_channels:
- 1
delegate_to: localhost
- name: Query all RF profiles
meraki_mr_rf_profile:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: query
delegate_to: localhost
- name: Query one RF profile by ID
meraki_mr_rf_profile:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: query
profile_id: '{{ profile_id }}'
delegate_to: localhost
- name: Update profile
meraki_mr_rf_profile:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: present
profile_id: 12345
band_selection_type: ap
client_balancing_enabled: True
ap_band_settings:
mode: dual
band_steering_enabled: true
five_ghz_settings:
max_power: 10
min_bitrate: 12
min_power: 8
rxsop: -65
channel_width: 20
valid_auto_channels:
- 36
- 44
two_four_ghz_settings:
max_power: 10
min_bitrate: 12
min_power: 8
rxsop: -75
ax_enabled: false
valid_auto_channels:
- 1
delegate_to: localhost
- name: Delete RF profile
meraki_mr_rf_profile:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: absent
profile_id: 12345
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | List of wireless RF profile settings. |
| | **ap\_band\_settings** complex | success | Settings that will be enabled if selectionType is set to 'ap'. |
| | | **band\_steering\_enabled** boolean | success | Steers client to most open band. **Sample:** True |
| | | **mode** string | success | Sets which RF band the AP will support. **Sample:** dual |
| | **band\_selection\_type** string | success | Sets whether band selection is assigned per access point or SSID. This param is required on creation. **Sample:** ap |
| | **client\_balancing\_enabled** boolean | success | Steers client to best available access point. **Sample:** True |
| | **five\_ghz\_settings** complex | success | Settings related to 5Ghz band. |
| | | **channel\_width** string | success | Sets channel width (MHz) for 5Ghz band. **Sample:** auto |
| | | **max\_power** integer | success | Sets max power (dBm) of 5Ghz band. Can be integer between 8 and 30. **Sample:** 12 |
| | | **min\_bitrate** integer | success | Sets minimum bitrate (Mbps) of 5Ghz band. **Sample:** 6 |
| | | **min\_power** integer | success | Sets minmimum power (dBm) of 5Ghz band. Can be integer between 8 and 30. **Sample:** 12 |
| | | **rxsop** integer | success | The RX-SOP level controls the sensitivity of the radio. **Sample:** -70 |
| | | **valid\_auto\_channels** list / elements=string | success | Sets valid auto channels for 5Ghz band. |
| | **id** string | success | Unique identifier of existing RF profile. **Sample:** 12345 |
| | **min\_bitrate\_type** string | success | Type of minimum bitrate. **Sample:** ssid |
| | **name** string | success | The unique name of the new profile. This param is required on creation. **Sample:** Guest RF profile |
| | **two\_four\_ghz\_settings** complex | success | Settings related to 2.4Ghz band |
| | | **ax\_enabled** boolean | success | Determines whether ax radio on 2.4Ghz band is on or off. **Sample:** True |
| | | **max\_power** integer | success | Sets max power (dBm) of 2.4Ghz band. **Sample:** 12 |
| | | **min\_bitrate** float | success | Sets minimum bitrate (Mbps) of 2.4Ghz band. **Sample:** 5.5 |
| | | **min\_power** integer | success | Sets minmimum power (dBm) of 2.4Ghz band. **Sample:** 12 |
| | | **rxsop** integer | success | The RX-SOP level controls the sensitivity of the radio. **Sample:** -70 |
| | | **valid\_auto\_channels** list / elements=string | success | Sets valid auto channels for 2.4Ghz band. **Sample:** 6 |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_ms_stack_l3_interface β Manage routed interfaces on MS switches cisco.meraki.meraki\_ms\_stack\_l3\_interface β Manage routed interfaces on MS switches
=======================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_ms_stack_l3_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for creation, management, and visibility into routed interfaces on Meraki MS switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **default\_gateway** string | | The next hop for any traffic that isn't going to a directly connected subnet or over a static route. This IP address must exist in a subnet with a routed interface. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **interface\_id** string | | Uniqiue identification number for layer 3 interface. |
| **interface\_ip** string | | The IP address this switch will use for layer 3 routing on this VLAN or subnet. This cannot be the same as the switch's management IP. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **multicast\_routing** string | **Choices:*** disabled
* enabled
* IGMP snooping querier
| Enable multicast support if multicast routing between VLANs is required. |
| **name** string | | A friendly name or description for the interface or VLAN. |
| **net\_id** string | | ID of network which configuration is applied to. |
| **net\_name** string | | Name of network which configuration is applied to.
aliases: network |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **ospf\_settings** dictionary | | The OSPF routing settings of the interface. |
| | **area** string | | The OSPF area to which this interface should belong. Can be either 'disabled' or the identifier of an existing OSPF area. |
| | **cost** integer | | The path cost for this interface. |
| | **is\_passive\_enabled** boolean | **Choices:*** no
* yes
| When enabled, OSPF will not run on the interface, but the subnet will still be advertised. |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **stack\_id** string | | The unique identifier of the stack. |
| **state** string | **Choices:*** **present** β
* query
* absent
| Create or modify an organization. |
| **subnet** string | | The network that this routed interface is on, in CIDR notation. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
| **vlan\_id** integer | | The VLAN this routed interface is on. VLAN must be between 1 and 4094. |
Notes
-----
Note
* Once a layer 3 interface is created, the API does not allow updating the interface and specifying `default_gateway`.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query all l3 interfaces
meraki_ms_stack_l3_interface:
auth_key: abc123
state: query
serial: aaa-bbb-ccc
- name: Query one l3 interface
meraki_ms_stack_l3_interface:
auth_key: abc123
state: query
serial: aaa-bbb-ccc
name: Test L3 interface
- name: Create l3 interface
meraki_ms_stack_l3_interface:
auth_key: abc123
state: present
serial: aaa-bbb-ccc
name: "Test L3 interface 2"
subnet: "192.168.3.0/24"
interface_ip: "192.168.3.2"
multicast_routing: disabled
vlan_id: 11
ospf_settings:
area: 0
cost: 1
is_passive_enabled: true
- name: Update l3 interface
meraki_ms_stack_l3_interface:
auth_key: abc123
state: present
serial: aaa-bbb-ccc
name: "Test L3 interface 2"
subnet: "192.168.3.0/24"
interface_ip: "192.168.3.2"
multicast_routing: disabled
vlan_id: 11
ospf_settings:
area: 0
cost: 2
is_passive_enabled: true
- name: Delete l3 interface
meraki_ms_stack_l3_interface:
auth_key: abc123
state: absent
serial: aaa-bbb-ccc
interface_id: abc123344566
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Information about the layer 3 interfaces. |
| | **default\_gateway** string | success | The next hop for any traffic that isn't going to a directly connected subnet or over a static route. **Sample:** 192.168.2.1 |
| | **interface\_id** string | success | Uniqiue identification number for layer 3 interface. **Sample:** 62487444811111120 |
| | **interface\_ip** string | success | The IP address this switch will use for layer 3 routing on this VLAN or subnet. **Sample:** 192.168.2.2 |
| | **multicast\_routing** string | success | Enable multicast support if multicast routing between VLANs is required. **Sample:** disabled |
| | **name** string | success | A friendly name or description for the interface or VLAN. **Sample:** L3 interface |
| | **ospf\_settings** complex | success | The OSPF routing settings of the interface. |
| | | **area** string | success | The OSPF area to which this interface should belong. |
| | | **cost** integer | success | The path cost for this interface. **Sample:** 1 |
| | | **is\_passive\_enabled** boolean | success | When enabled, OSPF will not run on the interface, but the subnet will still be advertised. **Sample:** True |
| | **subnet** string | success | The network that this routed interface is on, in CIDR notation. **Sample:** 192.168.2.0/24 |
| | **vlan\_id** integer | success | The VLAN this routed interface is on. **Sample:** 10 |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_mr_settings β Manage general settings for Meraki wireless networks cisco.meraki.meraki\_mr\_settings β Manage general settings for Meraki wireless networks
========================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mr_settings`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for configuration of general settings in Meraki MR wireless networks.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **ipv6\_bridge\_enabled** boolean | **Choices:*** no
* yes
| Toggle for enabling or disabling IPv6 bridging in a network. If enabled, SSIDs must also be configured to use bridge mode. |
| **led\_lights\_on** boolean | **Choices:*** no
* yes
| Toggle for enabling or disabling LED lights on all APs in the network. |
| **location\_analytics\_enabled** boolean | **Choices:*** no
* yes
| Toggle for enabling or disabling location analytics for your network. |
| **meshing\_enabled** boolean | **Choices:*** no
* yes
| Toggle for enabling or disabling meshing in a network. |
| **net\_id** string | | ID of network. |
| **net\_name** string | | Name of network. |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** **present** β
* query
| Query or edit wireless settings. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **upgrade\_strategy** string | **Choices:*** minimize\_upgrade\_time
* minimize\_client\_downtime
| The upgrade strategy to apply to the network. Requires firmware version MR 26.8 or higher. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query all settings
meraki_mr_settings:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: query
delegate_to: localhost
- name: Configure settings
meraki_mr_settings:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: present
upgrade_strategy: minimize_upgrade_time
ipv6_bridge_enabled: false
led_lights_on: true
location_analytics_enabled: true
meshing_enabled: true
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | List of wireless settings. |
| | **ipv6\_bridge\_enabled** boolean | success | Toggle for enabling or disabling IPv6 bridging in a network. If enabled, SSIDs must also be configured to use bridge mode. **Sample:** True |
| | **led\_lights\_on** boolean | success | Toggle for enabling or disabling LED lights on all APs in the network. **Sample:** True |
| | **location\_analytics\_enabled** boolean | success | Toggle for enabling or disabling location analytics for your network. **Sample:** True |
| | **meshing\_enabled** boolean | success | Toggle for enabling or disabling meshing in a network. **Sample:** True |
| | **upgrade\_strategy** string | success | The upgrade strategy to apply to the network. Requires firmware version MR 26.8 or higher. **Sample:** minimize\_upgrade\_time |
### Authors
* Kevin Breit (@kbreit)
| programming_docs |
ansible cisco.meraki.meraki_mx_intrusion_prevention β Manage intrustion prevention in the Meraki cloud cisco.meraki.meraki\_mx\_intrusion\_prevention β Manage intrustion prevention in the Meraki cloud
=================================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mx_intrusion_prevention`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for management of intrusion prevention rules networks within Meraki MX networks.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **allowed\_rules** list / elements=dictionary | | List of IDs related to rules which are allowed for the organization. |
| | **rule\_id** string | | ID of rule as defined by Snort. |
| | **rule\_message** string added in 2.3.0 of cisco.meraki | | Description of rule. This is overwritten by the API. Formerly `message` which was deprecated but still maintained as an alias.
aliases: message |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **ids\_rulesets** string | **Choices:*** connectivity
* balanced
* security
| Ruleset complexity setting. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **mode** string | **Choices:*** detection
* disabled
* prevention
| Operational mode of Intrusion Prevention system. |
| **net\_id** string | | ID number of a network. |
| **net\_name** string | | Name of a network.
aliases: name, network |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **protected\_networks** dictionary | | Set included/excluded networks for Intrusion Prevention. |
| | **excluded\_cidr** list / elements=string | | List of network IP ranges to exclude from scanning. |
| | **included\_cidr** list / elements=string | | List of network IP ranges to include in scanning. |
| | **use\_default** boolean | **Choices:*** no
* yes
| Whether to use special IPv4 addresses per RFC 5735. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** absent
* **present** β
* query
| Create or modify an organization. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Set whitelist for organization
meraki_intrusion_prevention:
auth_key: '{{auth_key}}'
state: present
org_id: '{{test_org_id}}'
allowed_rules:
- rule_id: "meraki:intrusion/snort/GID/01/SID/5805"
rule_message: Test rule
delegate_to: localhost
- name: Query IPS info for organization
meraki_intrusion_prevention:
auth_key: '{{auth_key}}'
state: query
org_name: '{{test_org_name}}'
delegate_to: localhost
register: query_org
- name: Set full ruleset with check mode
meraki_intrusion_prevention:
auth_key: '{{auth_key}}'
state: present
org_name: '{{test_org_name}}'
net_name: '{{test_net_name}} - IPS'
mode: prevention
ids_rulesets: security
protected_networks:
use_default: true
included_cidr:
- 192.0.1.0/24
excluded_cidr:
- 10.0.1.0/24
delegate_to: localhost
- name: Clear rules from organization
meraki_intrusion_prevention:
auth_key: '{{auth_key}}'
state: absent
org_name: '{{test_org_name}}'
allowed_rules: []
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Information about the Threat Protection settings. |
| | **idsRulesets** string | success, when network is queried or modified | Setting of selected ruleset. **Sample:** balanced |
| | **mode** string | success, when network is queried or modified | Enabled setting of intrusion prevention. **Sample:** enabled |
| | **protectedNetworks** complex | success, when network is queried or modified | Networks protected by IPS. |
| | | **excludedCidr** string | success, when network is queried or modified | List of CIDR notiation networks to exclude from protection. **Sample:** 192.0.1.0/24 |
| | | **includedCidr** string | success, when network is queried or modified | List of CIDR notiation networks to protect. **Sample:** 192.0.1.0/24 |
| | | **useDefault** boolean | success, when network is queried or modified | Whether to use special IPv4 addresses. **Sample:** True |
| | **whitelistedRules** complex | success, when organization is queried or modified | List of whitelisted IPS rules. |
| | | **rule\_message** string | success, when organization is queried or modified | Description of rule. **Sample:** MALWARE-OTHER Trackware myway speedbar runtime detection - switch engines |
| | | **ruleId** string | success, when organization is queried or modified | A rule identifier for an IPS rule. **Sample:** meraki:intrusion/snort/GID/01/SID/5805 |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_mx_nat β Manage NAT rules in Meraki cloud cisco.meraki.meraki\_mx\_nat β Manage NAT rules in Meraki cloud
===============================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mx_nat`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for creation, management, and visibility of NAT rules (1:1, 1:many, port forwarding) within Meraki.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **net\_id** string | | ID number of a network. |
| **net\_name** string | | Name of a network.
aliases: name, network |
| **one\_to\_many** list / elements=dictionary | | List of 1:many NAT rules. |
| | **port\_rules** list / elements=dictionary | | List of associated port rules. |
| | | **allowed\_ips** list / elements=string | | Remote IP addresses or ranges that are permitted to access the internal resource via this port forwarding rule, or 'any'. |
| | | **local\_ip** string | | Local IP address to which traffic will be forwarded. |
| | | **local\_port** string | | Destination port of the forwarded traffic that will be sent from the MX to the specified host on the LAN. If you simply wish to forward the traffic without translating the port, this should be the same as the Public port. |
| | | **name** string | | A description of the rule. |
| | | **protocol** string | **Choices:*** tcp
* udp
| Protocol to apply NAT rule to. |
| | | **public\_port** string | | Destination port of the traffic that is arriving on the WAN. |
| | **public\_ip** string | | The IP address that will be used to access the internal resource from the WAN. |
| | **uplink** string | **Choices:*** both
* internet1
* internet2
| The physical WAN interface on which the traffic will arrive. |
| **one\_to\_one** list / elements=dictionary | | List of 1:1 NAT rules. |
| | **allowed\_inbound** list / elements=dictionary | | The ports this mapping will provide access on, and the remote IPs that will be allowed access to the resource. |
| | | **allowed\_ips** list / elements=string | | ranges of WAN IP addresses that are allowed to make inbound connections on the specified ports or port ranges, or 'any'. |
| | | **destination\_ports** list / elements=string | | List of ports or port ranges that will be forwarded to the host on the LAN. |
| | | **protocol** string | **Choices:*** **any** β
* icmp-ping
* tcp
* udp
| Protocol to apply NAT rule to. |
| | **lan\_ip** string | | The IP address of the server or device that hosts the internal resource that you wish to make available on the WAN. |
| | **name** string | | A descriptive name for the rule. |
| | **public\_ip** string | | The IP address that will be used to access the internal resource from the WAN. |
| | **uplink** string | **Choices:*** both
* internet1
* internet2
| The physical WAN interface on which the traffic will arrive. |
| **org\_id** string | | ID of organization associated to a network. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **port\_forwarding** list / elements=dictionary | | List of port forwarding rules. |
| | **allowed\_ips** list / elements=string | | List of ranges of WAN IP addresses that are allowed to make inbound connections on the specified ports or port ranges (or any). |
| | **lan\_ip** string | | The IP address of the server or device that hosts the internal resource that you wish to make available on the WAN. |
| | **local\_port** integer | | A port or port ranges that will receive the forwarded traffic from the WAN. |
| | **name** string | | A descriptive name for the rule. |
| | **protocol** string | **Choices:*** tcp
* udp
| Protocol to forward traffic for. |
| | **public\_port** integer | | A port or port ranges that will be forwarded to the host on the LAN. |
| | **uplink** string | **Choices:*** both
* internet1
* internet2
| The physical WAN interface on which the traffic will arrive. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** **present** β
* query
| Create or modify an organization. |
| **subset** list / elements=string | **Choices:*** 1:1
* 1:many
* **all** β
* port\_forwarding
| Specifies which NAT components to query. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query all NAT rules
meraki_nat:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: query
subset: all
delegate_to: localhost
- name: Query 1:1 NAT rules
meraki_nat:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: query
subset: '1:1'
delegate_to: localhost
- name: Create 1:1 rule
meraki_nat:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: present
one_to_one:
- name: Service behind NAT
public_ip: 1.2.1.2
lan_ip: 192.168.128.1
uplink: internet1
allowed_inbound:
- protocol: tcp
destination_ports:
- 80
allowed_ips:
- 10.10.10.10
delegate_to: localhost
- name: Create 1:many rule
meraki_nat:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: present
one_to_many:
- public_ip: 1.1.1.1
uplink: internet1
port_rules:
- name: Test rule
protocol: tcp
public_port: 10
local_ip: 192.168.128.1
local_port: 11
allowed_ips:
- any
delegate_to: localhost
- name: Create port forwarding rule
meraki_nat:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: present
port_forwarding:
- name: Test map
lan_ip: 192.168.128.1
uplink: both
protocol: tcp
allowed_ips:
- 1.1.1.1
public_port: 10
local_port: 11
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Information about the created or manipulated object. |
| | **one\_to\_many** complex | success, when 1:many NAT object is in task | Information about 1:many NAT object. |
| | | **rules** complex | success, when 1:many NAT object is in task | List of 1:many NAT rules. |
| | | | **portRules** complex | success, when 1:many NAT object is in task | List of NAT port rules. |
| | | | | **allowedIps** list / elements=string | success, when 1:1 NAT object is in task | List of IP addresses to be forwarded. **Sample:** 10.80.100.0/24 |
| | | | | **localIp** string | success, when 1:1 NAT object is in task | Local IP address traffic will be forwarded. **Sample:** 192.0.2.10 |
| | | | | **localPort** integer | success, when 1:1 NAT object is in task | Destination port to be forwarded to. **Sample:** 443 |
| | | | | **name** string | success, when 1:many NAT object is in task | Name of NAT object. **Sample:** Web server behind NAT |
| | | | | **protocol** string | success, when 1:1 NAT object is in task | Protocol to apply NAT rule to. **Sample:** tcp |
| | | | | **publicPort** integer | success, when 1:1 NAT object is in task | Destination port of the traffic that is arriving on WAN. **Sample:** 9443 |
| | | | **publicIp** string | success, when 1:many NAT object is in task | Public IP address to be mapped. **Sample:** 148.2.5.100 |
| | | | **uplink** string | success, when 1:many NAT object is in task | Internet port where rule is applied. **Sample:** internet1 |
| | **one\_to\_one** complex | success, when 1:1 NAT object is in task | Information about 1:1 NAT object. |
| | | **rules** complex | success, when 1:1 NAT object is in task | List of 1:1 NAT rules. |
| | | | **allowedInbound** complex | success, when 1:1 NAT object is in task | List of inbound forwarding rules. |
| | | | | **allowedIps** list / elements=string | success, when 1:1 NAT object is in task | List of IP addresses to be forwarded. **Sample:** 10.80.100.0/24 |
| | | | | **destinationPorts** string | success, when 1:1 NAT object is in task | Ports to apply NAT rule to. **Sample:** 80 |
| | | | | **protocol** string | success, when 1:1 NAT object is in task | Protocol to apply NAT rule to. **Sample:** tcp |
| | | | **lanIp** string | success, when 1:1 NAT object is in task | Local IP address to be mapped. **Sample:** 192.168.128.22 |
| | | | **name** string | success, when 1:1 NAT object is in task | Name of NAT object. **Sample:** Web server behind NAT |
| | | | **publicIp** string | success, when 1:1 NAT object is in task | Public IP address to be mapped. **Sample:** 148.2.5.100 |
| | | | **uplink** string | success, when 1:1 NAT object is in task | Internet port where rule is applied. **Sample:** internet1 |
| | **port\_forwarding** complex | success, when port forwarding is in task | Information about port forwarding rules. |
| | | **rules** complex | success, when port forwarding is in task | List of port forwarding rules. |
| | | | **allowedIps** list / elements=string | success, when port forwarding is in task | List of IP addresses to be forwarded. **Sample:** 10.80.100.0/24 |
| | | | **lanIp** string | success, when port forwarding is in task | Local IP address to be mapped. **Sample:** 192.168.128.22 |
| | | | **localPort** integer | success, when port forwarding is in task | Destination port to be forwarded to. **Sample:** 443 |
| | | | **name** string | success, when port forwarding is in task | Name of NAT object. **Sample:** Web server behind NAT |
| | | | **protocol** string | success, when port forwarding is in task | Protocol to apply NAT rule to. **Sample:** tcp |
| | | | **publicPort** integer | success, when port forwarding is in task | Destination port of the traffic that is arriving on WAN. **Sample:** 9443 |
| | | | **uplink** string | success, when port forwarding is in task | Internet port where rule is applied. **Sample:** internet1 |
### Authors
* Kevin Breit (@kbreit)
| programming_docs |
ansible cisco.meraki.meraki_mr_ssid β Manage wireless SSIDs in the Meraki cloud cisco.meraki.meraki\_mr\_ssid β Manage wireless SSIDs in the Meraki cloud
=========================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mr_ssid`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for management of SSIDs in a Meraki wireless environment.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **ap\_tags\_vlan\_ids** list / elements=dictionary | | List of VLAN tags. Requires `ip_assignment_mode` to be `Bridge mode` or `Layer 3 roaming`. Requires `use_vlan_tagging` to be `True`. |
| | **tags** list / elements=string | | List of AP tags. |
| | **vlan\_id** integer | | Numerical identifier that is assigned to the VLAN. |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **auth\_mode** string | **Choices:*** open
* psk
* open-with-radius
* 8021x-meraki
* 8021x-radius
| Set authentication mode of network. |
| **band\_selection** string | **Choices:*** Dual band operation
* 5 GHz band only
* Dual band operation with Band Steering
| Set band selection mode. |
| **concentrator\_network\_id** string | | The concentrator to use for 'Layer 3 roaming with a concentrator' or 'VPN'. |
| **default\_vlan\_id** integer | | Default VLAN ID. Requires `ip_assignment_mode` to be `Bridge mode` or `Layer 3 roaming`. |
| **enabled** boolean | **Choices:*** no
* yes
| Enable or disable SSID network. |
| **encryption\_mode** string | **Choices:*** wpa
* eap
* wpa-eap
| Set encryption mode of network. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **ip\_assignment\_mode** string | **Choices:*** NAT mode
* Bridge mode
* Layer 3 roaming
* Layer 3 roaming with a concentrator
* VPN
| Method of which SSID uses to assign IP addresses. |
| **min\_bitrate** float | **Choices:*** 1
* 2
* 5.5
* 6
* 9
* 11
* 12
* 18
* 24
* 36
* 48
* 54
| Minimum bitrate (Mbps) allowed on SSID. |
| **name** string | | Name of SSID. |
| **net\_id** string | | ID of network. |
| **net\_name** string | | Name of network. |
| **number** integer | | SSID number within network.
aliases: ssid\_number |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **per\_client\_bandwidth\_limit\_down** integer | | Maximum bandwidth in Mbps devices on SSID can download. |
| **per\_client\_bandwidth\_limit\_up** integer | | Maximum bandwidth in Mbps devices on SSID can upload. |
| **psk** string | | Password for wireless network. Requires auth\_mode to be set to psk. |
| **radius\_accounting\_enabled** boolean | **Choices:*** no
* yes
| Enable or disable RADIUS accounting. |
| **radius\_accounting\_servers** list / elements=dictionary | | List of RADIUS servers for RADIUS accounting. |
| | **host** string / required | | IP address or hostname of RADIUS server. |
| | **port** integer | | Port number RADIUS server is listening to. |
| | **secret** string | | RADIUS password. Setting password is not idempotent. |
| **radius\_coa\_enabled** boolean | **Choices:*** no
* yes
| Enable or disable RADIUS CoA (Change of Authorization) on SSID. |
| **radius\_failover\_policy** string | **Choices:*** Deny access
* Allow access
| Set client access policy in case RADIUS servers aren't available. |
| **radius\_load\_balancing\_policy** string | **Choices:*** Strict priority order
* Round robin
| Set load balancing policy when multiple RADIUS servers are specified. |
| **radius\_proxy\_enabled** boolean | **Choices:*** no
* yes
| Enable or disable RADIUS Proxy on SSID. |
| **radius\_servers** list / elements=dictionary | | List of RADIUS servers. |
| | **host** string / required | | IP address or hostname of RADIUS server. |
| | **port** integer | | Port number RADIUS server is listening to. |
| | **secret** string | | RADIUS password. Setting password is not idempotent. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **splash\_page** string | **Choices:*** None
* Click-through splash page
* Billing
* Password-protected with Meraki RADIUS
* Password-protected with custom RADIUS
* Password-protected with Active Directory
* Password-protected with LDAP
* SMS authentication
* Systems Manager Sentry
* Facebook Wi-Fi
* Google OAuth
* Sponsored guest
* Cisco ISE
| Set to enable splash page and specify type of splash. |
| **state** string | **Choices:*** absent
* query
* **present** β
| Specifies whether SNMP information should be queried or modified. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **use\_vlan\_tagging** boolean | **Choices:*** no
* yes
| Set whether to use VLAN tagging. Requires `default_vlan_id` to be set. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
| **vlan\_id** integer | | ID number of VLAN on SSID. Requires `ip_assignment_mode` to be `ayer 3 roaming with a concentrator` or `VPN`. |
| **walled\_garden\_enabled** boolean | **Choices:*** no
* yes
| Enable or disable walled garden functionality. |
| **walled\_garden\_ranges** list / elements=string | | List of walled garden ranges. |
| **wpa\_encryption\_mode** string | **Choices:*** WPA1 and WPA2
* WPA2 only
* WPA3 Transition Mode
* WPA3 only
| Encryption mode within WPA specification. |
Notes
-----
Note
* Deleting an SSID does not delete RADIUS servers.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Enable and name SSID
meraki_ssid:
auth_key: abc123
state: present
org_name: YourOrg
net_name: WiFi
name: GuestSSID
enabled: true
delegate_to: localhost
- name: Set PSK with invalid encryption mode
meraki_ssid:
auth_key: abc123
state: present
org_name: YourOrg
net_name: WiFi
name: GuestSSID
auth_mode: psk
psk: abc1234
encryption_mode: eap
ignore_errors: yes
delegate_to: localhost
- name: Configure RADIUS servers
meraki_ssid:
auth_key: abc123
state: present
org_name: YourOrg
net_name: WiFi
name: GuestSSID
auth_mode: open-with-radius
radius_servers:
- host: 192.0.1.200
port: 1234
secret: abc98765
delegate_to: localhost
- name: Enable click-through splash page
meraki_ssid:
auth_key: abc123
state: present
org_name: YourOrg
net_name: WiFi
name: GuestSSID
splash_page: Click-through splash page
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | List of wireless SSIDs. |
| | **auth\_mode** string | success | Authentication method. **Sample:** psk |
| | **band\_selection** string | success | Wireless RF frequency wireless network will be broadcast on. **Sample:** 5 GHz band only |
| | **enabled** boolean | success | Enabled state of wireless network. **Sample:** True |
| | **encryption\_mode** string | success | Wireless traffic encryption method. **Sample:** wpa |
| | **ip\_assignment\_mode** string | success | Wireless client IP assignment method. **Sample:** NAT mode |
| | **min\_bitrate** integer | success | Minimum bitrate a wireless client can connect at. **Sample:** 11 |
| | **name** string | success | Name of wireless SSID. This value is what is broadcasted. **Sample:** CorpWireless |
| | **number** integer | success | Zero-based index number for SSIDs. |
| | **per\_client\_bandwidth\_limit\_down** integer | success | Maximum download bandwidth a client can use. |
| | **per\_client\_bandwidth\_limit\_up** integer | success | Maximum upload bandwidth a client can use. **Sample:** 1000 |
| | **psk** string | success | Secret wireless password. **Sample:** SecretWiFiPass |
| | **splash\_page** string | success | Splash page to show when user authenticates. **Sample:** Click-through splash page |
| | **ssid\_admin\_accessible** boolean | success | Whether SSID is administratively accessible. **Sample:** True |
| | **wpa\_encryption\_mode** string | success | Enabled WPA versions. **Sample:** WPA2 only |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_mx_l3_firewall β Manage MX appliance layer 3 firewalls in the Meraki cloud cisco.meraki.meraki\_mx\_l3\_firewall β Manage MX appliance layer 3 firewalls in the Meraki cloud
=================================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mx_l3_firewall`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for creation, management, and visibility into layer 3 firewalls implemented on Meraki MX firewalls.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **net\_id** string | | ID of network which MX firewall is in. |
| **net\_name** string | | Name of network which MX firewall is in. |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **rules** list / elements=dictionary | | List of firewall rules. |
| | **comment** string | | Optional comment to describe the firewall rule. |
| | **dest\_cidr** string | | Comma separated list of CIDR notation destination networks.
`Any` must be capitalized. |
| | **dest\_port** string | | Comma separated list of destination port numbers to match against.
`Any` must be capitalized. |
| | **policy** string | **Choices:*** allow
* deny
| Policy to apply if rule is hit. |
| | **protocol** string | **Choices:*** any
* icmp
* tcp
* udp
| Protocol to match against. |
| | **src\_cidr** string | | Comma separated list of CIDR notation source networks.
`Any` must be capitalized. |
| | **src\_port** string | | Comma separated list of source port numbers to match against.
`Any` must be capitalized. |
| | **syslog\_enabled** boolean | **Choices:*** **no** β
* yes
| Whether to log hints against the firewall rule. Only applicable if a syslog server is specified against the network. |
| **state** string | **Choices:*** **present** β
* query
| Create or modify an organization. |
| **syslog\_default\_rule** boolean | **Choices:*** no
* yes
| Whether to log hits against the default firewall rule. Only applicable if a syslog server is specified against the network. This is not shown in response from Meraki. Instead, refer to the `syslog_enabled` value in the default rule. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* Module assumes a complete list of firewall rules are passed as a parameter.
* If there is interest in this module allowing manipulation of a single firewall rule, please submit an issue against this module.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query firewall rules
meraki_mx_l3_firewall:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: query
delegate_to: localhost
- name: Set two firewall rules
meraki_mx_l3_firewall:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: present
rules:
- comment: Block traffic to server
src_cidr: 192.0.1.0/24
src_port: any
dest_cidr: 192.0.2.2/32
dest_port: any
protocol: any
policy: deny
- comment: Allow traffic to group of servers
src_cidr: 192.0.1.0/24
src_port: any
dest_cidr: 192.0.2.0/24
dest_port: any
protocol: any
policy: allow
delegate_to: localhost
- name: Set one firewall rule and enable logging of the default rule
meraki_mx_l3_firewall:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: present
rules:
- comment: Block traffic to server
src_cidr: 192.0.1.0/24
src_port: any
dest_cidr: 192.0.2.2/32
dest_port: any
protocol: any
policy: deny
syslog_default_rule: yes
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Firewall rules associated to network. |
| | **rules** complex | success | List of firewall rules. |
| | | **comment** string | always | Comment to describe the firewall rule. **Sample:** Block traffic to server |
| | | **dest\_cidr** string | always | Comma separated list of CIDR notation destination networks. **Sample:** 192.0.1.1/32,192.0.1.2/32 |
| | | **dest\_port** string | always | Comma separated list of destination ports. **Sample:** 80,443 |
| | | **policy** string | always | Action to take when rule is matched. |
| | | **protocol** string | always | Network protocol for which to match against. **Sample:** tcp |
| | | **src\_cidr** string | always | Comma separated list of CIDR notation source networks. **Sample:** 192.0.1.1/32,192.0.1.2/32 |
| | | **src\_port** string | always | Comma separated list of source ports. **Sample:** 80,443 |
| | | **syslog\_enabled** boolean | always | Whether to log to syslog when rule is matched. **Sample:** True |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_mx_site_to_site_vpn β Manage AutoVPN connections in Meraki cisco.meraki.meraki\_mx\_site\_to\_site\_vpn β Manage AutoVPN connections in Meraki
===================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mx_site_to_site_vpn`.
New in version 1.1.0: of cisco.meraki
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for creation, management, and visibility into AutoVPNs implemented on Meraki MX firewalls.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **hubs** list / elements=dictionary | | List of hubs to assign to a spoke. |
| | **hub\_id** string | | Network ID of hub |
| | **use\_default\_route** boolean | **Choices:*** no
* yes
| Indicates whether deafult troute traffic should be sent to this hub. Only valid in spoke mode. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **mode** string | **Choices:*** none
* hub
* spoke
| Set VPN mode for network |
| **net\_id** string | | ID of network which MX firewall is in. |
| **net\_name** string | | Name of network which MX firewall is in. |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** **present** β
* query
| Create or modify an organization. |
| **subnets** list / elements=dictionary | | List of subnets to advertise over VPN. |
| | **local\_subnet** string | | CIDR formatted subnet. |
| | **use\_vpn** boolean | **Choices:*** no
* yes
| Whether to advertise over VPN. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Set hub mode
meraki_site_to_site_vpn:
auth_key: abc123
state: present
org_name: YourOrg
net_name: hub_network
mode: hub
delegate_to: localhost
register: set_hub
- name: Set spoke mode
meraki_site_to_site_vpn:
auth_key: abc123
state: present
org_name: YourOrg
net_name: spoke_network
mode: spoke
hubs:
- hub_id: N_1234
use_default_route: false
delegate_to: localhost
register: set_spoke
- name: Query rules for hub
meraki_site_to_site_vpn:
auth_key: abc123
state: query
org_name: YourOrg
net_name: hub_network
delegate_to: localhost
register: query_all_hub
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | VPN settings. |
| | **hubs** complex | always | Hub networks to associate to. |
| | | **hub\_id** complex | always | ID of hub network. **Sample:** N\_12345 |
| | | **use\_default\_route** boolean | always | Whether to send all default route traffic over VPN. **Sample:** True |
| | **mode** string | always | Mode assigned to network. **Sample:** spoke |
| | **subnets** complex | always | List of subnets to advertise over VPN. |
| | | **local\_subnet** string | always | CIDR formatted subnet. **Sample:** 192.168.1.0/24 |
| | | **use\_vpn** boolean | always | Whether subnet should use the VPN. **Sample:** True |
### Authors
* Kevin Breit (@kbreit)
| programming_docs |
ansible cisco.meraki.meraki_mx_l2_interface β Configure MX layer 2 interfaces cisco.meraki.meraki\_mx\_l2\_interface β Configure MX layer 2 interfaces
========================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mx_l2_interface`.
New in version 2.1.0: of cisco.meraki
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for management and visibility of Merkai MX layer 2 ports.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_policy** string | **Choices:*** open
* 8021x-radius
* mac-radius
* hybris-radius
| The name of the policy. Only applicable to access ports. |
| **allowed\_vlans** string | | Comma-delimited list of the VLAN ID's allowed on the port, or 'all' to permit all VLAN's on the port. |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **drop\_untagged\_traffic** boolean | **Choices:*** no
* yes
| Trunk port can Drop all Untagged traffic. When true, no VLAN is required. Access ports cannot have dropUntaggedTraffic set to true. |
| **enabled** boolean | **Choices:*** no
* yes
| Enabled state of port. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **net\_id** string | | ID number of a network. |
| **net\_name** string | | Name of a network.
aliases: name, network |
| **number** integer | | ID number of MX port.
aliases: port, port\_id |
| **org\_id** string | | ID of organization associated to a network. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **port\_type** string | **Choices:*** access
* trunk
| Type of port. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** **present** β
* query
| Modify or query an port. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
| **vlan** integer | | Native VLAN when the port is in Trunk mode. Access VLAN when the port is in Access mode. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query layer 2 interface settings
meraki_mx_l2_interface:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: query
delegate_to: localhost
- name: Query a single layer 2 interface settings
meraki_mx_l2_interface:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: query
number: 2
delegate_to: localhost
- name: Update interface configuration
meraki_mx_l2_interface:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: present
number: 2
port_type: access
vlan: 10
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Information about the created or manipulated object. |
| | **access\_policy** string | success | The name of the policy. Only applicable to access ports. **Sample:** guestUsers |
| | **allowed\_vlans** string | success | Comma-delimited list of the VLAN ID's allowed on the port, or 'all' to permit all VLAN's on the port. **Sample:** 1,5,10 |
| | **drop\_untagged\_traffic** boolean | success | Trunk port can Drop all Untagged traffic. When true, no VLAN is required. Access ports cannot have dropUntaggedTraffic set to true. **Sample:** True |
| | **enabled** boolean | success | Enabled state of port. **Sample:** True |
| | **number** integer | success | ID number of MX port. **Sample:** 4 |
| | **type** string | success | Type of port. **Sample:** access |
| | **vlan** integer | success | Native VLAN when the port is in Trunk mode. Access VLAN when the port is in Access mode. **Sample:** 1 |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_webhook β Manage webhooks configured in the Meraki cloud cisco.meraki.meraki\_webhook β Manage webhooks configured in the Meraki cloud
=============================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_webhook`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Configure and query information about webhooks within the Meraki cloud.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **name** string | | Name of webhook. |
| **net\_id** string | | ID of network which configuration is applied to. |
| **net\_name** string | | Name of network which configuration is applied to.
aliases: network |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **shared\_secret** string | | Secret password to use when accessing webhook. |
| **state** string | **Choices:*** absent
* present
* **query** β
| Specifies whether object should be queried, created/modified, or removed. |
| **test** string | **Choices:*** test
| Indicates whether to test or query status. |
| **test\_id** string | | ID of webhook test query. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **url** string | | URL to access when calling webhook. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
| **webhook\_id** string | | Unique ID of webhook. |
Notes
-----
Note
* Some of the options are likely only used for developers within Meraki.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Create webhook
meraki_webhook:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
name: Test_Hook
url: https://webhook.url/
shared_secret: shhhdonttellanyone
delegate_to: localhost
- name: Query one webhook
meraki_webhook:
auth_key: abc123
state: query
org_name: YourOrg
net_name: YourNet
name: Test_Hook
delegate_to: localhost
- name: Query all webhooks
meraki_webhook:
auth_key: abc123
state: query
org_name: YourOrg
net_name: YourNet
delegate_to: localhost
- name: Delete webhook
meraki_webhook:
auth_key: abc123
state: absent
org_name: YourOrg
net_name: YourNet
name: Test_Hook
delegate_to: localhost
- name: Test webhook
meraki_webhook:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
test: test
url: https://webhook.url/abc123
delegate_to: localhost
- name: Get webhook status
meraki_webhook:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
test: status
test_id: abc123531234
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | List of administrators. |
| | **id** string | success | Unique ID of webhook. **Sample:** aHR0cHM6Ly93ZWJob22LnvpdGUvOGViNWI3NmYtYjE2Ny00Y2I4LTlmYzQtND32Mj3F5NzIaMjQ0 |
| | **name** string | success | Descriptive name of webhook. **Sample:** Test\_Hook |
| | **networkId** string | success | ID of network containing webhook object. **Sample:** N\_12345 |
| | **shared\_secret** string | success | Password for webhook. **Sample:** VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER |
| | **status** string | success, when testing webhook | Status of webhook test. **Sample:** enqueued |
| | **url** string | success | URL of webhook endpoint. **Sample:** https://webhook.url/abc123 |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_ms_ospf β Manage OSPF configuration on MS switches cisco.meraki.meraki\_ms\_ospf β Manage OSPF configuration on MS switches
========================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_ms_ospf`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Configure OSPF for compatible Meraki MS switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **areas** list / elements=dictionary | | List of areas in OSPF network. |
| | **area\_id** integer | | OSPF area ID
aliases: id |
| | **area\_name** string | | Descriptive name of OSPF area.
aliases: name |
| | **area\_type** string | **Choices:*** normal
* stub
* nssa
| OSPF area type.
aliases: type |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **dead\_timer** integer | | Time interval to determine when the peer will be declared inactive. Value must be between 1 and 65535. |
| **enabled** boolean | **Choices:*** no
* yes
| Enable or disable OSPF on the network. |
| **hello\_timer** integer | | Time interval, in seconds, at which hello packets will be sent to OSPF neighbors to maintain connectivity. Value must be between 1 and 255. Default is 10 seconds. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **md5\_authentication\_enabled** boolean | **Choices:*** no
* yes
| Whether to enable or disable MD5 authentication. |
| **md5\_authentication\_key** dictionary | | MD5 authentication credentials. |
| | **id** string | | MD5 authentication key index. Must be between 1 and 255. |
| | **passphrase** string | | Plain text authentication passphrase |
| **net\_id** string | | ID of network containing OSPF configuration. |
| **net\_name** string | | Name of network containing OSPF configuration.
aliases: name, network |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** **present** β
* query
| Read or edit OSPF settings. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query OSPF settings
meraki_ms_ospf:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: query
delegate_to: localhost
- name: Enable OSPF with check mode
meraki_ms_ospf:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: present
enabled: true
hello_timer: 20
dead_timer: 60
areas:
- area_id: 0
area_name: Backbone
area_type: normal
- area_id: 1
area_name: Office
area_type: nssa
md5_authentication_enabled: false
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Information about queried object. |
| | **areas** complex | success | List of areas in OSPF network. |
| | | **area\_id** integer | success | OSPF area ID |
| | | **area\_name** string | success | Descriptive name of OSPF area. |
| | | **area\_type** string | success | OSPF area type. |
| | **dead\_timer\_in\_seconds** integer | success | Time interval to determine when the peer will be declared inactive. |
| | **enabled** boolean | success | Enable or disable OSPF on the network. |
| | **hello\_timer\_in\_seconds** integer | success | Time interval, in seconds, at which hello packets will be sent to OSPF neighbors to maintain connectivity. |
| | **md5\_authentication\_enabled** boolean | success | Whether to enable or disable MD5 authentication. |
| | **md5\_authentication\_key** complex | success | MD5 authentication credentials. |
| | | **id** integer | success | MD5 key index. |
| | | **passphrase** string | success | Passphrase for MD5 key. |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_syslog β Manage syslog server settings in the Meraki cloud. cisco.meraki.meraki\_syslog β Manage syslog server settings in the Meraki cloud.
================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_syslog`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for creation and management of Syslog servers within Meraki.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable MERAKI\_KEY is not set. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **net\_id** string | | ID number of a network. |
| **net\_name** string | | Name of a network.
aliases: name, network |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **servers** list / elements=dictionary | | List of syslog server settings |
| | **host** string | | IP address or hostname of Syslog server. |
| | **port** integer | **Default:**"514" | Port number Syslog server is listening on. |
| | **roles** list / elements=string | **Choices:*** Wireless Event log
* Appliance event log
* Switch event log
* Air Marshal events
* Flows
* URLs
* IDS alerts
* Security events
| List of applicable Syslog server roles. |
| **state** string | **Choices:*** **present** β
* query
| Query or edit syslog servers To delete a syslog server, do not include server in list of servers |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* Changes to existing syslog servers replaces existing configuration. If you need to add to an existing configuration set state to query to gather the existing configuration and then modify or add.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query syslog configurations on network named MyNet in the YourOrg organization
meraki_syslog:
auth_key: abc12345
status: query
org_name: YourOrg
net_name: MyNet
delegate_to: localhost
- name: Add single syslog server with Appliance event log role
meraki_syslog:
auth_key: abc12345
status: query
org_name: YourOrg
net_name: MyNet
servers:
- host: 192.0.1.2
port: 514
roles:
- Appliance event log
delegate_to: localhost
- name: Add multiple syslog servers
meraki_syslog:
auth_key: abc12345
status: query
org_name: YourOrg
net_name: MyNet
servers:
- host: 192.0.1.2
port: 514
roles:
- Appliance event log
- host: 192.0.1.3
port: 514
roles:
- Appliance event log
- Flows
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | info | Information about the created or manipulated object. |
| | **servers** complex | info | List of syslog servers. |
| | | **host** string | success | Hostname or IP address of syslog server. **Sample:** 192.0.1.1 |
| | | **port** string | success | Port number for syslog communication. **Sample:** 443 |
| | | **roles** list / elements=string | success | List of roles assigned to syslog server. **Sample:** Wireless event log, URLs |
### Authors
* Kevin Breit (@kbreit)
| programming_docs |
ansible cisco.meraki.meraki_config_template β Manage configuration templates in the Meraki cloud cisco.meraki.meraki\_config\_template β Manage configuration templates in the Meraki cloud
==========================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_config_template`.
New in version 1.0.0: of cisco.meraki
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for querying, deleting, binding, and unbinding of configuration templates.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **auto\_bind** boolean | **Choices:*** no
* yes
| Optional boolean indicating whether the network's switches should automatically bind to profiles of the same model. This option only affects switch networks and switch templates. Auto-bind is not valid unless the switch template has at least one profile and has at most one profile per switch model. |
| **config\_template** string | | Name of the configuration template within an organization to manipulate.
aliases: name |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **net\_id** string | | ID of the network to bind or unbind configuration template to. |
| **net\_name** string | | Name of the network to bind or unbind configuration template to. |
| **org\_id** string | | ID of organization associated to a configuration template. |
| **org\_name** string | | Name of organization containing the configuration template.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** absent
* **query** β
* present
| Specifies whether configuration template information should be queried, modified, or deleted. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* Module is not idempotent as the Meraki API is limited in what information it provides about configuration templates.
* Merakiβs API does not support creating new configuration templates.
* To use the configuration template, simply pass its ID via `net_id` parameters in Meraki modules.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query configuration templates
meraki_config_template:
auth_key: abc12345
org_name: YourOrg
state: query
delegate_to: localhost
- name: Bind a template from a network
meraki_config_template:
auth_key: abc123
state: present
org_name: YourOrg
net_name: YourNet
config_template: DevConfigTemplate
delegate_to: localhost
- name: Unbind a template from a network
meraki_config_template:
auth_key: abc123
state: absent
org_name: YourOrg
net_name: YourNet
config_template: DevConfigTemplate
delegate_to: localhost
- name: Delete a configuration template
meraki_config_template:
auth_key: abc123
state: absent
org_name: YourOrg
config_template: DevConfigTemplate
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Information about queried object. |
| | **id** integer | success | Unique identification number of organization. **Sample:** L\_2930418 |
| | **name** string | success | Name of configuration template. **Sample:** YourTemplate |
| | **product\_types** list / elements=string | success | List of products which can exist in the network. **Sample:** ['appliance', 'switch'] |
| | **time\_zone** string | success | Timezone applied to each associated network. **Sample:** America/Chicago |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_mx_content_filtering β Edit Meraki MX content filtering policies cisco.meraki.meraki\_mx\_content\_filtering β Edit Meraki MX content filtering policies
=======================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mx_content_filtering`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for setting policy on content filtering.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **allowed\_urls** list / elements=string | | List of URL patterns which should be allowed. |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable MERAKI\_KEY is not set. |
| **blocked\_categories** list / elements=string | | List of content categories which should be blocked. Use the `meraki_content_filtering_facts` module for a full list of categories. |
| **blocked\_urls** list / elements=string | | List of URL patterns which should be blocked. |
| **category\_list\_size** string | **Choices:*** top sites
* full list
| Determines whether a network filters fo rall URLs in a category or only the list of top blocked sites. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **net\_id** string | | ID number of a network. |
| **net\_name** string | | Name of a network.
aliases: network |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **state** string | **Choices:*** **present** β
* query
| States that a policy should be created or modified. |
| **subset** string | **Choices:*** categories
* policy
| Display only certain facts. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Set single allowed URL pattern
meraki_content_filtering:
auth_key: abc123
org_name: YourOrg
net_name: YourMXNet
allowed_urls:
- "http://www.ansible.com/*"
- name: Set blocked URL category
meraki_content_filtering:
auth_key: abc123
org_name: YourOrg
net_name: YourMXNet
state: present
category_list_size: full list
blocked_categories:
- "Adult and Pornography"
- name: Remove match patterns and categories
meraki_content_filtering:
auth_key: abc123
org_name: YourOrg
net_name: YourMXNet
state: present
category_list_size: full list
allowed_urls: []
blocked_urls: []
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | info | Information about the created or manipulated object. |
| | **allowed\_url\_patterns** list / elements=string | query for policy | Explicitly permitted URL patterns **Sample:** ['http://www.ansible.com'] |
| | **blocked\_url\_categories** complex | query for policy | List of blocked URL categories |
| | | **id** list / elements=string | query for policy | Unique ID of category to filter **Sample:** ['meraki:contentFiltering/category/1'] |
| | | **name** list / elements=string | query for policy | Name of category to filter **Sample:** ['Real Estate'] |
| | **blocked\_url\_patterns** list / elements=string | query for policy | Explicitly denied URL patterns **Sample:** ['http://www.ansible.net'] |
| | **categories** complex | query for categories | List of available content filtering categories. |
| | | **id** string | query for categories | Unique ID of content filtering category. **Sample:** meraki:contentFiltering/category/1 |
| | | **name** string | query for categories | Name of content filtering category. **Sample:** Real Estate |
| | **url\_cateogory\_list\_size** string | query for policy | Size of categories to cache on MX appliance **Sample:** topSites |
### Authors
* Kevin Breit (@kbreit)
ansible cisco.meraki.meraki_mx_l7_firewall β Manage MX appliance layer 7 firewalls in the Meraki cloud cisco.meraki.meraki\_mx\_l7\_firewall β Manage MX appliance layer 7 firewalls in the Meraki cloud
=================================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_mx_l7_firewall`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for creation, management, and visibility into layer 7 firewalls implemented on Meraki MX firewalls.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **categories** boolean | **Choices:*** no
* yes
| When `True`, specifies that applications and application categories should be queried instead of firewall rules. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **net\_id** string | | ID of network which MX firewall is in. |
| **net\_name** string | | Name of network which MX firewall is in. |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **rules** list / elements=dictionary | | List of layer 7 firewall rules. |
| | **application** dictionary | | Application to filter. |
| | | **id** string | | URI of application as defined by Meraki. |
| | | **name** string | | Name of application to filter as defined by Meraki. |
| | **countries** list / elements=string | | List of countries to whitelist or blacklist. The countries follow the two-letter ISO 3166-1 alpha-2 format. |
| | **host** string | | FQDN of host to filter. |
| | **ip\_range** string | | CIDR notation range of IP addresses to apply rule to. Port can be appended to range with a `":"`. |
| | **policy** string | **Choices:*** **deny** β
| Policy to apply if rule is hit. |
| | **port** string | | TCP or UDP based port to filter. |
| | **type** string | **Choices:*** application
* application\_category
* blocked\_countries
* host
* ip\_range
* port
* allowed\_countries
| Type of policy to apply. |
| **state** string | **Choices:*** **present** β
* query
| Query or modify a firewall rule. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
Notes
-----
Note
* Module assumes a complete list of firewall rules are passed as a parameter.
* If there is interest in this module allowing manipulation of a single firewall rule, please submit an issue against this module.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query firewall rules
meraki_mx_l7_firewall:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: query
delegate_to: localhost
- name: Query applications and application categories
meraki_mx_l7_firewall:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
categories: yes
state: query
delegate_to: localhost
- name: Set firewall rules
meraki_mx_l7_firewall:
auth_key: abc123
org_name: YourOrg
net_name: YourNet
state: present
rules:
- type: allowed_countries
countries:
- US
- FR
- type: blocked_countries
countries:
- CN
- policy: deny
type: port
port: 8080
- type: port
port: 1234
- type: host
host: asdf.com
- type: application
application:
id: meraki:layer7/application/205
- type: application_category
application:
id: meraki:layer7/category/24
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Firewall rules associated to network. |
| | **application\_categories** list / elements=string | success, when querying applications | List of application categories and applications. |
| | | **applications** list / elements=string | success | List of applications within a category. |
| | | | **id** string | success | URI of application. **Sample:** Gmail |
| | | | **name** string | success | Descriptive name of application. **Sample:** meraki:layer7/application/4 |
| | | **id** string | success | URI of application category. **Sample:** Email |
| | | **name** string | success | Descriptive name of application category. **Sample:** layer7/category/1 |
| | **rules** list / elements=string | success, when not querying applications | Ordered list of firewall rules. |
| | | **allowedCountries** string | success | Countries to be allowed. **Sample:** CA |
| | | **applicationCategory** list / elements=string | success | List of application categories within a category. |
| | | | **id** string | success | URI of application. **Sample:** Gmail |
| | | | **name** string | success | Descriptive name of application. **Sample:** meraki:layer7/application/4 |
| | | **applications** list / elements=string | success | List of applications within a category. |
| | | | **id** string | success | URI of application. **Sample:** Gmail |
| | | | **name** string | success | Descriptive name of application. **Sample:** meraki:layer7/application/4 |
| | | **blockedCountries** string | success | Countries to be blacklisted. **Sample:** RU |
| | | **ipRange** string | success | Range of IP addresses in rule. **Sample:** 1.1.1.0/23 |
| | | **policy** string | success | Action to apply when rule is hit. **Sample:** deny |
| | | **port** string | success | Port number in rule. **Sample:** 23 |
| | | **type** string | success | Type of rule category. **Sample:** applications |
### Authors
* Kevin Breit (@kbreit)
| programming_docs |
ansible cisco.meraki.meraki_ms_l3_interface β Manage routed interfaces on MS switches cisco.meraki.meraki\_ms\_l3\_interface β Manage routed interfaces on MS switches
================================================================================
Note
This plugin is part of the [cisco.meraki collection](https://galaxy.ansible.com/cisco/meraki) (version 2.5.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.meraki`.
To use it in a playbook, specify: `cisco.meraki.meraki_ms_l3_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Allows for creation, management, and visibility into routed interfaces on Meraki MS switches.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_key** string / required | | Authentication key provided by the dashboard. Required if environmental variable `MERAKI_KEY` is not set. |
| **default\_gateway** string | | The next hop for any traffic that isn't going to a directly connected subnet or over a static route. This IP address must exist in a subnet with a routed interface. |
| **host** string | **Default:**"api.meraki.com" | Hostname for Meraki dashboard. Can be used to access regional Meraki environments, such as China. |
| **interface\_id** string | | Uniqiue identification number for layer 3 interface. |
| **interface\_ip** string | | The IP address this switch will use for layer 3 routing on this VLAN or subnet. This cannot be the same as the switch's management IP. |
| **internal\_error\_retry\_time** integer | **Default:**60 | Number of seconds to retry if server returns an internal server error. |
| **multicast\_routing** string | **Choices:*** disabled
* enabled
* IGMP snooping querier
| Enable multicast support if multicast routing between VLANs is required. |
| **name** string | | A friendly name or description for the interface or VLAN. |
| **org\_id** string | | ID of organization. |
| **org\_name** string | | Name of organization.
aliases: organization |
| **ospf\_settings** dictionary | | The OSPF routing settings of the interface. |
| | **area** string | | The OSPF area to which this interface should belong. Can be either 'disabled' or the identifier of an existing OSPF area. |
| | **cost** integer | | The path cost for this interface. |
| | **is\_passive\_enabled** boolean | **Choices:*** no
* yes
| When enabled, OSPF will not run on the interface, but the subnet will still be advertised. |
| **output\_format** string | **Choices:*** **snakecase** β
* camelcase
| Instructs module whether response keys should be snake case (ex. `net_id`) or camel case (ex. `netId`). |
| **output\_level** string | **Choices:*** debug
* **normal** β
| Set amount of debug output during module execution. |
| **rate\_limit\_retry\_time** integer | **Default:**165 | Number of seconds to retry if rate limiter is triggered. |
| **serial** string | | Serial number of MS switch hosting the layer 3 interface. |
| **state** string | **Choices:*** **present** β
* query
* absent
| Create or modify an organization. |
| **subnet** string | | The network that this routed interface is on, in CIDR notation. |
| **timeout** integer | **Default:**30 | Time to timeout for HTTP requests. |
| **use\_https** boolean | **Choices:*** no
* **yes** β
| If `no`, it will use HTTP. Otherwise it will use HTTPS. Only useful for internal Meraki developers. |
| **use\_proxy** boolean | **Choices:*** **no** β
* yes
| If `no`, it will not use a proxy, even if one is defined in an environment variable on the target hosts. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| Whether to validate HTTP certificates. |
| **vlan\_id** integer | | The VLAN this routed interface is on. VLAN must be between 1 and 4094. |
Notes
-----
Note
* Once a layer 3 interface is created, the API does not allow updating the interface and specifying `default_gateway`.
* More information about the Meraki API can be found at <https://dashboard.meraki.com/api_docs>.
* Some of the options are likely only used for developers within Meraki.
* As of Ansible 2.9, Meraki modules output keys as snake case. To use camel case, set the `ANSIBLE_MERAKI_FORMAT` environment variable to `camelcase`.
* Ansibleβs Meraki modules will stop supporting camel case output in Ansible 2.13. Please update your playbooks.
* Check Mode downloads the current configuration from the dashboard, then compares changes against this download. Check Mode will report changed if there are differences in the configurations, but does not submit changes to the API for validation of change.
Examples
--------
```
- name: Query all l3 interfaces
meraki_ms_l3_interface:
auth_key: abc123
state: query
serial: aaa-bbb-ccc
- name: Query one l3 interface
meraki_ms_l3_interface:
auth_key: abc123
state: query
serial: aaa-bbb-ccc
name: Test L3 interface
- name: Create l3 interface
meraki_ms_l3_interface:
auth_key: abc123
state: present
serial: aaa-bbb-ccc
name: "Test L3 interface 2"
subnet: "192.168.3.0/24"
interface_ip: "192.168.3.2"
multicast_routing: disabled
vlan_id: 11
ospf_settings:
area: 0
cost: 1
is_passive_enabled: true
- name: Update l3 interface
meraki_ms_l3_interface:
auth_key: abc123
state: present
serial: aaa-bbb-ccc
name: "Test L3 interface 2"
subnet: "192.168.3.0/24"
interface_ip: "192.168.3.2"
multicast_routing: disabled
vlan_id: 11
ospf_settings:
area: 0
cost: 2
is_passive_enabled: true
- name: Delete l3 interface
meraki_ms_l3_interface:
auth_key: abc123
state: absent
serial: aaa-bbb-ccc
interface_id: abc123344566
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **data** complex | success | Information about the layer 3 interfaces. |
| | **default\_gateway** string | success | The next hop for any traffic that isn't going to a directly connected subnet or over a static route. **Sample:** 192.168.2.1 |
| | **interface\_id** string | success | Uniqiue identification number for layer 3 interface. **Sample:** 62487444811111120 |
| | **interface\_ip** string | success | The IP address this switch will use for layer 3 routing on this VLAN or subnet. **Sample:** 192.168.2.2 |
| | **multicast\_routing** string | success | Enable multicast support if multicast routing between VLANs is required. **Sample:** disabled |
| | **name** string | success | A friendly name or description for the interface or VLAN. **Sample:** L3 interface |
| | **ospf\_settings** complex | success | The OSPF routing settings of the interface. |
| | | **area** string | success | The OSPF area to which this interface should belong. |
| | | **cost** integer | success | The path cost for this interface. **Sample:** 1 |
| | | **is\_passive\_enabled** boolean | success | When enabled, OSPF will not run on the interface, but the subnet will still be advertised. **Sample:** True |
| | **subnet** string | success | The network that this routed interface is on, in CIDR notation. **Sample:** 192.168.2.0/24 |
| | **vlan\_id** integer | success | The VLAN this routed interface is on. **Sample:** 10 |
### Authors
* Kevin Breit (@kbreit)
ansible Cisco.Asa Cisco.Asa
=========
Collection version 2.1.0
Plugin Index
------------
These are the plugins in the cisco.asa collection
### Cliconf Plugins
* [asa](asa_cliconf#ansible-collections-cisco-asa-asa-cliconf) β Use asa cliconf to run command on Cisco ASA platform
### Modules
* [asa\_acl](asa_acl_module#ansible-collections-cisco-asa-asa-acl-module) β (deprecated, removed after 2022-06-01) Manage access-lists on a Cisco ASA
* [asa\_acls](asa_acls_module#ansible-collections-cisco-asa-asa-acls-module) β Access-Lists resource module
* [asa\_command](asa_command_module#ansible-collections-cisco-asa-asa-command-module) β Run arbitrary commands on Cisco ASA devices
* [asa\_config](asa_config_module#ansible-collections-cisco-asa-asa-config-module) β Manage configuration sections on Cisco ASA devices
* [asa\_facts](asa_facts_module#ansible-collections-cisco-asa-asa-facts-module) β Collect facts from remote devices running Cisco ASA
* [asa\_og](asa_og_module#ansible-collections-cisco-asa-asa-og-module) β (deprecated, removed after 2022-06-01) Manage object groups on a Cisco ASA
* [asa\_ogs](asa_ogs_module#ansible-collections-cisco-asa-asa-ogs-module) β Object Group resource module
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible cisco.asa.asa_ogs β Object Group resource module cisco.asa.asa\_ogs β Object Group resource module
=================================================
Note
This plugin is part of the [cisco.asa collection](https://galaxy.ansible.com/cisco/asa) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.asa`.
To use it in a playbook, specify: `cisco.asa.asa_ogs`.
New in version 1.0.0: of cisco.asa
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module configures and manages Objects and Groups on ASA platforms.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** list / elements=dictionary | | A list of Object Group options. |
| | **object\_groups** list / elements=dictionary | | The object groups. |
| | | **description** string | | The description for the object-group. |
| | | **group\_object** list / elements=string | | Configure an object group as an object |
| | | **icmp\_type** dictionary | | Configure an ICMP-type object |
| | | | **icmp\_object** list / elements=string | **Choices:*** alternate-address
* conversion-error
* echo
* echo-reply
* information-reply
* information-request
* mask-reply
* mask-request
* mobile-redirect
* parameter-problem
* redirect
* router-advertisement
* router-solicitation
* source-quench
* time-exceeded
* timestamp-reply
* timestamp-request
* traceroute
* unreachable
| Defines the ICMP types in the group. |
| | | **name** string / required | | Specifies object-group ID |
| | | **network\_object** dictionary | | Configure a network object |
| | | | **address** list / elements=string | | Enter an IPv4 network address with space seperated netmask. |
| | | | **host** list / elements=string | | Set this to specify a single host object. |
| | | | **ipv6\_address** list / elements=string | | Enter an IPv6 prefix. |
| | | | **object** list / elements=string | | Enter this keyword to specify a network object |
| | | **port\_object** list / elements=dictionary | | Configure a port object |
| | | | **eq** string | | Enter this keyword to specify a port |
| | | | **range** dictionary | | Enter this keyword to specify a range of ports |
| | | | | **end** integer | | Specify the end of the port range. |
| | | | | **start** integer | | Specify the start of the port range. |
| | | **protocol** string | **Choices:*** tcp
* tcp-udp
* udp
| Specifies that object-group is for only specified protocol only. Required when port-object need to be configured |
| | | **protocol\_object** dictionary | | Configure a protocol object |
| | | | **protocol** list / elements=string | | Defines the protocols in the group. User can either specify protocols directly/protocol numbers(0-255) |
| | | **security\_group** dictionary | | Configure a security-group |
| | | | **sec\_name** list / elements=string | | Enter this keyword to specify a security-group name. |
| | | | **tag** list / elements=string | | Enter this keyword to specify a security-group tag. |
| | | **service\_object** dictionary | | Configure a service object NEW 'services\_object' param is introduced at object\_group level, please use the newer 'services\_object' param defined at object\_group level instead of 'service\_object' param at object\_group level, as 'service\_object' option will get deprecated and removed in a future release. |
| | | | **object** string | | Enter this keyword to specify a service object |
| | | | **protocol** list / elements=string | **Choices:*** ah
* eigrp
* esp
* gre
* icmp
* icmp6
* igmp
* igrp
* ip
* ipinip
* ipsec
* nos
* ospf
* pcp
* pim
* pptp
* sctp
* snp
* tcp
* tcp-udp
* udp
| Defines the protocols in the group. |
| | | **services\_object** list / elements=dictionary | | Configure list of service objects Newer OGs services\_object param which will replace service\_object param Relased with version 2.1.0 |
| | | | **destination\_port** dictionary | | Keyword to specify destination port |
| | | | | **eq** string | | Match only packets on a given port number. |
| | | | | **gt** string | | Match only packets with a greater port number. |
| | | | | **lt** string | | Match only packets with a lower port number. |
| | | | | **neq** string | | Match only packets not on a given port number. |
| | | | | **range** dictionary | | Port range operator |
| | | | | | **end** integer | | Specify the end of the port range. |
| | | | | | **start** integer | | Specify the start of the port range. |
| | | | **object** string | | Enter this keyword to specify a service object |
| | | | **protocol** string | | Defines the protocols in the group. |
| | | | **source\_port** dictionary | | Keyword to specify source port |
| | | | | **eq** string | | Match only packets on a given port number. |
| | | | | **gt** string | | Match only packets with a greater port number. |
| | | | | **lt** string | | Match only packets with a lower port number. |
| | | | | **neq** string | | Match only packets not on a given port number. |
| | | | | **range** dictionary | | Port range operator |
| | | | | | **end** integer | | Specify the end of the port range. |
| | | | | | **start** integer | | Specify the start of the port range. |
| | | **user\_object** dictionary | | Configures single user, local or import user group |
| | | | **user** list / elements=dictionary | | Configure a user objectUser name to configure a user object. |
| | | | | **domain** string / required | | User domain |
| | | | | **name** string / required | | Enter the name of the user |
| | | | **user\_group** list / elements=dictionary | | Configure a user group object. |
| | | | | **domain** string / required | | Group domain |
| | | | | **name** string / required | | Enter the name of the group |
| | **object\_type** string / required | **Choices:*** icmp-type
* network
* protocol
* security
* service
* user
| The object group type. |
| **running\_config** string | | The module, by default, will connect to the remote device and retrieve the current running-config to use as a base for comparing against the contents of source. There are times when it is not desirable to have the task get the current running-config for every task in a playbook. The *running\_config* argument allows the implementer to pass in the configuration to use as the base config for comparison. This value of this option should be the output received from device by executing command. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* gathered
* rendered
* parsed
| The state the configuration should be left in |
Notes
-----
Note
* Tested against Cisco ASA Version 9.10(1)11
* This module works with connection `network_cli`. See [ASA Platform Options](../network/user_guide/platform_asa).
Examples
--------
```
# Using merged
# Before state:
# -------------
#
# ciscoasa# sh running-config object-group
# object-group network test_og_network
# description test_network_og
# network-object host 192.0.3.1
- name: "Merge module attributes of given object-group"
cisco.asa.asa_ogs:
config:
- object_type: network
object_groups:
- name: group_network_obj
group_object:
- test_og_network
- name: test_og_network
description: test_og_network
network_object:
host:
- 192.0.2.1
- 192.0.2.2
address:
- 192.0.2.0 255.255.255.0
- 198.51.100.0 255.255.255.0
- name: test_network_og
description: test_network_og
network_object:
host:
- 192.0.3.1
- 192.0.3.2
ipv6_address:
- 2001:db8:3::/64
- object_type: security
object_groups:
- name: test_og_security
description: test_security
security_group:
sec_name:
- test_1
- test_2
tag:
- 10
- 20
- object_type: service
object_groups:
- name: O-Worker
services_object:
- protocol: tcp
destination_port:
range:
start: 100
end: 200
- protocol: tcp-udp
source_port:
eq: 1234
destination_port:
gt: nfs
- name: O-UNIX-TCP
protocol: tcp
port_object:
- eq: https
- range:
start: 100
end: 400
- object_type: user
object_groups:
- name: test_og_user
description: test_user
user_object:
user:
- name: new_user_1
domain: LOCAL
- name: new_user_2
domain: LOCAL
state: merged
# Commands fired:
# ---------------
#
# object-group security test_og_security
# description test_security
# security-group name test_1
# security-group name test_2
# security-group tag 10
# security-group tag 20
# object-group network group_network_obj
# group-object test_og_network
# object-group network test_og_network
# description test_og_network
# network-object 192.0.2.0 255.255.255.0
# network-object 198.51.100.0 255.255.255.0
# network-object host 192.0.2.1
# network-object host 192.0.2.2
# object-group network test_network_og
# network-object host 192.0.3.1
# network-object host 192.0.3.2
# network-object 2001:db8:3::/64
# object-group service O-Worker
# service-object tcp destination range 100 200
# service-object tcp source eq 1234 destination gt nfs
# object-group service O-UNIX-TCP tcp
# port-object eq https
# port-object range 100 400
# object-group user test_og_user
# description test_user
# user LOCAL\new_user_1
# user LOCAL\new_user_2
# After state:
# ------------
#
# ciscoasa# sh running-config object-group
# object-group network group_network_obj
# group-object test_og_network
# object-group network test_og_network
# description test_og_network
# network-object host 192.0.2.1
# network-object host 192.0.2.2
# network-object 192.0.2.0 255.255.255.0
# network-object 198.51.100.0 255.255.255.0
# network-object host 192.0.3.1
# object-group network test_network_og
# description test_network_og
# network-object host 192.0.3.1
# network-object host 192.0.3.2
# network-object 2001:db8:0:3::/64
# group-object test_og_network
# object-group security test_og_security
# security-group name test_1
# security-group name test_2
# security-group tag 10
# security-group tag 20
# object-group service O-Worker
# service-object tcp destination range 100 200
# service-object tcp source eq 1234 destination gt nfs
# object-group service O-UNIX-TCP tcp
# port-object eq https
# port-object range 100 400
# object-group user test_og_user
# description test_user
# user LOCAL\new_user_1
# user LOCAL\new_user_2
# Using Replaced
# Before state:
# -------------
#
# ciscoasa# sh running-config object-group
# object-group network test_og_network
# description test_og_network
# network-object host 192.0.2.1
# network-object host 192.0.2.2
# network-object 192.0.2.0 255.255.255.0
# network-object 198.51.100.0 255.255.255.0
# object-group network test_network_og
# description test_network_og
# network-object host 192.0.3.1
# network-object host 192.0.3.2
# network-object 2001:db8:0:3::/64
# group-object test_og_network
# object-group security test_og_security
# security-group name test_1
# security-group name test_2
# security-group tag 10
# security-group tag 20
# object-group service O-Worker
# service-object tcp destination range 100 200
# service-object tcp source eq 1234 destination gt nfs
# object-group service O-UNIX-TCP tcp
# port-object eq https
# port-object range 100 400
# object-group user test_og_user
# user LOCAL\new_user_1
# user LOCAL\new_user_2
- name: "Replace module attributes of given object-group"
cisco.asa.asa_ogs:
config:
- object_type: network
object_groups:
- name: test_og_network
description: test_og_network_replace
network_object:
host:
- 192.0.3.1
address:
- 192.0.3.0 255.255.255.0
- object_type: protocol
object_groups:
- name: test_og_protocol
description: test_og_protocol
protocol_object:
protocol:
- tcp
- udp
state: replaced
# Commands Fired:
# ---------------
#
# object-group protocol test_og_protocol
# description test_og_protocol
# protocol tcp
# protocol udp
# object-group network test_og_network
# description test_og_network_replace
# no network-object 192.0.2.0 255.255.255.0
# no network-object 198.51.100.0 255.255.255.0
# network-object 192.0.3.0 255.255.255.0
# no network-object host 192.0.2.1
# no network-object host 192.0.2.2
# network-object host 192.0.3.1
# After state:
# -------------
#
# ciscoasa# sh running-config object-group
# object-group network test_og_network
# description test_og_network_replace
# network-object host 192.0.3.1
# network-object 192.0.3.0 255.255.255.0
# object-group network test_network_og
# description test_network_og
# network-object host 192.0.3.1
# network-object host 192.0.3.2
# network-object 2001:db8:0:3::/64
# group-object test_og_network
# object-group security test_og_security
# security-group name test_1
# security-group name test_2
# security-group tag 10
# security-group tag 20
# object-group service O-Worker
# service-object tcp destination range 100 200
# service-object tcp source eq 1234 destination gt nfs
# object-group service O-UNIX-TCP tcp
# port-object eq https
# port-object range 100 400
# object-group user test_og_user
# user LOCAL\new_user_1
# user LOCAL\new_user_2
# object-group protocol test_og_protocol
# protocol-object tcp
# protocol-object udp
# Using Overridden
# Before state:
# -------------
#
# ciscoasa# sh running-config object-group
# object-group network test_og_network
# description test_og_network
# network-object host 192.0.2.1
# network-object host 192.0.2.2
# network-object 192.0.2.0 255.255.255.0
# network-object 198.51.100.0 255.255.255.0
# object-group network test_network_og
# description test_network_og
# network-object host 192.0.3.1
# network-object host 192.0.3.2
# network-object 2001:db8:0:3::/64
# group-object test_og_network
# object-group security test_og_security
# security-group name test_1
# security-group name test_2
# security-group tag 10
# security-group tag 20
# object-group service O-Worker
# service-object tcp destination range 100 200
# service-object tcp source eq 1234 destination gt nfs
# object-group service O-UNIX-TCP tcp
# port-object eq https
# port-object range 100 400
# object-group user test_og_user
# user LOCAL\new_user_1
# user LOCAL\new_user_2
- name: "Overridden module attributes of given object-group"
cisco.asa.asa_ogs:
config:
- object_type: network
object_groups:
- name: test_og_network
description: test_og_network_override
network_object:
host:
- 192.0.3.1
address:
- 192.0.3.0 255.255.255.0
- name: ANSIBLE_TEST
network_object:
object:
- TEST1
- TEST2
- object_type: protocol
object_groups:
- name: test_og_protocol
description: test_og_protocol
protocol_object:
protocol:
- tcp
- udp
state: overridden
# Commands Fired:
# ---------------
#
# no object-group security test_og_security
# no object-group service O-Worker
# no object-group service O-UNIX-TCP
# no object-group user test_og_user
# object-group protocol test_og_protocol
# description test_og_protocol
# protocol tcp
# protocol udp
# object-group network test_og_network
# description test_og_network_override
# no network-object 192.0.2.0 255.255.255.0
# no network-object 198.51.100.0 255.255.255.0
# network-object 192.0.3.0 255.255.255.0
# no network-object host 192.0.2.1
# no network-object host 192.0.2.2
# network-object host 192.0.3.1
# no object-group network test_network_og
# object-group network ANSIBLE_TEST
# network-object object TEST1
# network-object object TEST2
# After state:
# -------------
#
# ciscoasa# sh running-config object-group
# object-group network test_og_network
# description test_og_network_override
# network-object host 192.0.3.1
# network-object 192.0.3.0 255.255.255.0
# object-group network ANSIBLE_TEST
# network-object object TEST1
# network-object object TEST2
# object-group protocol test_og_protocol
# protocol-object tcp
# protocol-object udp
# Using Deleted
# Before state:
# -------------
#
# ciscoasa# sh running-config object-group
# object-group network test_og_network
# description test_og_network
# network-object host 192.0.2.1
# network-object host 192.0.2.2
# network-object 192.0.2.0 255.255.255.0
# network-object 198.51.100.0 255.255.255.0
# object-group network test_network_og
# description test_network_og
# network-object host 192.0.3.1
# network-object host 192.0.3.2
# network-object 2001:db8:0:3::/64
# group-object test_og_network
# object-group security test_og_security
# security-group name test_1
# security-group name test_2
# security-group tag 10
# security-group tag 20
# object-group service O-Worker
# service-object tcp destination range 100 200
# service-object tcp source eq 1234 destination gt nfs
# object-group service O-UNIX-TCP tcp
# port-object eq https
# port-object range 100 400
# object-group user test_og_user
# user LOCAL\new_user_1
# user LOCAL\new_user_2
- name: "Delete given module attributes"
cisco.asa.asa_ogs:
config:
- object_type: network
object_groups:
- name: test_og_network
- name: test_network_og
- object_type: security
object_groups:
- name: test_og_security
- object_type: service
object_groups:
- name: O-UNIX-TCP
state: deleted
# Commands Fired:
# ---------------
#
# no object-group network test_og_network
# no object-group network test_network_og
# no object-group security test_og_security
# no object-group service O-UNIX-TCP
# After state:
# -------------
#
# ciscoasa# sh running-config object-group
# object-group user test_og_user
# user LOCAL\new_user_1
# user LOCAL\new_user_2
# object-group service O-Worker
# service-object tcp destination range 100 200
# service-object tcp source eq 1234 destination gt nfs
# Using DELETED without any config passed
#"(NOTE: This will delete all of configured resource module attributes)"
# Before state:
# -------------
#
# ciscoasa# sh running-config object-group
# object-group network test_og_network
# description test_og_network
# network-object host 192.0.2.1
# network-object host 192.0.2.2
# network-object 192.0.2.0 255.255.255.0
# network-object 198.51.100.0 255.255.255.0
# object-group network test_network_og
# description test_network_og
# network-object host 192.0.3.1
# network-object host 192.0.3.2
# network-object 2001:db8:0:3::/64
# group-object test_og_network
# object-group security test_og_security
# security-group name test_1
# security-group name test_2
# security-group tag 10
# security-group tag 20
# object-group user test_og_user
# user LOCAL\new_user_1
# user LOCAL\new_user_2
- name: Delete ALL configured module attributes
cisco.asa.asa_ogs:
config:
state: deleted
# Commands Fired:
# ---------------
#
# no object-group network test_og_network
# no object-group network test_network_og
# no object-group security test_og_security
# no object-group user test_og_user
# After state:
# -------------
#
# ciscoasa# sh running-config object-group
# Using Gathered
# Before state:
# -------------
#
# ciscoasa# sh running-config object-group
# object-group network test_og_network
# description test_og_network
# network-object host 192.0.2.1
# network-object host 192.0.2.2
# network-object 192.0.2.0 255.255.255.0
# network-object 198.51.100.0 255.255.255.0
# object-group network test_network_og
# description test_network_og
# network-object host 192.0.3.1
# network-object host 192.0.3.2
# network-object 2001:db8:0:3::/64
# group-object test_og_network
# object-group security test_og_security
# security-group name test_1
# security-group name test_2
# security-group tag 10
# security-group tag 20
# object-group user test_og_user
# user LOCAL\new_user_1
# user LOCAL\new_user_2
- name: Gather listed OGs with provided configurations
cisco.asa.asa_ogs:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "object_groups": [
# {
# "description": "test_security",
# "name": "test_og_security",
# "security_group": {
# "sec_name": [
# "test_2",
# "test_1"
# ],
# "tag": [
# 10,
# 20
# ]
# }
# }
# ],
# "object_type": "security"
# },
# {
# "object_groups": [
# {
# "description": "test_network_og",
# "name": "test_network_og",
# "network_object": {
# "host": [
# "192.0.3.1",
# "192.0.3.2"
# ],
# "ipv6_address": [
# "2001:db8:3::/64"
# ]
# }
# },
# {
# "description": "test_og_network",
# "name": "test_og_network",
# "network_object": {
# "address": [
# "192.0.2.0 255.255.255.0",
# "198.51.100.0 255.255.255.0"
# ],
# "host": [
# "192.0.2.1",
# "192.0.2.2"
# ]
# }
# }
# ],
# "object_type": "network"
# },
# {
# "object_groups": [
# {
# "description": "test_user",
# "name": "test_og_user",
# "user_object": {
# "user": [
# {
# "domain": "LOCAL",
# "name": "new_user_1"
# },
# {
# "domain": "LOCAL",
# "name": "new_user_2"
# }
# ]
# }
# }
# ],
# "object_type": "user"
# }
# ]
# After state:
# ------------
#
# ciscoasa# sh running-config object-group
# object-group network test_og_network
# description test_og_network
# network-object host 192.0.2.1
# network-object host 192.0.2.2
# network-object 192.0.2.0 255.255.255.0
# network-object 198.51.100.0 255.255.255.0
# object-group network test_network_og
# description test_network_og
# network-object host 192.0.3.1
# network-object host 192.0.3.2
# network-object 2001:db8:0:3::/64
# group-object test_og_network
# object-group security test_og_security
# security-group name test_1
# security-group name test_2
# security-group tag 10
# security-group tag 20
# object-group user test_og_user
# user LOCAL\new_user_1
# user LOCAL\new_user_2
# Using Rendered
- name: Render the commands for provided configuration
cisco.asa.asa_ogs:
config:
- object_type: network
object_groups:
- name: test_og_network
description: test_og_network
network_object:
host:
- 192.0.2.1
- 192.0.2.2
address:
- 192.0.2.0 255.255.255.0
- 198.51.100.0 255.255.255.0
- name: test_network_og
description: test_network_og
network_object:
host:
- 192.0.3.1
- 192.0.3.2
ipv6_address:
- 2001:db8:3::/64
- object_type: security
object_groups:
- name: test_og_security
description: test_security
security_group:
sec_name:
- test_1
- test_2
tag:
- 10
- 20
- object_type: user
object_groups:
- name: test_og_user
description: test_user
user_object:
user:
- name: new_user_1
domain: LOCAL
- name: new_user_2
domain: LOCAL
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "object-group security test_og_security",
# "description test_security",
# "security-group name test_1",
# "security-group name test_2",
# "security-group tag 10",
# "security-group tag 20",
# "object-group network test_og_network",
# "description test_og_network",
# "network-object 192.0.2.0 255.255.255.0",
# "network-object 198.51.100.0 255.255.255.0",
# "network-object host 192.0.2.1",
# "network-object host 192.0.2.2",
# "object-group network test_network_og",
# "description test_network_og",
# "network-object host 192.0.3.1",
# "network-object host 192.0.3.2",
# "network-object 2001:db8:3::/64",
# "object-group user test_og_user",
# "description test_user",
# "user LOCAL\new_user_1",
# "user LOCAL\new_user_2"
# ]
# Using Parsed
# parsed.cfg
#
# object-group network test_og_network
# description test_og_network
# network-object host 192.0.2.1
# network-object 192.0.2.0 255.255.255.0
# object-group network test_network_og
# network-object 2001:db8:3::/64
# object-group service test_og_service
# service-object tcp-udp
- name: Parse the commands for provided configuration
cisco.asa.asa_ogs:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "object_groups": [
# {
# "name": "test_network_og"
# },
# {
# "description": "test_og_network",
# "name": "test_og_network",
# "network_object": {
# "host": [
# "192.0.2.2"
# ]
# }
# }
# ],
# "object_type": "network"
# },
# {
# "object_groups": [
# {
# "name": "test_og_service",
# "service_object": {
# "protocol": [
# "tcp-udp",
# "ipinip"
# ]
# }
# }
# ],
# "object_type": "service"
# }
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device **Sample:** ['object-group network test\_network\_og', 'description test\_network\_og', 'network-object host 192.0.2.1'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.asa.asa_command β Run arbitrary commands on Cisco ASA devices cisco.asa.asa\_command β Run arbitrary commands on Cisco ASA devices
====================================================================
Note
This plugin is part of the [cisco.asa collection](https://galaxy.ansible.com/cisco/asa) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.asa`.
To use it in a playbook, specify: `cisco.asa.asa_command`.
New in version 1.0.0: of cisco.asa
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Sends arbitrary commands to an ASA node and returns the results read from the device. The `asa_command` module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **authorize** boolean | **Choices:*** no
* yes
| **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli` and `become: yes`. For more information please see the [Network Guide](../network/getting_started/network_differences#multiple-communication-protocols). Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| **commands** list / elements=string / required | | List of commands to send to the remote device over the configured provider. The resulting output from the command is returned. If the *wait\_for* argument is provided, the module is not returned until the condition is satisfied or the number of retires as expired. |
| **context** string | | Specifies which context to target if you are running in the ASA in multiple context mode. Defaults to the current context you login to. |
| **interval** integer | **Default:**1 | Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified conditions, the interval indicates how long to wait before trying the command again. |
| **match** string | **Choices:*** any
* **all** β
| The *match* argument is used in conjunction with the *wait\_for* argument to specify the match policy. Valid values are `all` or `any`. If the value is set to `all` then all conditionals in the wait\_for must be satisfied. If the value is set to `any` then only one of the values must be satisfied. |
| **passwords** boolean | **Choices:*** no
* yes
| Saves running-config passwords in clear-text when set to True. Defaults to False |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [Network Guide](../network/getting_started/network_differences#multiple-communication-protocols). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** no
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies idle timeout in seconds for the connection, in seconds. Useful if the console freezes before continuing. For example when saving configurations. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **retries** integer | **Default:**10 | Specifies the number of retries a command should by tried before it is considered failed. The command is run on the target device every retry and evaluated against the *wait\_for* conditions. |
| **wait\_for** list / elements=string | | List of conditions to evaluate against the output of the command. The task will wait for each condition to be true before moving forward. If the conditional is not true within the configured number of retries, the task fails. See examples.
aliases: waitfor |
Notes
-----
Note
* When processing wait\_for, each commandsβ output is stored as an element of the *result* array. The allowed operators for conditional evaluation are *eq*, *==*, *neq*, *ne*, *!=*, *gt*, *>*, *ge*, *>=*, *lt*, *<*, *le*, *<=*, *contains*, *matches*. Operators can be prefaced by *not* to negate their meaning. The *contains* operator searches for a substring match (like the Python *in* operator). The *matches* operator searches using a regex search operation.
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
Examples
--------
```
- name: Show the ASA version
cisco.asa.asa_command:
commands:
- show version
- name: Show ASA drops and memory
cisco.asa.asa_command:
commands:
- show asp drop
- show memory
- name: Send repeat pings and wait for the result to pass 100%
cisco.asa.asa_command:
commands:
- ping 8.8.8.8 repeat 20 size 350
wait_for:
- result[0] contains 100
retries: 2
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **failed\_conditions** list / elements=string | failed | the conditionals that failed **Sample:** ['...', '...'] |
| **stdout** list / elements=string | always | the set of responses from the commands **Sample:** ['...', '...'] |
| **stdout\_lines** list / elements=string | always | The value of stdout split into a list **Sample:** [['...', '...'], ['...'], ['...']] |
### Authors
* Peter Sprygada (@privateip), Patrick Ogenstad (@ogenstad)
ansible cisco.asa.asa_acl β (deprecated, removed after 2022-06-01) Manage access-lists on a Cisco ASA cisco.asa.asa\_acl β (deprecated, removed after 2022-06-01) Manage access-lists on a Cisco ASA
==============================================================================================
Note
This plugin is part of the [cisco.asa collection](https://galaxy.ansible.com/cisco/asa) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.asa`.
To use it in a playbook, specify: `cisco.asa.asa_acl`.
New in version 1.0.0: of cisco.asa
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Newer and updated modules released with more functionality in Ansible 2.10
Alternative
asa\_acls
Synopsis
--------
* This module allows you to work with access-lists on a Cisco ASA device.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **after** list / elements=string | | The ordered set of commands to append to the end of the command stack if a changed needs to be made. Just like with *before* this allows the playbook designer to append a set of commands to be executed after the command set. |
| **authorize** boolean | **Choices:*** no
* yes
| **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli` and `become: yes`. For more information please see the [Network Guide](../network/getting_started/network_differences#multiple-communication-protocols). Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| **before** list / elements=string | | The ordered set of commands to push on to the command stack if a change needs to be made. This allows the playbook designer the opportunity to perform configuration commands prior to pushing any changes without affecting how the set of commands are matched against the system. |
| **config** string | | The module, by default, will connect to the remote device and retrieve the current running-config to use as a base for comparing against the contents of source. There are times when it is not desirable to have the task get the current running-config for every task in a playbook. The *config* argument allows the implementer to pass in the configuration to use as the base config for comparison. |
| **context** string | | Specifies which context to target if you are running in the ASA in multiple context mode. Defaults to the current context you login to. |
| **force** boolean | **Choices:*** **no** β
* yes
| The force argument instructs the module to not consider the current devices running-config. When set to true, this will cause the module to push the contents of *src* into the device without first checking if already configured. |
| **lines** list / elements=string / required | | The ordered set of commands that should be configured in the section. The commands must be the exact same commands as found in the device running-config. Be sure to note the configuration command syntax as some commands are automatically modified by the device config parser.
aliases: commands |
| **match** string | **Choices:*** **line** β
* strict
* exact
| Instructs the module on the way to perform the matching of the set of commands against the current device config. If match is set to *line*, commands are matched line by line. If match is set to *strict*, command lines are matched with respect to position. Finally if match is set to *exact*, command lines must be an equal match. |
| **passwords** boolean | **Choices:*** no
* yes
| Saves running-config passwords in clear-text when set to True. Defaults to False |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [Network Guide](../network/getting_started/network_differences#multiple-communication-protocols). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** no
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies idle timeout in seconds for the connection, in seconds. Useful if the console freezes before continuing. For example when saving configurations. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **replace** string | **Choices:*** **line** β
* block
| Instructs the module on the way to perform the configuration on the device. If the replace argument is set to *line* then the modified lines are pushed to the device in configuration mode. If the replace argument is set to *block* then the entire command block is pushed to the device in configuration mode if any line is not correct. |
Notes
-----
Note
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
Examples
--------
```
- cisco.asa.asa_acl:
lines:
- access-list ACL-ANSIBLE extended permit tcp any any eq 82
- access-list ACL-ANSIBLE extended permit tcp any any eq www
- access-list ACL-ANSIBLE extended permit tcp any any eq 97
- access-list ACL-ANSIBLE extended permit tcp any any eq 98
- access-list ACL-ANSIBLE extended permit tcp any any eq 99
before: clear configure access-list ACL-ANSIBLE
match: strict
replace: block
provider: '{{ cli }}'
- cisco.asa.asa_acl:
lines:
- access-list ACL-OUTSIDE extended permit tcp any any eq www
- access-list ACL-OUTSIDE extended permit tcp any any eq https
context: customer_a
provider: '{{ cli }}'
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **updates** list / elements=string | always | The set of commands that will be pushed to the remote device **Sample:** ['access-list ACL-OUTSIDE extended permit tcp any any eq www'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Patrick Ogenstad (@ogenstad)
ansible cisco.asa.asa β Use asa cliconf to run command on Cisco ASA platform cisco.asa.asa β Use asa cliconf to run command on Cisco ASA platform
====================================================================
Note
This plugin is part of the [cisco.asa collection](https://galaxy.ansible.com/cisco/asa) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.asa`.
To use it in a playbook, specify: `cisco.asa.asa`.
New in version 1.0.0: of cisco.asa
* [Synopsis](#synopsis)
* [Parameters](#parameters)
Synopsis
--------
* This asa plugin provides low level abstraction apis for sending and receiving CLI commands from Cisco ASA network devices.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **config\_commands** list / elements=string added in 2.0.0 of cisco.asa | **Default:**[] | var: ansible\_asa\_config\_commands | Specifies a list of commands that can make configuration changes to the target device. When `ansible\_network\_single\_user\_mode` is enabled, if a command sent to the device is present in this list, the existing cache is invalidated. |
### Authors
* Ansible Security Team
ansible cisco.asa.asa_config β Manage configuration sections on Cisco ASA devices cisco.asa.asa\_config β Manage configuration sections on Cisco ASA devices
==========================================================================
Note
This plugin is part of the [cisco.asa collection](https://galaxy.ansible.com/cisco/asa) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.asa`.
To use it in a playbook, specify: `cisco.asa.asa_config`.
New in version 1.0.0: of cisco.asa
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Cisco ASA configurations use a simple block indent file syntax for segmenting configuration into sections. This module provides an implementation for working with ASA configuration sections in a deterministic way.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **after** list / elements=string | | The ordered set of commands to append to the end of the command stack if a change needs to be made. Just like with *before* this allows the playbook designer to append a set of commands to be executed after the command set. |
| **authorize** boolean | **Choices:*** no
* yes
| **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli` and `become: yes`. For more information please see the [Network Guide](../network/getting_started/network_differences#multiple-communication-protocols). Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| **backup** boolean | **Choices:*** **no** β
* yes
| This argument will cause the module to create a full backup of the current `running-config` from the remote device before any changes are made. If the `backup_options` value is not given, the backup file is written to the `backup` folder in the playbook root directory. If the directory does not exist, it is created. |
| **backup\_options** dictionary | | This is a dict object containing configurable options related to backup file path. The value of this option is read only when `backup` is set to *yes*, if `backup` is set to *no* this option will be silently ignored. |
| | **dir\_path** path | | This option provides the path ending with directory name in which the backup configuration file will be stored. If the directory does not exist it will be first created and the filename is either the value of `filename` or default filename as described in `filename` options description. If the path value is not given in that case a *backup* directory will be created in the current working directory and backup configuration will be copied in `filename` within *backup* directory. |
| | **filename** string | | The filename to be used to store the backup configuration. If the filename is not given it will be generated based on the hostname, current time and date in format defined by <hostname>\_config.<current-date>@<current-time> |
| **before** list / elements=string | | The ordered set of commands to push on to the command stack if a change needs to be made. This allows the playbook designer the opportunity to perform configuration commands prior to pushing any changes without affecting how the set of commands are matched against the system. |
| **config** string | | The `config` argument allows the playbook designer to supply the base configuration to be used to validate configuration changes necessary. If this argument is provided, the module will not download the running-config from the remote node. |
| **context** string | | Specifies which context to target if you are running in the ASA in multiple context mode. Defaults to the current context you login to. |
| **defaults** boolean | **Choices:*** **no** β
* yes
| This argument specifies whether or not to collect all defaults when getting the remote device running config. When enabled, the module will get the current config by issuing the command `show running-config all`. |
| **lines** list / elements=string | | The ordered set of commands that should be configured in the section. The commands must be the exact same commands as found in the device running-config. Be sure to note the configuration command syntax as some commands are automatically modified by the device config parser.
aliases: commands |
| **match** string | **Choices:*** **line** β
* strict
* exact
* none
| Instructs the module on the way to perform the matching of the set of commands against the current device config. If match is set to *line*, commands are matched line by line. If match is set to *strict*, command lines are matched with respect to position. If match is set to *exact*, command lines must be an equal match. Finally, if match is set to *none*, the module will not attempt to compare the source configuration with the running configuration on the remote device. |
| **parents** list / elements=string | | The ordered set of parents that uniquely identify the section or hierarchy the commands should be checked against. If the parents argument is omitted, the commands are checked against the set of top level or global commands. |
| **passwords** boolean | **Choices:*** no
* yes
| This argument specifies to include passwords in the config when retrieving the running-config from the remote device. This includes passwords related to VPN endpoints. This argument is mutually exclusive with *defaults*. |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [Network Guide](../network/getting_started/network_differences#multiple-communication-protocols). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** no
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies idle timeout in seconds for the connection, in seconds. Useful if the console freezes before continuing. For example when saving configurations. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
| **replace** string | **Choices:*** **line** β
* block
| Instructs the module on the way to perform the configuration on the device. If the replace argument is set to *line* then the modified lines are pushed to the device in configuration mode. If the replace argument is set to *block* then the entire command block is pushed to the device in configuration mode if any line is not correct |
| **save** boolean | **Choices:*** **no** β
* yes
| The `save` argument instructs the module to save the running- config to the startup-config at the conclusion of the module running. If check mode is specified, this argument is ignored. |
| **save\_when** string added in 1.1.0 of cisco.asa | **Choices:*** always
* **never** β
* modified
* changed
| When changes are made to the device running-configuration, the changes are not copied to non-volatile storage by default. Using this argument will change that before. If the argument is set to *always*, then the running-config will always be copied to the startup-config and the *modified* flag will always be set to True. If the argument is set to *modified*, then the running-config will only be copied to the startup-config if it has changed since the last save to startup-config. If the argument is set to *never*, the running-config will never be copied to the startup-config. If the argument is set to *changed*, then the running-config will only be copied to the startup-config if the task has made a change. *changed* was added in Ansible 2.5. |
| **src** path | | Specifies the source path to the file that contains the configuration or configuration template to load. The path to the source file can either be the full path on the Ansible control host or a relative path from the playbook or role root directory. This argument is mutually exclusive with *lines*, *parents*. |
Notes
-----
Note
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
Examples
--------
```
- cisco.asa.asa_config:
lines:
- network-object host 10.80.30.18
- network-object host 10.80.30.19
- network-object host 10.80.30.20
parents: [object-group network OG-MONITORED-SERVERS]
provider: '{{ cli }}'
- cisco.asa.asa_config:
host: '{{ inventory_hostname }}'
lines:
- message-length maximum client auto
- message-length maximum 512
match: line
parents: [policy-map type inspect dns PM-DNS, parameters]
authorize: yes
auth_pass: cisco
username: admin
password: cisco
context: ansible
- cisco.asa.asa_config:
lines:
- ikev1 pre-shared-key MyS3cretVPNK3y
parents: tunnel-group 1.1.1.1 ipsec-attributes
passwords: yes
provider: '{{ cli }}'
- name: attach ASA acl on interface vlan13/nameif cloud13
cisco.asa.asa_config:
lines:
- access-group cloud-acl_access_in in interface cloud13
provider: '{{ cli }}'
- name: configure ASA (>=9.2) default BGP
cisco.asa.asa_config:
lines:
- bgp log-neighbor-changes
- bgp bestpath compare-routerid
provider: '{{ cli }}'
parents:
- router bgp 65002
register: bgp
when: bgp_default_config is defined
- name: configure ASA (>=9.2) BGP neighbor in default/single context mode
cisco.asa.asa_config:
lines:
- bgp router-id {{ bgp_router_id }}
- neighbor {{ bgp_neighbor_ip }} remote-as {{ bgp_neighbor_as }}
- neighbor {{ bgp_neighbor_ip }} description {{ bgp_neighbor_name }}
provider: '{{ cli }}'
parents:
- router bgp 65002
- address-family ipv4 unicast
register: bgp
when: bgp_neighbor_as is defined
- name: configure ASA interface with standby
cisco.asa.asa_config:
lines:
- description my cloud interface
- nameif cloud13
- security-level 50
- ip address 192.168.13.1 255.255.255.0 standby 192.168.13.2
provider: '{{ cli }}'
parents: [interface Vlan13]
register: interface
- name: Show changes to interface from task above
debug:
var: interface
- name: configurable backup path
cisco.asa.asa_config:
lines:
- access-group cloud-acl_access_in in interface cloud13
provider: '{{ cli }}'
backup: yes
backup_options:
filename: backup.cfg
dir_path: /home/user
- name: save running to startup when modified
cisco.asa.asa_config:
save_when: modified
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **backup\_path** string | when backup is yes | The full path to the backup file **Sample:** /playbooks/ansible/backup/asa\_config.2016-07-16@22:28:34 |
| **updates** list / elements=string | always | The set of commands that will be pushed to the remote device **Sample:** ['...', '...'] |
### Authors
* Peter Sprygada (@privateip), Patrick Ogenstad (@ogenstad)
| programming_docs |
ansible cisco.asa.asa_facts β Collect facts from remote devices running Cisco ASA cisco.asa.asa\_facts β Collect facts from remote devices running Cisco ASA
==========================================================================
Note
This plugin is part of the [cisco.asa collection](https://galaxy.ansible.com/cisco/asa) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.asa`.
To use it in a playbook, specify: `cisco.asa.asa_facts`.
New in version 1.0.0: of cisco.asa
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Collects a base set of device facts from a remote device that is running ASA. This module prepends all of the base network fact keys with `ansible_net_<fact>`. The facts module will always collect a base set of facts from the device and can enable or disable collection of additional facts.
* Note, to collects facts from ASA device properly user should elevate the privilege to become.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **authorize** boolean | **Choices:*** no
* yes
| **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli` and `become: yes`. For more information please see the [Network Guide](../network/getting_started/network_differences#multiple-communication-protocols). Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| **context** string | | Specifies which context to target if you are running in the ASA in multiple context mode. Defaults to the current context you login to. |
| **gather\_network\_resources** list / elements=string | | When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument include all and the resources like interfaces, vlans etc. Can specify a list of values to include a larger subset. Values can also be used with an initial `M(!`) to specify that a specific subset should not be collected. Valid subsets are 'all', 'acls', 'ogs'. |
| **gather\_subset** list / elements=string | **Default:**"!config" | When supplied, this argument restricts the facts collected to a given subset. Possible values for this argument include `all`, `min`, `hardware`, `config`. Specify a list of values to include a larger subset. Use a value with an initial `!` to collect all facts except that subset. |
| **passwords** boolean | **Choices:*** no
* yes
| Saves running-config passwords in clear-text when set to True. Defaults to False |
| **provider** dictionary | | **Deprecated** Starting with Ansible 2.5 we recommend using `connection: network_cli`. For more information please see the [Network Guide](../network/getting_started/network_differences#multiple-communication-protocols). A dict object containing connection details. |
| | **auth\_pass** string | | Specifies the password to use if required to enter privileged mode on the remote device. If *authorize* is false, then this argument does nothing. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTH_PASS` will be used instead. |
| | **authorize** boolean | **Choices:*** no
* yes
| Instructs the module to enter privileged mode on the remote device before sending any commands. If not specified, the device will attempt to execute all commands in non-privileged mode. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_AUTHORIZE` will be used instead. |
| | **host** string | | Specifies the DNS host name or address for connecting to the remote device over the specified transport. The value of host is used as the destination address for the transport. |
| | **password** string | | Specifies the password to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_PASSWORD` will be used instead. |
| | **port** integer | | Specifies the port to use when building the connection to the remote device. |
| | **ssh\_keyfile** path | | Specifies the SSH key to use to authenticate the connection to the remote device. This value is the path to the key used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_SSH_KEYFILE` will be used instead. |
| | **timeout** integer | | Specifies idle timeout in seconds for the connection, in seconds. Useful if the console freezes before continuing. For example when saving configurations. |
| | **username** string | | Configures the username to use to authenticate the connection to the remote device. This value is used to authenticate the SSH session. If the value is not specified in the task, the value of environment variable `ANSIBLE_NET_USERNAME` will be used instead. |
Notes
-----
Note
* Tested against asa 9.10(1)11
* For more information on using Ansible to manage network devices see the [Ansible Network Guide](../../../network/index#network-guide)
Examples
--------
```
- name: Gather all legacy facts
cisco.asa.asa_facts:
gather_subset: all
- name: Gather only the config and default facts
cisco.asa.asa_facts:
gather_subset:
- config
- name: Do not gather hardware facts
cisco.asa.asa_facts:
gather_subset:
- '!hardware'
- name: Gather legacy and resource facts
cisco.asa.asa_facts:
gather_subset: all
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **ansible\_net\_api** string | always | The name of the transport |
| **ansible\_net\_asatype** string | always | The operating system type (Cisco ASA) running on the remote device. |
| **ansible\_net\_config** string | when config is configured | The current active config from the device |
| **ansible\_net\_device\_mgr\_version** string | always | The Device manager version running on the remote device. |
| **ansible\_net\_filesystems** list / elements=string | when hardware is configured | All file system names available on the device |
| **ansible\_net\_filesystems\_info** dictionary | when hardware is configured | A hash of all file systems containing info about each file system (e.g. free and total space) |
| **ansible\_net\_firepower\_version** string | always | The Firepower operating system version running on the remote device. |
| **ansible\_net\_gather\_subset** list / elements=string | always | The list of fact subsets collected from the device |
| **ansible\_net\_hostname** string | always | The configured hostname of the device |
| **ansible\_net\_image** string | always | The image file the device is running |
| **ansible\_net\_memfree\_mb** integer | when hardware is configured | The available free memory on the remote device in Mb |
| **ansible\_net\_memtotal\_mb** integer | when hardware is configured | The total memory on the remote device in Mb |
| **ansible\_net\_memused\_mb** integer | when hardware is configured | The used memory on the remote device in Mb |
| **ansible\_net\_model** string | always | The model name returned from the device |
| **ansible\_net\_python\_version** string | always | The Python version Ansible controller is using |
| **ansible\_net\_serialnum** string | always | The serial number of the remote device |
| **ansible\_net\_stacked\_models** list / elements=string | when multiple devices are configured in a stack | The model names of each device in the stack |
| **ansible\_net\_stacked\_serialnums** list / elements=string | when multiple devices are configured in a stack | The serial numbers of each device in the stack |
| **ansible\_net\_version** string | always | The operating system version running on the remote device |
### Authors
* Sumit Jaiswal (@justjais)
ansible cisco.asa.asa_og β (deprecated, removed after 2022-06-01) Manage object groups on a Cisco ASA cisco.asa.asa\_og β (deprecated, removed after 2022-06-01) Manage object groups on a Cisco ASA
==============================================================================================
Note
This plugin is part of the [cisco.asa collection](https://galaxy.ansible.com/cisco/asa) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.asa`.
To use it in a playbook, specify: `cisco.asa.asa_og`.
New in version 1.0.0: of cisco.asa
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Newer and updated modules released with more functionality in Ansible 2.10
Alternative
asa\_ogs
Synopsis
--------
* This module allows you to create and update object-group network/service on Cisco ASA device.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **description** string | | The description for the object-group. |
| **group\_object** list / elements=string | | The group-object for network object-group. |
| **group\_type** string / required | **Choices:*** network-object
* service-object
* port-object
| The object group type. |
| **host\_ip** list / elements=string | | The host IP address for object-group network. |
| **ip\_mask** list / elements=string | | The IP address and mask for network object-group. |
| **name** string / required | | Name of the object group. |
| **port\_eq** list / elements=string | | The single port for port-object. |
| **port\_range** list / elements=string | | The port range for port-object. |
| **protocol** string | **Choices:*** udp
* tcp
* tcp-udp
| The protocol for object-group service with port-object. |
| **service\_cfg** list / elements=string | | The service-object configuration protocol, direction, range or port. |
| **state** string | **Choices:*** **present** β
* absent
* replace
| Manage the state of the resource. |
Examples
--------
```
- name: configure network object-group
cisco.asa.asa_og:
name: ansible_test_0
group_type: network-object
state: present
description: ansible_test object-group description
host_ip:
- 8.8.8.8
- 8.8.4.4
ip_mask:
- 10.0.0.0 255.255.255.0
- 192.168.0.0 255.255.0.0
group_object:
- awx_lon
- awx_ams
- name: configure port-object object-group
cisco.asa.asa_og:
name: ansible_test_1
group_type: port-object
state: replace
description: ansible_test object-group description
protocol: tcp-udp
port_eq:
- 1025
- kerberos
port_range:
- 1025 5201
- 0 1024
- name: configure service-object object-group
cisco.asa.asa_og:
name: ansible_test_2
group_type: service-object
state: absent
description: ansible_test object-group description
service_cfg:
- tcp destination eq 8080
- tcp destination eq www
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | command sent to the device **Sample:** ['object-group network ansible\_test\_0', 'description ansible\_test object-group description', 'network-object host 8.8.8.8', 'network-object host 8.8.4.4', 'network-object 10.0.0.0 255.255.255.0', 'network-object 192.168.0.0 255.255.0.0', 'network-object 192.168.0.0 255.255.0.0', 'group-object awx\_lon', 'group-object awx\_ams'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Federico Olivieri (@Federico87)
ansible cisco.asa.asa_acls β Access-Lists resource module cisco.asa.asa\_acls β Access-Lists resource module
==================================================
Note
This plugin is part of the [cisco.asa collection](https://galaxy.ansible.com/cisco/asa) (version 2.1.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.asa`.
To use it in a playbook, specify: `cisco.asa.asa_acls`.
New in version 1.0.0: of cisco.asa
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module configures and manages the named or numbered ACLs on ASA platforms.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** dictionary | | A dictionary of ACL options. |
| | **acls** list / elements=dictionary | | A list of Access Control Lists (ACL). |
| | | **aces** list / elements=dictionary | | The entries within the ACL. |
| | | | **destination** dictionary | | Specify the packet destination. |
| | | | | **address** string | | Host address to match, or any single host address. |
| | | | | **any** boolean | **Choices:*** no
* yes
| Match any destination address. |
| | | | | **any4** boolean | **Choices:*** no
* yes
| Match any ipv4 destination address. |
| | | | | **any6** boolean | **Choices:*** no
* yes
| Match any ipv6 destination address. |
| | | | | **host** string | | A single destination host |
| | | | | **interface** string | | Use interface address as destination address |
| | | | | **netmask** string | | Netmask for destination IP address, valid with IPV4 address. |
| | | | | **object\_group** string | | Network object-group for destination address |
| | | | | **port\_protocol** dictionary | | Specify the destination port along with protocol. Note, Valid with TCP/UDP protocol\_options |
| | | | | | **eq** string | | Match only packets on a given port number. |
| | | | | | **gt** string | | Match only packets with a greater port number. |
| | | | | | **lt** string | | Match only packets with a lower port number. |
| | | | | | **neq** string | | Match only packets not on a given port number. |
| | | | | | **range** dictionary | | Port range operator |
| | | | | | | **end** integer | | Specify the end of the port range. |
| | | | | | | **start** integer | | Specify the start of the port range. |
| | | | | **service\_object\_group** string | | Service object-group for destination port |
| | | | **grant** string | **Choices:*** permit
* deny
| Specify the action. |
| | | | **inactive** boolean | **Choices:*** no
* yes
| Keyword for disabling an ACL element. |
| | | | **line** integer | | Use this to specify line number at which ACE should be entered. Existing ACE can be updated based on the input line number. It's not a required param in case of configuring the acl, but in case of Delete operation it's required, else Delete operation won't work as expected. Refer to vendor documentation for valid values. |
| | | | **log** string | **Choices:*** default
* alerts
* critical
* debugging
* disable
* emergencies
* errors
* informational
* interval
* notifications
* warnings
| Log matches against this entry. |
| | | | **protocol** string | | Specify the protocol to match. Refer to vendor documentation for valid values. |
| | | | **protocol\_options** dictionary | | protocol type. |
| | | | | **ahp** boolean | **Choices:*** no
* yes
| Authentication Header Protocol. |
| | | | | **eigrp** boolean | **Choices:*** no
* yes
| Cisco's EIGRP routing protocol. |
| | | | | **esp** boolean | **Choices:*** no
* yes
| Encapsulation Security Payload. |
| | | | | **gre** boolean | **Choices:*** no
* yes
| Cisco's GRE tunneling. |
| | | | | **icmp** dictionary | | Internet Control Message Protocol. |
| | | | | | **alternate\_address** boolean | **Choices:*** no
* yes
| Alternate address |
| | | | | | **conversion\_error** boolean | **Choices:*** no
* yes
| Datagram conversion |
| | | | | | **echo** boolean | **Choices:*** no
* yes
| Echo (ping) |
| | | | | | **echo\_reply** boolean | **Choices:*** no
* yes
| Echo reply |
| | | | | | **information\_reply** boolean | **Choices:*** no
* yes
| Information replies |
| | | | | | **information\_request** boolean | **Choices:*** no
* yes
| Information requests |
| | | | | | **mask\_reply** boolean | **Choices:*** no
* yes
| Mask replies |
| | | | | | **mask\_request** boolean | **Choices:*** no
* yes
| mask\_request |
| | | | | | **mobile\_redirect** boolean | **Choices:*** no
* yes
| Mobile host redirect |
| | | | | | **parameter\_problem** boolean | **Choices:*** no
* yes
| All parameter problems |
| | | | | | **redirect** boolean | **Choices:*** no
* yes
| All redirects |
| | | | | | **router\_advertisement** boolean | **Choices:*** no
* yes
| Router discovery advertisements |
| | | | | | **router\_solicitation** boolean | **Choices:*** no
* yes
| Router discovery solicitations |
| | | | | | **source\_quench** boolean | **Choices:*** no
* yes
| Source quenches |
| | | | | | **source\_route\_failed** boolean | **Choices:*** no
* yes
| Source route |
| | | | | | **time\_exceeded** boolean | **Choices:*** no
* yes
| All time exceededs |
| | | | | | **timestamp\_reply** boolean | **Choices:*** no
* yes
| Timestamp replies |
| | | | | | **timestamp\_request** boolean | **Choices:*** no
* yes
| Timestamp requests |
| | | | | | **traceroute** boolean | **Choices:*** no
* yes
| Traceroute |
| | | | | | **unreachable** boolean | **Choices:*** no
* yes
| All unreachables |
| | | | | **icmp6** dictionary | | Internet Control Message Protocol. |
| | | | | | **echo** boolean | **Choices:*** no
* yes
| Echo (ping) |
| | | | | | **echo\_reply** boolean | **Choices:*** no
* yes
| Echo reply |
| | | | | | **membership\_query** boolean | **Choices:*** no
* yes
| Membership query |
| | | | | | **membership\_reduction** boolean | **Choices:*** no
* yes
| Membership reduction |
| | | | | | **membership\_report** boolean | **Choices:*** no
* yes
| Membership report |
| | | | | | **neighbor\_advertisement** boolean | **Choices:*** no
* yes
| Neighbor advertisement |
| | | | | | **neighbor\_redirect** boolean | **Choices:*** no
* yes
| Neighbor redirect |
| | | | | | **neighbor\_solicitation** boolean | **Choices:*** no
* yes
| Neighbor\_solicitation |
| | | | | | **packet\_too\_big** boolean | **Choices:*** no
* yes
| Packet too big |
| | | | | | **parameter\_problem** boolean | **Choices:*** no
* yes
| Parameter problem |
| | | | | | **router\_advertisement** boolean | **Choices:*** no
* yes
| Router discovery advertisements |
| | | | | | **router\_renumbering** boolean | **Choices:*** no
* yes
| Router renumbering |
| | | | | | **router\_solicitation** boolean | **Choices:*** no
* yes
| Router solicitation |
| | | | | | **time\_exceeded** boolean | **Choices:*** no
* yes
| Time exceeded |
| | | | | | **unreachable** boolean | **Choices:*** no
* yes
| All unreachables |
| | | | | **igmp** boolean | **Choices:*** no
* yes
| Internet Gateway Message Protocol. |
| | | | | **igrp** boolean | **Choices:*** no
* yes
| Internet Gateway Routing Protocol. |
| | | | | **ip** boolean | **Choices:*** no
* yes
| Any Internet Protocol. |
| | | | | **ipinip** boolean | **Choices:*** no
* yes
| IP in IP tunneling. |
| | | | | **ipsec** boolean | **Choices:*** no
* yes
| IP Security. |
| | | | | **nos** boolean | **Choices:*** no
* yes
| KA9Q NOS compatible IP over IP tunneling. |
| | | | | **ospf** boolean | **Choices:*** no
* yes
| OSPF routing protocol. |
| | | | | **pcp** boolean | **Choices:*** no
* yes
| Payload Compression Protocol. |
| | | | | **pim** boolean | **Choices:*** no
* yes
| Protocol Independent Multicast. |
| | | | | **pptp** boolean | **Choices:*** no
* yes
| Point-to-Point Tunneling Protocol. |
| | | | | **protocol\_number** integer | | An IP protocol number |
| | | | | **sctp** boolean | **Choices:*** no
* yes
| Stream Control Transmission Protocol. |
| | | | | **snp** boolean | **Choices:*** no
* yes
| Simple Network Protocol. |
| | | | | **tcp** boolean | **Choices:*** no
* yes
| Match TCP packet flags |
| | | | | **udp** boolean | **Choices:*** no
* yes
| User Datagram Protocol. |
| | | | **remark** string | | Specify a comment (remark) for the access-list after this keyword |
| | | | **source** dictionary | | Specify the packet source. |
| | | | | **address** string | | Source network address. |
| | | | | **any** boolean | **Choices:*** no
* yes
| Match any source address. |
| | | | | **any4** boolean | **Choices:*** no
* yes
| Match any ipv4 source address. |
| | | | | **any6** boolean | **Choices:*** no
* yes
| Match any ipv6 source address. |
| | | | | **host** string | | A single source host |
| | | | | **interface** string | | Use interface address as source address |
| | | | | **netmask** string | | Netmask for source IP address, valid with IPV4 address. |
| | | | | **object\_group** string | | Network object-group for source address |
| | | | | **port\_protocol** dictionary | | Specify the destination port along with protocol. Note, Valid with TCP/UDP protocol\_options |
| | | | | | **eq** string | | Match only packets on a given port number. |
| | | | | | **gt** string | | Match only packets with a greater port number. |
| | | | | | **lt** string | | Match only packets with a lower port number. |
| | | | | | **neq** string | | Match only packets not on a given port number. |
| | | | | | **range** dictionary | | Port range operator |
| | | | | | | **end** integer | | Specify the end of the port range. |
| | | | | | | **start** integer | | Specify the start of the port range. |
| | | | **time\_range** string | | Specify a time-range. |
| | | **acl\_type** string | **Choices:*** extended
* standard
| ACL type |
| | | **name** string / required | | The name or the number of the ACL. |
| | | **rename** string | | Rename an existing access-list. If input to rename param is given, it'll take preference over other parameters and only rename config will be matched and computed against. |
| **running\_config** string | | The module, by default, will connect to the remote device and retrieve the current running-config to use as a base for comparing against the contents of source. There are times when it is not desirable to have the task get the current running-config for every task in a playbook. The *running\_config* argument allows the implementer to pass in the configuration to use as the base config for comparison. |
| **state** string | **Choices:*** **merged** β
* replaced
* overridden
* deleted
* gathered
* rendered
* parsed
| The state of the configuration after module completion |
Notes
-----
Note
* Tested against Cisco ASA Version 9.10(1)11
* This module works with connection `network_cli`. See [ASA Platform Options](../network/user_guide/platform_asa).
Examples
--------
```
# Using merged
# Before state:
# -------------
#
# vasa#sh access-lists
# access-list global_access; 2 elements; name hash: 0xbd6c87a7
# access-list global_access line 1 extended permit icmp any any log disable (hitcnt=0) 0xf1efa630
# access-list global_access line 2 extended deny tcp any any eq telnet (hitcnt=0) 0xae5833af
# access-list R1_traffic; 1 elements; name hash: 0xaf40d3c2
# access-list R1_traffic line 1
# extended deny tcp 2001:db8:0:3::/64 eq telnet 2001:fc8:0:4::/64 eq www
# log errors interval 300 (hitcnt=0) 0x4a4660f3
- name: Merge provided configuration with device configuration
cisco.asa.asa_acls:
config:
acls:
- name: temp_access
acl_type: extended
aces:
- grant: deny
line: 1
protocol_options:
tcp: true
source:
address: 192.0.2.0
netmask: 255.255.255.0
destination:
address: 192.0.3.0
netmask: 255.255.255.0
port_protocol:
eq: www
log: default
- grant: deny
line: 2
protocol_options:
igrp: true
source:
address: 198.51.100.0
netmask: 255.255.255.0
destination:
address: 198.51.110.0
netmask: 255.255.255.0
time_range: temp
- grant: deny
line: 3
protocol_options:
tcp: true
source:
interface: management
destination:
interface: management
port_protocol:
eq: www
log: warnings
- grant: deny
line: 4
protocol_options:
tcp: true
source:
object_group: test_og_network
destination:
object_group: test_network_og
port_protocol:
eq: www
log: default
- name: global_access
acl_type: extended
aces:
- line: 3
remark: test global access
- grant: deny
line: 4
protocol_options:
tcp: true
source:
any: true
destination:
any: true
port_protocol:
eq: www
log: errors
- name: R1_traffic
aces:
- line: 1
remark: test_v6_acls
- grant: deny
line: 2
protocol_options:
tcp: true
source:
address: 2001:db8:0:3::/64
port_protocol:
eq: www
destination:
address: 2001:fc8:0:4::/64
port_protocol:
eq: telnet
inactive: true
state: merged
# Commands fired:
# ---------------
# access-list global_access line 3 remark test global access
# access-list global_access line 4 extended deny tcp any any eq www log errors interval 300
# access-list R1_traffic line 1 remark test_v6_acls
# access-list R1_traffic line 2 extended deny tcp 2001:db8:0:3::/64 eq www 2001:fc8:0:4::/64 eq telnet inactive
# access-list temp_access line 1 extended deny tcp 192.0.2.0 255.255.255.0 192.0.3.0 255.255.255.0 eq www log default
# access-list temp_access line 2 extended deny igrp 198.51.100.0 255.255.255.0 198.51.110.0 255.255.255.0
# time-range temp inactive
# access-list temp_access line 2 extended deny tcp interface management interface management
# eq www log warnings
# access-list test_access line 3 extended deny tcp object-group test_og_network object-group test_network_og
# eq www log default
# After state:
# ------------
#
# vasa#sh access-lists
# access-list global_access; 3 elements; name hash: 0xbd6c87a7
# access-list global_access line 1 extended permit icmp any any log disable (hitcnt=0) 0xf1efa630
# access-list global_access line 2 extended deny tcp any any eq telnet (hitcnt=0) 0xae5833af
# access-list global_access line 3 remark test global access (hitcnt=0) 0xae78337e
# access-list global_access line 4 extended deny tcp any any eq www log errors interval 300 (hitcnt=0) 0x605f2421
# access-list R1_traffic; 2 elements; name hash: 0xaf40d3c2
# access-list R1_traffic line 1 remark test_v6_acls
# access-list R1_traffic line 2
# extended deny tcp 2001:db8:0:3::/64 eq www 2001:fc8:0:4::/64 eq telnet
# inactive (hitcnt=0) (inactive) 0xe922b432
# access-list temp_access; 2 elements; name hash: 0xaf1b712e
# access-list temp_access line 1
# extended deny tcp 192.0.2.0 255.255.255.0 192.0.3.0 255.255.255.0 eq www
# log default (hitcnt=0) 0xb58abb0d
# access-list temp_access line 2
# extended deny igrp 198.51.100.0 255.255.255.0 198.51.110.0 255.255.255.0
# time-range temp (hitcnt=0) (inactive) 0xcd6b92ae
# access-list test_access line 3
# extended deny tcp interface management interface management eq www log warnings
# interval 300 (hitcnt=0) 0x78aa233d
# access-list test_access line 2 extended deny tcp object-group test_og_network object-group test_network_og
# eq www log default (hitcnt=0) 0x477aec1e
# access-list test_access line 2 extended deny tcp 192.0.2.0 255.255.255.0 host 192.0.3.1 eq www
# log default (hitcnt=0) 0xdc7edff8
# access-list test_access line 2 extended deny tcp 192.0.2.0 255.255.255.0 host 192.0.3.2 eq www
# log default (hitcnt=0) 0x7b0e9fde
# access-list test_access line 2 extended deny tcp 198.51.100.0 255.255.255.0 2001:db8:3::/64 eq www
# log default (hitcnt=0) 0x97c75adc
# Using Merged to Rename ACLs
# Before state:
# -------------
#
# vasa#sh access-lists
# access-list global_access; 2 elements; name hash: 0xbd6c87a7
# access-list global_access line 1 extended permit icmp any any log disable (hitcnt=0) 0xf1efa630
# access-list global_access line 2 extended deny tcp any any eq telnet (hitcnt=0) 0xae5833af
# access-list R1_traffic; 1 elements; name hash: 0xaf40d3c2
# access-list R1_traffic line 1
# extended deny tcp 2001:db8:0:3::/64 eq telnet 2001:fc8:0:4::/64 eq www
# log errors interval 300 (hitcnt=0) 0x4a4660f3
- name: Rename ACL with different name using Merged state
cisco.asa.asa_acls:
config:
acls:
- name: global_access
rename: global_access_renamed
- name: R1_traffic
rename: R1_traffic_renamed
state: merged
# Commands fired:
# ---------------
# access-list global_access rename global_access_renamed
# access-list R1_traffic rename R1_traffic_renamed
# After state:
# -------------
#
# vasa#sh access-lists
# access-list global_access_renamed; 2 elements; name hash: 0xbd6c87a7
# access-list global_access_renamed line 1 extended permit icmp any any log disable (hitcnt=0) 0xf1efa630
# access-list global_access_renamed line 2 extended deny tcp any any eq telnet (hitcnt=0) 0xae5833af
# access-list R1_traffic_renamed; 1 elements; name hash: 0xaf40d3c2
# access-list R1_traffic_renamed line 1
# extended deny tcp 2001:db8:0:3::/64 eq telnet 2001:fc8:0:4::/64 eq www
# log errors interval 300 (hitcnt=0) 0x4a4660f3
# Using replaced
# Before state:
# -------------
#
# vasa#sh access-lists
# access-list global_access; 3 elements; name hash: 0xbd6c87a7
# access-list global_access line 1 extended permit icmp any any log disable (hitcnt=0) 0xf1efa630
# access-list global_access line 2 extended deny tcp any any eq telnet (hitcnt=0) 0xae5833af
# access-list global_access line 3 extended deny tcp any any eq www log errors interval 300 (hitcnt=0) 0x605f2421
# access-list R1_traffic; 2 elements; name hash: 0xaf40d3c2
# access-list R1_traffic line 1
# extended deny tcp 2001:db8:0:3::/64 eq telnet 2001:fc8:0:4::/64 eq www
# log errors interval 300 (hitcnt=0) 0x4a4660f3
# access-list R1_traffic line 2
# extended deny tcp 2001:db8:0:3::/64 eq www 2001:fc8:0:4::/64 eq telnet
# inactive (hitcnt=0) (inactive) 0xe922b432
# access-list temp_access; 2 elements; name hash: 0xaf1b712e
# access-list temp_access line 1
# extended deny tcp 192.0.2.0 255.255.255.0 192.0.3.0 255.255.255.0 eq www
# log default (hitcnt=0) 0xb58abb0d
# access-list temp_access line 2
# extended deny igrp 198.51.100.0 255.255.255.0 198.51.110.0 255.255.255.0
# time-range temp (hitcnt=0) (inactive) 0xcd6b92ae
- name: Replaces device configuration of listed acl with provided configuration
cisco.asa.asa_acls:
config:
acls:
- name: global_access
acl_type: extended
aces:
- grant: deny
line: 1
protocol_options:
tcp: true
source:
address: 192.0.4.0
netmask: 255.255.255.0
port_protocol:
eq: telnet
destination:
address: 192.0.5.0
netmask: 255.255.255.0
port_protocol:
eq: www
state: replaced
# Commands fired:
# ---------------
# no access-list global_access line 3 extended deny tcp any any eq www log errors interval 300
# no access-list global_access line 2 extended deny tcp any any eq telnet
# no access-list global_access line 1 extended permit icmp any any log disable
# access-list global_access line 1 extended deny tcp 192.0.4.0 255.255.255.0 eq telnet 192.0.5.0 255.255.255.0 eq www
# After state:
# -------------
#
# vasa#sh access-lists
# access-list global_access; 1 elements; name hash: 0xbd6c87a7
# access-list global_access line 1 extended deny tcp 192.0.4.0 255.255.255.0 eq telnet
# 192.0.5.0 255.255.255.0 eq www (hitcnt=0) 0x3e5b2757
# access-list R1_traffic; 2 elements; name hash: 0xaf40d3c2
# access-list R1_traffic line 1
# extended deny tcp 2001:db8:0:3::/64 eq telnet 2001:fc8:0:4::/64 eq www
# log errors interval 300 (hitcnt=0) 0x4a4660f3
# access-list R1_traffic line 2
# extended deny tcp 2001:db8:0:3::/64 eq www 2001:fc8:0:4::/64 eq telnet
# inactive (hitcnt=0) (inactive) 0xe922b432
# access-list temp_access; 2 elements; name hash: 0xaf1b712e
# access-list temp_access line 1
# extended deny tcp 192.0.2.0 255.255.255.0 192.0.3.0 255.255.255.0 eq www
# log default (hitcnt=0) 0xb58abb0d
# access-list temp_access line 2
# extended deny igrp 198.51.100.0 255.255.255.0 198.51.110.0 255.255.255.0
# time-range temp (hitcnt=0) (inactive) 0xcd6b92ae
# Using overridden
# Before state:
# -------------
#
# vasa#sh access-lists
# access-list global_access; 3 elements; name hash: 0xbd6c87a7
# access-list global_access line 1 extended permit icmp any any log disable (hitcnt=0) 0xf1efa630
# access-list global_access line 2 extended deny tcp any any eq telnet (hitcnt=0) 0xae5833af
# access-list global_access line 3 extended deny tcp any any eq www log errors interval 300 (hitcnt=0) 0x605f2421
# access-list R1_traffic; 2 elements; name hash: 0xaf40d3c2
# access-list R1_traffic line 1
# extended deny tcp 2001:db8:0:3::/64 eq telnet 2001:fc8:0:4::/64 eq www
# log errors interval 300 (hitcnt=0) 0x4a4660f3
# access-list R1_traffic line 2
# extended deny tcp 2001:db8:0:3::/64 eq www 2001:fc8:0:4::/64 eq telnet
# inactive (hitcnt=0) (inactive) 0xe922b432
# access-list temp_access; 2 elements; name hash: 0xaf1b712e
# access-list temp_access line 1
# extended deny tcp 192.0.2.0 255.255.255.0 192.0.3.0 255.255.255.0 eq www
# log default (hitcnt=0) 0xb58abb0d
# access-list temp_access line 2
# extended deny igrp 198.51.100.0 255.255.255.0 198.51.110.0 255.255.255.0
# time-range temp (hitcnt=0) (inactive) 0xcd6b92ae
- name: Override device configuration of all acl with provided configuration
cisco.asa.asa_acls:
config:
acls:
- name: global_access
acl_type: extended
aces:
- grant: deny
line: 1
protocol_options:
tcp: true
source:
address: 192.0.4.0
netmask: 255.255.255.0
port_protocol:
eq: telnet
destination:
address: 192.0.5.0
netmask: 255.255.255.0
port_protocol:
eq: www
state: overridden
# Commands fired:
# ---------------
# access-list temp_access line 2
# extended deny igrp 198.51.100.0 255.255.255.0 198.51.110.0 255.255.255.0 time-range temp
# no access-list temp_access line 1
# extended grant deny tcp 192.0.2.0 255.255.255.0 192.0.3.0 255.255.255.0 eq www log default
# no access-list R1_traffic line 2
# extended grant deny tcp 2001:db8:0:3::/64 eq www 2001:fc8:0:4::/64 eq telnet inactive
# no access-list R1_traffic line 1
# extended grant deny tcp 2001:db8:0:3::/64 eq telnet 2001:fc8:0:4::/64 eq www log errors
# no access-list global_access line 3 extended grant deny tcp any any eq www log errors
# no access-list global_access line 2 extended grant deny tcp any any eq telnet
# no access-list global_access line 1 extended grant permit icmp any any log disable
# access-list global_access line 4 extended deny tcp 192.0.4.0 255.255.255.0 eq telnet 192.0.5.0 255.255.255.0 eq www
# After state:
# -------------
#
# vasa#sh access-lists
# access-list global_access; 1 elements; name hash: 0xbd6c87a7
# access-list global_access line 1 extended permit icmp any any log disable (hitcnt=0) 0xf1efa630
# Using Deleted
# Before state:
# -------------
#
# vasa#sh access-lists
# access-list global_access; 3 elements; name hash: 0xbd6c87a7
# access-list global_access line 1 extended permit icmp any any log disable (hitcnt=0) 0xf1efa630
# access-list global_access line 2 extended deny tcp any any eq telnet (hitcnt=0) 0xae5833af
# access-list global_access line 3 extended deny tcp any any eq www log errors interval 300 (hitcnt=0) 0x605f2421
# access-list R1_traffic; 2 elements; name hash: 0xaf40d3c2
# access-list R1_traffic line 1
# extended deny tcp 2001:db8:0:3::/64 eq telnet 2001:fc8:0:4::/64 eq www
# log errors interval 300 (hitcnt=0) 0x4a4660f3
# access-list R1_traffic line 2
# extended deny tcp 2001:db8:0:3::/64 eq www 2001:fc8:0:4::/64 eq telnet
# inactive (hitcnt=0) (inactive) 0xe922b432
# access-list temp_access; 2 elements; name hash: 0xaf1b712e
# access-list temp_access line 1
# extended deny tcp 192.0.2.0 255.255.255.0 192.0.3.0 255.255.255.0 eq www
# log default (hitcnt=0) 0xb58abb0d
# access-list temp_access line 2
# extended deny igrp 198.51.100.0 255.255.255.0 198.51.110.0 255.255.255.0
# time-range temp (hitcnt=0) (inactive) 0xcd6b92ae
- name: "Delete module attributes of given acl (Note: This won't delete ALL of the ACLs configured)"
cisco.asa.asa_acls:
config:
acls:
- name: temp_access
- name: global_access
state: deleted
# Commands fired:
# ---------------
# no access-list temp_access line 2 extended deny igrp 198.51.100.0 255.255.255.0 198.51.110.0 255.255.255.0
# time-range temp inactive
# no access-list temp_access line 1 extended deny tcp 192.0.2.0 255.255.255.0 192.0.3.0 255.255.255.0 eq www
# log default
# no access-list global_access line 3 extended deny tcp any any eq www log errors interval 300
# no access-list global_access line 2 extended deny tcp any any eq telnet
# no access-list global_access line 1 extended permit icmp any any log disable
# After state:
# -------------
#
# vasa#sh access-lists
# access-list R1_traffic; 2 elements; name hash: 0xaf40d3c2
# access-list R1_traffic line 1
# extended deny tcp 2001:db8:0:3::/64 eq telnet 2001:fc8:0:4::/64 eq www
# log errors interval 300 (hitcnt=0) 0x4a4660f3
# access-list R1_traffic line 2
# extended deny tcp 2001:db8:0:3::/64 eq www 2001:fc8:0:4::/64 eq telnet
# inactive (hitcnt=0) (inactive) 0xe922b432
# Using Deleted without any config passed
#"(NOTE: This will delete all of configured resource module attributes)"
# Before state:
# -------------
#
# vasa#sh access-lists
# access-list global_access; 3 elements; name hash: 0xbd6c87a7
# access-list global_access line 1 extended permit icmp any any log disable (hitcnt=0) 0xf1efa630
# access-list global_access line 2 extended deny tcp any any eq telnet (hitcnt=0) 0xae5833af
# access-list global_access line 3 extended deny tcp any any eq www log errors interval 300 (hitcnt=0) 0x605f2421
# access-list R1_traffic; 2 elements; name hash: 0xaf40d3c2
# access-list R1_traffic line 1
# extended deny tcp 2001:db8:0:3::/64 eq telnet 2001:fc8:0:4::/64 eq www
# log errors interval 300 (hitcnt=0) 0x4a4660f3
# access-list R1_traffic line 2
# extended deny tcp 2001:db8:0:3::/64 eq www 2001:fc8:0:4::/64 eq telnet
# inactive (hitcnt=0) (inactive) 0xe922b432
# access-list temp_access; 2 elements; name hash: 0xaf1b712e
# access-list temp_access line 1
# extended deny tcp 192.0.2.0 255.255.255.0 192.0.3.0 255.255.255.0 eq www
# log default (hitcnt=0) 0xb58abb0d
# access-list temp_access line 2
# extended deny igrp 198.51.100.0 255.255.255.0 198.51.110.0 255.255.255.0
# time-range temp (hitcnt=0) (inactive) 0xcd6b92ae
- name: 'Delete ALL ACLs in one go (Note: This WILL delete the ALL of configured ACLs)'
cisco.asa.asa_acls:
state: deleted
# Commands fired:
# ---------------
# no access-list global_access line 1 extended permit icmp any any log disable
# no access-list global_access line 2 extended deny tcp any any eq telnet
# no access-list global_access line 3 extended deny tcp any any eq www log errors interval 300
# no access-list R1_traffic line 1 extended deny tcp 2001:db8:0:3::/64 eq telnet 2001:fc8:0:4::/64 eq www
# log errors interval 300
# no access-list R1_traffic line 2 extended deny tcp 2001:db8:0:3::/64 eq www 2001:fc8:0:4::/64 eq telnet inactive
# no access-list temp_access line 1 extended deny tcp 192.0.2.0 255.255.255.0 192.0.3.0 255.255.255.0 eq www log default
# no access-list temp_access line 2 extended deny igrp 198.51.100.0 255.255.255.0 198.51.110.0 255.255.255.0
# time-range temp inactive
# After state:
# -------------
#
# vasa#sh access-lists
# Using Gathered
# Before state:
# -------------
#
# access-list global_access; 3 elements; name hash: 0xbd6c87a7
# access-list global_access line 1 extended permit icmp any any log disable (hitcnt=0) 0xf1efa630
# access-list global_access line 2 extended deny tcp any any eq telnet (hitcnt=0) 0xae5833af
# access-list R1_traffic; 2 elements; name hash: 0xaf40d3c2
# access-list R1_traffic line 1
# extended deny tcp 2001:db8:0:3::/64 eq telnet 2001:fc8:0:4::/64 eq www
# log errors interval 300 (hitcnt=0) 0x4a4660f3
# access-list R1_traffic line 2
# extended deny tcp 2001:db8:0:3::/64 eq www 2001:fc8:0:4::/64 eq telnet
# inactive (hitcnt=0) (inactive) 0xe922b432
# access-list temp_access; 2 elements; name hash: 0xaf1b712e
# access-list temp_access line 1
# extended deny tcp 192.0.2.0 255.255.255.0 192.0.3.0 255.255.255.0 eq www
# log default (hitcnt=0) 0xb58abb0d
# access-list temp_access line 2
# extended deny igrp 198.51.100.0 255.255.255.0 198.51.110.0 255.255.255.0
# time-range temp (hitcnt=0) (inactive) 0xcd6b92ae
- name: Gather listed ACLs with provided configurations
cisco.asa.asa_acls:
config:
state: gathered
# Module Execution Result:
# ------------------------
#
# "gathered": [
# {
# "acls": [
# {
# "aces": [
# {
# "destination": {
# "any": true
# },
# "grant": "permit",
# "line": 1,
# "log": "disable",
# "protocol": "icmp",
# "source": {
# "any": true
# }
# },
# {
# "destination": {
# "any": true,
# "port_protocol": {
# "eq": "telnet"
# }
# },
# "grant": "deny",
# "line": 2,
# "protocol": "tcp",
# "protocol_options": {
# "tcp": true
# },
# "source": {
# "any": true
# }
# }
# ],
# "acl_type": "extended",
# "name": "global_access"
# },
# {
# "aces": [
# {
# "destination": {
# "address": "2001:fc8:0:4::/64",
# "port_protocol": {
# "eq": "www"
# }
# },
# "grant": "deny",
# "line": 1,
# "log": "errors",
# "protocol": "tcp",
# "protocol_options": {
# "tcp": true
# },
# "source": {
# "address": "2001:db8:0:3::/64",
# "port_protocol": {
# "eq": "telnet"
# }
# }
# },
# {
# "destination": {
# "address": "2001:fc8:0:4::/64",
# "port_protocol": {
# "eq": "telnet"
# }
# },
# "grant": "deny",
# "inactive": true,
# "line": 2,
# "protocol": "tcp",
# "protocol_options": {
# "tcp": true
# },
# "source": {
# "address": "2001:db8:0:3::/64",
# "port_protocol": {
# "eq": "www"
# }
# }
# }
# ],
# "acl_type": "extended",
# "name": "R1_traffic"
# },
# {
# "aces": [
# {
# "destination": {
# "address": "192.0.3.0",
# "netmask": "255.255.255.0",
# "port_protocol": {
# "eq": "www"
# }
# },
# "grant": "deny",
# "line": 1,
# "log": "default",
# "protocol": "tcp",
# "protocol_options": {
# "tcp": true
# },
# "source": {
# "address": "192.0.2.0",
# "netmask": "255.255.255.0"
# }
# },
# {
# "destination": {
# "address": "198.51.110.0",
# "netmask": "255.255.255.0"
# },
# "grant": "deny",
# "inactive": true,
# "line": 2,
# "protocol": "igrp",
# "protocol_options": {
# "igrp": true
# },
# "source": {
# "address": "198.51.100.0",
# "netmask": "255.255.255.0"
# },
# "time_range": "temp"
# }
# ],
# "acl_type": "extended",
# "name": "temp_access"
# }
# ]
# }
# ]
# Using Rendered
- name: Rendered the provided configuration with the exisiting running configuration
cisco.asa.asa_acls:
config:
acls:
- name: temp_access
acl_type: extended
aces:
- grant: deny
line: 1
protocol_options:
tcp: true
source:
address: 192.0.2.0
netmask: 255.255.255.0
destination:
address: 192.0.3.0
netmask: 255.255.255.0
port_protocol:
eq: www
log: default
- grant: deny
line: 2
protocol_options:
igrp: true
source:
address: 198.51.100.0
netmask: 255.255.255.0
destination:
address: 198.51.110.0
netmask: 255.255.255.0
time_range: temp
- name: R1_traffic
aces:
- grant: deny
protocol_options:
tcp: true
source:
address: 2001:db8:0:3::/64
port_protocol:
eq: www
destination:
address: 2001:fc8:0:4::/64
port_protocol:
eq: telnet
inactive: true
state: rendered
# Module Execution Result:
# ------------------------
#
# "rendered": [
# "access-list temp_access line 1
# extended deny tcp 192.0.2.0 255.255.255.0 192.0.3.0 255.255.255.0
# eq www log default"
# "access-list temp_access line 2
# extended deny igrp 198.51.100.0 255.255.255.0 198.51.110.0 255.255.255.0
# time-range temp"
# "access-list R1_traffic
# deny tcp 2001:db8:0:3::/64 eq www 2001:fc8:0:4::/64 eq telnet inactive"
# ]
# Using Parsed
# parsed.cfg
#
# access-list test_access; 2 elements; name hash: 0xaf1b712e
# access-list test_access line 1 extended deny tcp 192.0.2.0 255.255.255.0 192.0.3.0 255.255.255.0 eq www log default
# access-list test_access line 2 extended deny igrp 198.51.100.0 255.255.255.0 198.51.110.0 255.255.255.0 log errors
# access-list test_R1_traffic; 1 elements; name hash: 0xaf40d3c2
# access-list test_R1_traffic line 1 extended deny tcp 2001:db8:0:3::/64 eq www 2001:fc8:0:4::/64 eq telnet inactive
- name: Parse the commands for provided configuration
cisco.asa.asa_acls:
running_config: "{{ lookup('file', 'parsed.cfg') }}"
state: parsed
# Module Execution Result:
# ------------------------
#
# "parsed": [
# {
# "acls": [
# {
# "aces": [
# {
# "destination": {
# "address": "192.0.3.0",
# "netmask": "255.255.255.0",
# "port_protocol": {
# "eq": "www"
# }
# },
# "grant": "deny",
# "line": 1,
# "log": "default",
# "protocol": "tcp",
# "protocol_options": {
# "tcp": true
# },
# "source": {
# "address": "192.0.2.0",
# "netmask": "255.255.255.0"
# }
# },
# {
# "destination": {
# "address": "198.51.110.0",
# "netmask": "255.255.255.0"
# },
# "grant": "deny",
# "line": 2,
# "log": "errors",
# "protocol": "igrp",
# "protocol_options": {
# "igrp": true
# },
# "source": {
# "address": "198.51.100.0",
# "netmask": "255.255.255.0"
# }
# }
# ],
# "acl_type": "extended",
# "name": "test_access"
# },
# {
# "aces": [
# {
# "destination": {
# "address": "2001:fc8:0:4::/64",
# "port_protocol": {
# "eq": "telnet"
# }
# },
# "grant": "deny",
# "inactive": true,
# "line": 1,
# "protocol": "tcp",
# "protocol_options": {
# "tcp": true
# },
# "source": {
# "address": "2001:db8:0:3::/64",
# "port_protocol": {
# "eq": "www"
# }
# }
# }
# ],
# "acl_type": "extended",
# "name": "test_R1_TRAFFIC"
# }
# ]
# }
# ]
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | always | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | always | The set of commands pushed to the remote device **Sample:** ['access-list global\_access line 1 extended permit icmp any any log disable'] |
### Authors
* Sumit Jaiswal (@justjais)
| programming_docs |
ansible cisco.ucs.ucs_vnic_template β Configures vNIC templates on Cisco UCS Manager cisco.ucs.ucs\_vnic\_template β Configures vNIC templates on Cisco UCS Manager
==============================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_vnic_template`.
New in version 2.5: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures vNIC templates on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **cdn\_name** string | | CDN Name used when cdn\_source is set to user-defined. |
| **cdn\_source** string | **Choices:*** **vnic-name** β
* user-defined
| CDN Source field. This can be one of the following options: vnic-name - Uses the vNIC template name of the vNIC instance as the CDN name. This is the default option. user-defined - Uses a user-defined CDN name for the vNIC template. If this option is chosen, cdn\_name must also be provided. |
| **description** string | | A user-defined description of the vNIC template. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **fabric** string | **Choices:*** **A** β
* B
* A-B
* B-A
| The Fabric ID field specifying the fabric interconnect associated with vNICs created from this template. If you want fabric failover enabled on vNICs created from this template, use of of the following:" A-B to use Fabric A by default with failover enabled. B-A to use Fabric B by default with failover enabled. Do not enable vNIC fabric failover under the following circumstances: - If the Cisco UCS domain is running in Ethernet switch mode. vNIC fabric failover is not supported in that mode. - If you plan to associate one or more vNICs created from this template to a server with an adapter that does not support fabric failover. |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **mac\_pool** string | | The MAC address pool that vNICs created from this vNIC template should use. |
| **mtu** string | **Default:**"1500" | The MTU field. The maximum transmission unit, or packet size, that vNICs created from this vNIC template should use. Enter a string between '1500' and '9000'. If the vNIC template has an associated QoS policy, the MTU specified here must be equal to or less than the MTU specified in the QoS system class. |
| **name** string / required | | The name of the vNIC template. This name can be between 1 and 16 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). You cannot change this name after the template is created. |
| **network\_control\_policy** string | | The network control policy that vNICs created from this vNIC template should use. |
| **org\_dn** string | **Default:**"org-root" | Org dn (distinguished name) |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **peer\_redundancy\_template** string | | The Peer Redundancy Template. The name of the vNIC template sharing a configuration with this template. If the redundancy\_type is primary, the name of the secondary template should be provided. If the redundancy\_type is secondary, the name of the primary template should be provided. Secondary templates can only configure non-shared properties (name, description, and mac\_pool).
aliases: peer\_redundancy\_templ |
| **pin\_group** string | | The LAN pin group that vNICs created from this vNIC template should use. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **qos\_policy** string | | The quality of service (QoS) policy that vNICs created from this vNIC template should use. |
| **redundancy\_type** string | **Choices:*** **none** β
* primary
* secondary
| The Redundancy Type used for vNIC redundancy pairs during fabric failover. This can be one of the following: primary β Creates configurations that can be shared with the Secondary template. secondary β All shared configurations are inherited from the Primary template. none - Legacy vNIC template behavior. Select this option if you do not want to use redundancy. |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify vNIC templates are present and will create if needed. If `absent`, will verify vNIC templates are absent and will delete if needed. |
| **stats\_policy** string | **Default:**"default" | The statistics collection policy that vNICs created from this vNIC template should use. |
| **target** string | **Default:**"adapter" | The possible target for vNICs created from this template. The target determines whether or not Cisco UCS Manager automatically creates a VM-FEX port profile with the appropriate settings for the vNIC template. This can be one of the following: adapter β The vNICs apply to all adapters. No VM-FEX port profile is created if you choose this option. vm - The vNICs apply to all virtual machines. A VM-FEX port profile is created if you choose this option. |
| **template\_type** string | **Choices:*** **initial-template** β
* updating-template
| The Template Type field. This can be one of the following: initial-template β vNICs created from this template are not updated if the template changes. updating-template - vNICs created from this template are updated if the template changes. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
| **vlans\_list** string | | List of VLANs used by the vNIC template. Each list element has the following suboptions: = name The name of the VLAN (required). - native Designates the VLAN as a native VLAN. Only one VLAN in the list can be a native VLAN. [choices: 'no', 'yes'] [Default: 'no'] - state If present, will verify VLAN is present on template. If absent, will verify VLAN is absent on template. choices: [present, absent] default: present |
Examples
--------
```
- name: Configure vNIC template
cisco.ucs.ucs_vnic_template:
hostname: 172.16.143.150
username: admin
password: password
name: vNIC-A
fabric: A
vlans_list:
- name: default
native: 'yes'
- name: Configure vNIC template with failover
cisco.ucs.ucs_vnic_template:
hostname: 172.16.143.150
username: admin
password: password
name: vNIC-A-B
fabric: A-B
vlans_list:
- name: default
native: 'yes'
state: present
- name: Remove vNIC template
cisco.ucs.ucs_vnic_template:
hostname: 172.16.143.150
username: admin
password: password
name: vNIC-A
state: absent
- name: Remove another vNIC template
cisco.ucs.ucs_vnic_template:
hostname: 172.16.143.150
username: admin
password: password
name: vNIC-A-B
state: absent
- name: Remove VLAN from template
cisco.ucs.ucs_vnic_template:
hostname: 172.16.143.150
username: admin
password: password
name: vNIC-A-B
fabric: A-B
vlans_list:
- name: default
native: 'yes'
state: absent
```
### Authors
* David Soper (@dsoper2)
* John McDonough (@movinalot)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_vlan_find β Find VLANs on Cisco UCS Manager cisco.ucs.ucs\_vlan\_find β Find VLANs on Cisco UCS Manager
===========================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_vlan_find`.
New in version 2.9: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Find VLANs on Cisco UCS Manager based on different criteria.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **fabric** string | **Choices:*** **common** β
* A
* B
| The fabric configuration of the VLAN. This can be one of the following: common - The VLAN applies to both fabrics and uses the same configuration parameters in both cases. A β The VLAN only applies to fabric A. B β The VLAN only applies to fabric B. |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **pattern** string | | Regex pattern to find within the name property of the fabricVlan class. This is required if `vlanid` parameter is not supplied. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
| **vlanid** string | | The unique string identifier assigned to the VLAN. A VLAN ID can be between '1' and '3967', or between '4048' and '4093'. This is required if `pattern` parameter is not supplied. |
Examples
--------
```
- name: Get all vlans in fabric A
cisco.ucs.ucs_vlan_find:
hostname: 172.16.143.150
username: admin
password: password
fabric: 'A'
pattern: '.'
- name: Confirm if vlan 15 is present
cisco.ucs.ucs_vlan_find:
hostname: 172.16.143.150
username: admin
password: password
vlanid: '15'
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **vlan\_list** list / elements=string | on success | basic details of vlans found **Sample:** [{'id': '0', 'name': 'vlcloud1'}] |
### Authors
* David Martinez (@dx0xm)
* David Soper (@dsoper2)
* John McDonough (@movinalot)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_org β Manages UCS Organizations for UCS Manager cisco.ucs.ucs\_org β Manages UCS Organizations for UCS Manager
==============================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_org`.
New in version 2.8: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Manages UCS Organizations for UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **delegate\_to** string | **Default:**"localhost" | Where the module will be run |
| **description** string | | A user-defined description of the organization. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **org\_name** string | | The name of the organization. Enter up to 16 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: name |
| **parent\_org\_path** string | **Default:**"root" | A forward slash / separated hierarchical path from the root organization to the parent of the organization to be added or updated. UCS Manager supports a hierarchical structure of organizations up to five levels deep not including the root organization. For example the parent\_org\_path for an organization named level5 could be root/level1/level2/level3/level4 |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** absent
* **present** β
| If `absent`, will remove organization. If `present`, will create or update organization. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Add UCS Organization
cisco.ucs.ucs_org:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
org_name: test
description: testing org
state: present
delegate_to: localhost
- name: Update UCS Organization
cisco.ucs.ucs_org:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
org_name: test
description: Testing org
state: present
delegate_to: localhost
- name: Add UCS Organization
cisco.ucs.ucs_org:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
org_name: level1
parent_org_path: root
description: level1 org
state: present
delegate_to: localhost
- name: Add UCS Organization
cisco.ucs.ucs_org:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
org_name: level2
parent_org_path: root/level1
description: level2 org
state: present
- name: Add UCS Organization
cisco.ucs.ucs_org:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
org_name: level3
parent_org_path: root/level1/level2
description: level3 org
state: present
- name: Remove UCS Organization
cisco.ucs.ucs_org:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
org_name: level2
parent_org_path: root/level1
state: absent
```
### Authors
* David Soper (@dsoper2)
* John McDonough (@movinalot)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_ip_pool β Configures IP address pools on Cisco UCS Manager cisco.ucs.ucs\_ip\_pool β Configures IP address pools on Cisco UCS Manager
==========================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_ip_pool`.
New in version 2.5: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures IP address pools and blocks of IP addresses on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **description** string | | The user-defined description of the IP address pool. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **ip\_blocks** string | | List of IPv4 blocks used by the IP Pool. |
| | **default\_gw** string | **Default:**"0.0.0.0" | The default gateway associated with the IPv4 addresses in the block. |
| | **first\_addr** string | | The first IPv4 address in the IPv4 addresses block. This is the From field in the UCS Manager Add IPv4 Blocks menu. |
| | **last\_addr** string | | The last IPv4 address in the IPv4 addresses block. This is the To field in the UCS Manager Add IPv4 Blocks menu. |
| | **primary\_dns** string | **Default:**"0.0.0.0" | The primary DNS server that this block of IPv4 addresses should access. |
| | **secondary\_dns** string | **Default:**"0.0.0.0" | The secondary DNS server that this block of IPv4 addresses should access. |
| | **subnet\_mask** string | **Default:**"255.255.255.0" | The subnet mask associated with the IPv4 addresses in the block. |
| **ipv6\_blocks** string | | List of IPv6 blocks used by the IP Pool. |
| | **ipv6\_default\_gw** string | **Default:**"::" | The default gateway associated with the IPv6 addresses in the block. |
| | **ipv6\_first\_addr** string | | The first IPv6 address in the IPv6 addresses block. This is the From field in the UCS Manager Add IPv6 Blocks menu. |
| | **ipv6\_last\_addr** string | | The last IPv6 address in the IPv6 addresses block. This is the To field in the UCS Manager Add IPv6 Blocks menu. |
| | **ipv6\_prefix** string | **Default:**"64" | The network address prefix associated with the IPv6 addresses in the block. |
| | **ipv6\_primary\_dns** string | **Default:**"::" | The primary DNS server that this block of IPv6 addresses should access. |
| | **ipv6\_secondary\_dns** string | **Default:**"::" | The secondary DNS server that this block of IPv6 addresses should access. |
| **name** string / required | | The name of the IP address pool. This name can be between 1 and 32 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). You cannot change this name after the IP address pool is created. |
| **order** string | **Choices:*** **default** β
* sequential
| The Assignment Order field. This can be one of the following: default - Cisco UCS Manager selects a random identity from the pool. sequential - Cisco UCS Manager selects the lowest available identity from the pool. |
| **org\_dn** string | **Default:**"org-root" | Org dn (distinguished name) |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify IP pool is present and will create if needed. If `absent`, will verify IP pool is absent and will delete if needed. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Configure IPv4 and IPv6 address pool
cisco.ucs.ucs_ip_pool:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
name: ip-pool-01
org_dn: org-root/org-level1
ipv4_blocks:
- first_addr: 192.168.10.1
last_addr: 192.168.10.20
subnet_mask: 255.255.255.128
default_gw: 192.168.10.2
- first_addr: 192.168.11.1
last_addr: 192.168.11.20
subnet_mask: 255.255.255.128
default_gw: 192.168.11.2
ipv6_blocks:
- ipv6_first_addr: fe80::1cae:7992:d7a1:ed07
ipv6_last_addr: fe80::1cae:7992:d7a1:edfe
ipv6_default_gw: fe80::1cae:7992:d7a1:ecff
- ipv6_first_addr: fe80::1cae:7992:d7a1:ec07
ipv6_last_addr: fe80::1cae:7992:d7a1:ecfe
ipv6_default_gw: fe80::1cae:7992:d7a1:ecff
- name: Delete IPv4 and IPv6 address pool blocks
cisco.ucs.ucs_ip_pool:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
name: ip-pool-01
org_dn: org-root/org-level1
ipv4_blocks:
- first_addr: 192.168.10.1
last_addr: 192.168.10.20
state: absent
ipv6_blocks:
- ipv6_first_addr: fe80::1cae:7992:d7a1:ec07
ipv6_last_addr: fe80::1cae:7992:d7a1:ecfe
state: absent
- name: Remove IPv4 and IPv6 address pool
cisco.ucs.ucs_ip_pool:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
name: ip-pool-01
state: absent
```
### Authors
* Brett Johnson (@sdbrett)
* David Soper (@dsoper2)
* John McDonough (@movinalot)
* CiscoUcs (@CiscoUcs)
| programming_docs |
ansible Cisco.Ucs Cisco.Ucs
=========
Collection version 1.6.0
Plugin Index
------------
These are the plugins in the cisco.ucs collection
### Modules
* [ucs\_disk\_group\_policy](ucs_disk_group_policy_module#ansible-collections-cisco-ucs-ucs-disk-group-policy-module) β Configures disk group policies on Cisco UCS Manager
* [ucs\_dns\_server](ucs_dns_server_module#ansible-collections-cisco-ucs-ucs-dns-server-module) β Configure DNS servers on Cisco UCS Manager
* [ucs\_graphics\_card\_policy](ucs_graphics_card_policy_module#ansible-collections-cisco-ucs-ucs-graphics-card-policy-module) β Manages UCS Graphics Card Policies on UCS Manager
* [ucs\_ip\_pool](ucs_ip_pool_module#ansible-collections-cisco-ucs-ucs-ip-pool-module) β Configures IP address pools on Cisco UCS Manager
* [ucs\_lan\_connectivity](ucs_lan_connectivity_module#ansible-collections-cisco-ucs-ucs-lan-connectivity-module) β Configures LAN Connectivity Policies on Cisco UCS Manager
* [ucs\_mac\_pool](ucs_mac_pool_module#ansible-collections-cisco-ucs-ucs-mac-pool-module) β Configures MAC address pools on Cisco UCS Manager
* [ucs\_managed\_objects](ucs_managed_objects_module#ansible-collections-cisco-ucs-ucs-managed-objects-module) β Configures Managed Objects on Cisco UCS Manager
* [ucs\_ntp\_server](ucs_ntp_server_module#ansible-collections-cisco-ucs-ucs-ntp-server-module) β Configures NTP server on Cisco UCS Manager
* [ucs\_org](ucs_org_module#ansible-collections-cisco-ucs-ucs-org-module) β Manages UCS Organizations for UCS Manager
* [ucs\_query](ucs_query_module#ansible-collections-cisco-ucs-ucs-query-module) β Queries UCS Manager objects by class or distinguished name
* [ucs\_san\_connectivity](ucs_san_connectivity_module#ansible-collections-cisco-ucs-ucs-san-connectivity-module) β Configures SAN Connectivity Policies on Cisco UCS Manager
* [ucs\_scrub\_policy](ucs_scrub_policy_module#ansible-collections-cisco-ucs-ucs-scrub-policy-module) β Manages UCS Scrub Policies on UCS Manager
* [ucs\_serial\_over\_lan\_policy](ucs_serial_over_lan_policy_module#ansible-collections-cisco-ucs-ucs-serial-over-lan-policy-module) β Manages UCS Serial Over Lan Policies on UCS Manager
* [ucs\_server\_maintenance](ucs_server_maintenance_module#ansible-collections-cisco-ucs-ucs-server-maintenance-module) β Creates Server Maintenance Policy on Cisco UCS Manager
* [ucs\_service\_profile\_association](ucs_service_profile_association_module#ansible-collections-cisco-ucs-ucs-service-profile-association-module) β Configures Service Profile Association on Cisco UCS Manager
* [ucs\_service\_profile\_from\_template](ucs_service_profile_from_template_module#ansible-collections-cisco-ucs-ucs-service-profile-from-template-module) β Configures Service Profiles from templates on Cisco UCS Manager
* [ucs\_service\_profile\_template](ucs_service_profile_template_module#ansible-collections-cisco-ucs-ucs-service-profile-template-module) β Configures Service Profile Templates on Cisco UCS Manager
* [ucs\_sp\_vnic\_order](ucs_sp_vnic_order_module#ansible-collections-cisco-ucs-ucs-sp-vnic-order-module) β Configures vNIC order for service profiles and templates on Cisco UCS Manager
* [ucs\_storage\_profile](ucs_storage_profile_module#ansible-collections-cisco-ucs-ucs-storage-profile-module) β Configures storage profiles on Cisco UCS Manager
* [ucs\_system\_qos](ucs_system_qos_module#ansible-collections-cisco-ucs-ucs-system-qos-module) β Configures system QoS settings
* [ucs\_timezone](ucs_timezone_module#ansible-collections-cisco-ucs-ucs-timezone-module) β Configures timezone on Cisco UCS Manager
* [ucs\_uuid\_pool](ucs_uuid_pool_module#ansible-collections-cisco-ucs-ucs-uuid-pool-module) β Configures server UUID pools on Cisco UCS Manager
* [ucs\_vhba\_template](ucs_vhba_template_module#ansible-collections-cisco-ucs-ucs-vhba-template-module) β Configures vHBA templates on Cisco UCS Manager
* [ucs\_vlan\_find](ucs_vlan_find_module#ansible-collections-cisco-ucs-ucs-vlan-find-module) β Find VLANs on Cisco UCS Manager
* [ucs\_vlan\_to\_group](ucs_vlan_to_group_module#ansible-collections-cisco-ucs-ucs-vlan-to-group-module) β Add VLANs to a VLAN Group. Requires VLAN and VLAN Group to already be created on UCS prior to running module.
* [ucs\_vlans](ucs_vlans_module#ansible-collections-cisco-ucs-ucs-vlans-module) β Configures VLANs on Cisco UCS Manager
* [ucs\_vnic\_template](ucs_vnic_template_module#ansible-collections-cisco-ucs-ucs-vnic-template-module) β Configures vNIC templates on Cisco UCS Manager
* [ucs\_vsans](ucs_vsans_module#ansible-collections-cisco-ucs-ucs-vsans-module) β Configures VSANs on Cisco UCS Manager
* [ucs\_wwn\_pool](ucs_wwn_pool_module#ansible-collections-cisco-ucs-ucs-wwn-pool-module) β Configures WWNN or WWPN pools on Cisco UCS Manager
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible cisco.ucs.ucs_query β Queries UCS Manager objects by class or distinguished name cisco.ucs.ucs\_query β Queries UCS Manager objects by class or distinguished name
=================================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_query`.
New in version 2.8: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* -Queries UCS Manager objects by class or distinguished name.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **class\_ids** string | | One or more UCS Manager Class IDs to query. As a comma separated list |
| **delegate\_to** string | **Default:**"localhost" | Where the module will be run |
| **distinguished\_names** string | | One or more UCS Manager Distinguished Names to query. As a comma separated list |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Query UCS Class ID
cisco.ucs.ucs_query:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
class_ids: computeBlade
delegate_to: localhost
- name: Query UCS Class IDs
cisco.ucs.ucs_query:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
class_ids: computeBlade, fabricVlan
delegate_to: localhost
- name: Query UCS Distinguished Name
cisco.ucs.ucs_query:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
distinguished_names: org-root
delegate_to: localhost
- name: Query UCS Distinguished Names
cisco.ucs.ucs_query:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
distinguished_names: org-root, sys/rack-unit-1, sys/chassis-1/blade-2
delegate_to: localhost
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **objects** dictionary | success | results JSON encodded |
### Authors
* John McDonough (@movinalot)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_vlans β Configures VLANs on Cisco UCS Manager cisco.ucs.ucs\_vlans β Configures VLANs on Cisco UCS Manager
============================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_vlans`.
New in version 2.5: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures VLANs on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **fabric** string | **Choices:*** **common** β
* A
* B
| The fabric configuration of the VLAN. This can be one of the following: common - The VLAN applies to both fabrics and uses the same configuration parameters in both cases. A β The VLAN only applies to fabric A. B β The VLAN only applies to fabric B. For upstream disjoint L2 networks, Cisco recommends that you choose common to create VLANs that apply to both fabrics. |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **id** string / required | | The unique string identifier assigned to the VLAN. A VLAN ID can be between '1' and '3967', or between '4048' and '4093'. You cannot create VLANs with IDs from 4030 to 4047. This range of VLAN IDs is reserved. The VLAN IDs you specify must also be supported on the switch that you are using. VLANs in the LAN cloud and FCoE VLANs in the SAN cloud must have different IDs. Optional if state is absent. |
| **multicast\_policy** string | **Default:**"" | The multicast policy associated with this VLAN. This option is only valid if the Sharing Type field is set to None or Primary. |
| **name** string / required | | The name assigned to the VLAN. The VLAN name is case sensitive. This name can be between 1 and 32 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). You cannot change this name after the VLAN is created. |
| **native** string | **Choices:*** yes
* **no** β
| Designates the VLAN as a native VLAN. |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **sharing** string | **Choices:*** **none** β
* primary
* isolated
* community
| The Sharing Type field. Whether this VLAN is subdivided into private or secondary VLANs. This can be one of the following: none - This VLAN does not have any secondary or private VLANs. This is a regular VLAN. primary - This VLAN can have one or more secondary VLANs, as shown in the Secondary VLANs area. This VLAN is a primary VLAN in the private VLAN domain. isolated - This is a private VLAN associated with a primary VLAN. This VLAN is an Isolated VLAN. community - This VLAN can communicate with other ports on the same community VLAN as well as the promiscuous port. This VLAN is a Community VLAN. |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify VLANs are present and will create if needed. If `absent`, will verify VLANs are absent and will delete if needed. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Configure VLAN
cisco.ucs.ucs_vlans:
hostname: 172.16.143.150
username: admin
password: password
name: vlan2
id: '2'
native: 'yes'
- name: Remove VLAN
cisco.ucs.ucs_vlans:
hostname: 172.16.143.150
username: admin
password: password
name: vlan2
state: absent
```
### Authors
* David Soper (@dsoper2)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_sp_vnic_order β Configures vNIC order for service profiles and templates on Cisco UCS Manager cisco.ucs.ucs\_sp\_vnic\_order β Configures vNIC order for service profiles and templates on Cisco UCS Manager
==============================================================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_sp_vnic_order`.
New in version 2.1: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures Configures vNIC order for service profiles and templates on Cisco UCS Manager
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **org\_dn** string | | root org dn |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **sp\_name** string | | DN of the service profile |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
| **vnics** string | | List of vNIC order properties |
| | **admin\_vcon** string | **Choices:*** 1
* 2
* 3
* 4
* any
| Name of the virtual connection |
| | **name** string / required | | Name of the vNIC |
| | **order** string | **Choices:*** unspecified
* 0-256
| vNIC connection order |
| | **state** string | **Choices:*** **present** β
* absent
| Desired state of the vNIC. |
| | **transport** string / required | **Choices:*** ethernet
* fc
| transport medium |
Examples
--------
```
- name: Configure vnic order
cisco.ucs.ucs_sp_vnic_order:
sp_name: my_sp
vnics:
- name: 'my_vnic'
admin_vcon: '1'
order: '1'
transport: 'ethernet'
hostname: 192.168.99.100
username: admin
password: password
- name: Configure vhba order
cisco.ucs.ucs_sp_vnic_order:
sp_name: my_sp
vnics:
- name: 'my_vhba'
admin_vcon: '2'
order: '1'
transport: 'fc'
hostname: 192.168.99.100
username: admin
password: password
- name: Configure vnic and vhba order
cisco.ucs.ucs_sp_vnic_order:
sp_name: my_sp
vnics:
- name: my_vhba
admin_vcon: '2'
order: '1'
transport: fc
- name: my_vnic
admin_vcon: '1'
order: '1'
transport: ethernet
hostname: 192.168.99.100
username: admin
password: password
- name: Remove vnic order configuration from my_vnic
cisco.ucs.ucs_sp_vnic_order:
sp_name: my_sp
vnics:
- name: 'my_vnic'
transport: ethernet
state: absent
hostname: 192.168.99.100
username: admin
password: password
```
### Authors
* Brett Johnson (@sdbrett)
ansible cisco.ucs.ucs_dns_server β Configure DNS servers on Cisco UCS Manager cisco.ucs.ucs\_dns\_server β Configure DNS servers on Cisco UCS Manager
=======================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_dns_server`.
New in version 2.8: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configure DNS servers on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **delegate\_to** string | **Default:**"localhost" | Where the module will be run |
| **description** string | | A user-defined description of the DNS server. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **dns\_server** string | | DNS server IP address. Enter a valid IPV4 Address. UCS Manager supports up to 4 DNS Servers
aliases: name |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** absent
* **present** β
| If `absent`, will remove a DNS server. If `present`, will add or update a DNS server. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Configure DNS server
cisco.ucs.ucs_dns_server:
hostname: 172.16.143.150
username: admin
password: password
dns_server: 10.10.10.10
description: DNS Server IP address
state: present
delegate_to: localhost
- name: Remove DNS server
cisco.ucs.ucs_dns_server:
hostname: 172.16.143.150
username: admin
password: password
dns_server: 10.10.10.10
state: absent
delegate_to: localhost
```
### Authors
* David Soper (@dsoper2)
* John McDonough (@movinalot)
* CiscoUcs (@CiscoUcs)
| programming_docs |
ansible cisco.ucs.ucs_storage_profile β Configures storage profiles on Cisco UCS Manager cisco.ucs.ucs\_storage\_profile β Configures storage profiles on Cisco UCS Manager
==================================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_storage_profile`.
New in version 2.7: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures storage profiles on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **description** string | | The user-defined description of the storage profile. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **local\_luns** string | | List of Local LUNs used by the storage profile. |
| | **auto\_deploy** string | **Choices:*** **auto-deploy** β
* no-auto-deploy
| Whether the local LUN should be automatically deployed or not. |
| | **disk\_policy\_name** string | | The disk group configuration policy to be applied to this local LUN. |
| | **expand\_to\_avail** boolean | **Choices:*** **no** β
* yes
| Specifies that this LUN can be expanded to use the entire available disk group. For each service profile, only one LUN can use this option. Expand To Available option is not supported for already deployed LUN. |
| | **fractional\_size** string | **Default:**"0" | Fractional size of this LUN in MB. |
| | **name** string / required | | The name of the local LUN. |
| | **size** string | **Default:**"1" | Size of this LUN in GB. The size can range from 1 to 10240 GB. |
| | **state** string | **Choices:*** absent
* **present** β
| If `present`, will verify local LUN is present on profile. If `absent`, will verify local LUN is absent on profile. |
| **name** string / required | | The name of the storage profile. This name can be between 1 and 16 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). You cannot change this name after profile is created. |
| **org\_dn** string | **Default:**"org-root" | The distinguished name (dn) of the organization where the resource is assigned. |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** absent
* **present** β
| If `present`, will verify that the storage profile is present and will create if needed. If `absent`, will verify that the storage profile is absent and will delete if needed. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Configure Storage Profile
cisco.ucs.ucs_storage_profile:
hostname: 172.16.143.150
username: admin
password: password
name: DEE-StgProf
local_luns:
- name: Boot-LUN
size: '60'
disk_policy_name: DEE-DG
- name: Data-LUN
size: '200'
disk_policy_name: DEE-DG
- name: Remove Storage Profile
cisco.ucs.ucs_storage_profile:
hostname: 172.16.143.150
username: admin
password: password
name: DEE-StgProf
state: absent
- name: Remove Local LUN from Storage Profile
cisco.ucs.ucs_storage_profile:
hostname: 172.16.143.150
username: admin
password: password
name: DEE-StgProf
local_luns:
- name: Data-LUN
state: absent
```
### Authors
* Sindhu Sudhir (@sisudhir)
* David Soper (@dsoper2)
* John McDonough (@movinalot)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_ntp_server β Configures NTP server on Cisco UCS Manager cisco.ucs.ucs\_ntp\_server β Configures NTP server on Cisco UCS Manager
=======================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_ntp_server`.
New in version 2.7: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures NTP server on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **description** string | **Default:**"" | A user-defined description of the NTP server. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **ntp\_server** string | **Default:**"" | NTP server IP address or hostname. Enter up to 63 characters that form a valid hostname. Enter a valid IPV4 Address.
aliases: name |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** absent
* **present** β
| If `absent`, will remove an NTP server. If `present`, will add or update an NTP server. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Configure NTP server
cisco.ucs.ucs_ntp_server:
hostname: 172.16.143.150
username: admin
password: password
ntp_server: 10.10.10.10
description: Internal NTP Server by IP address
state: present
- name: Configure NTP server
cisco.ucs.ucs_ntp_server:
hostname: 172.16.143.150
username: admin
password: password
ntp_server: pool.ntp.org
description: External NTP Server by hostname
state: present
- name: Remove NTP server
cisco.ucs.ucs_ntp_server:
hostname: 172.16.143.150
username: admin
password: password
ntp_server: 10.10.10.10
state: absent
- name: Remove NTP server
cisco.ucs.ucs_ntp_server:
hostname: 172.16.143.150
username: admin
password: password
ntp_server: pool.ntp.org
state: absent
```
### Authors
* David Soper (@dsoper2)
* John McDonough (@movinalot)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_lan_connectivity β Configures LAN Connectivity Policies on Cisco UCS Manager cisco.ucs.ucs\_lan\_connectivity β Configures LAN Connectivity Policies on Cisco UCS Manager
============================================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_lan_connectivity`.
New in version 2.5: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures LAN Connectivity Policies on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **description** string | | A description of the LAN Connectivity Policy. Cisco recommends including information about where and when to use the policy. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **iscsi\_vnic\_list** string added in 2.8 of cisco.ucs | | List of iSCSI vNICs used by the LAN Connectivity Policy. |
| | **iscsi\_adapter\_policy** string | | The iSCSI adapter policy associated with this iSCSI vNIC. |
| | **mac\_address** string | **Default:**"derived" | The MAC address associated with this iSCSI vNIC. If the MAC address is not set, Cisco UCS Manager uses a derived MAC address. |
| | **name** string / required | | The name of the iSCSI vNIC. |
| | **overlay\_vnic** string | | The LAN vNIC associated with this iSCSI vNIC. |
| | **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify iscsi vnic is configured within policy. If `absent`, will verify iscsi vnic is absent from policy. |
| | **vlan\_name** string | **Default:**"default" | The VLAN used for the iSCSI vNIC. |
| **name** string / required | | The name of the LAN Connectivity Policy. This name can be between 1 and 16 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). You cannot change this name after the policy is created. |
| **org\_dn** string | **Default:**"org-root" | Org dn (distinguished name) |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify LAN Connectivity Policies are present and will create if needed. If `absent`, will verify LAN Connectivity Policies are absent and will delete if needed. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
| **vnic\_list** string added in 2.8 of cisco.ucs | | List of vNICs used by the LAN Connectivity Policy. vNICs used by the LAN Connectivity Policy must be created from a vNIC template. |
| | **adapter\_policy** string | | The name of the Ethernet adapter policy. A user defined policy can be used, or one of the system defined policies. |
| | **name** string / required | | The name of the vNIC. |
| | **order** string | **Default:**"unspecified" | String specifying the vNIC assignment order (e.g., '1', '2'). |
| | **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify vnic is configured within policy. If `absent`, will verify vnic is absent from policy. |
| | **vnic\_template** string / required | | The name of the vNIC template. |
Examples
--------
```
- name: Configure LAN Connectivity Policy
cisco.ucs.ucs_lan_connectivity:
hostname: 172.16.143.150
username: admin
password: password
name: Cntr-FC-Boot
vnic_list:
- name: eno1
vnic_template: Cntr-Template
adapter_policy: Linux
- name: eno2
vnic_template: Container-NFS-A
adapter_policy: Linux
- name: eno3
vnic_template: Container-NFS-B
adapter_policy: Linux
iscsi_vnic_list:
- name: iSCSIa
overlay_vnic: eno1
iscsi_adapter_policy: default
vlan_name: Container-MGMT-VLAN
- name: iSCSIb
overlay_vnic: eno3
iscsi_adapter_policy: default
vlan_name: Container-TNT-A-NFS
- name: Remove LAN Connectivity Policy
cisco.ucs.ucs_lan_connectivity:
hostname: 172.16.143.150
username: admin
password: password
name: Cntr-FC-Boot
state: absent
```
### Authors
* David Soper (@dsoper2)
* John McDonough (@movinalot)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_vlan_to_group β Add VLANs to a VLAN Group. Requires VLAN and VLAN Group to already be created on UCS prior to running module. cisco.ucs.ucs\_vlan\_to\_group β Add VLANs to a VLAN Group. Requires VLAN and VLAN Group to already be created on UCS prior to running module.
==============================================================================================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_vlan_to_group`.
New in version 2.10: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Add VLANs to VLAN Groups on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify VLANs are present and will create if needed. If `absent`, will verify VLANs are absent and will delete if needed. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
| **vlangroup** string / required | | The name assigned to the VLAN Group. The VLAN Group name is case sensitive. This name can be between 1 and 32 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). |
| **vlanname** string / required | | The name assigned to the VLAN. The VLAN name is case sensitive. This name can be between 1 and 32 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). |
Examples
--------
```
- name: Configure VLAN
cisco.ucs.ucs_vlan_to_group:
hostname: 1.1.1.1
username: admin
password: password
vlangroup: VLANGROUP
vlanname: VLANNAME
state: present
- name: Remove VLAN
cisco.ucs.ucs_vlan_to_group:
hostname: 1.1.1.1
username: admin
password: password
vlangroup: VLANGROUP
vlanname: VLANNAME
state: absent
```
### Authors
* Derrick Johnson @derricktj
ansible cisco.ucs.ucs_serial_over_lan_policy β Manages UCS Serial Over Lan Policies on UCS Manager cisco.ucs.ucs\_serial\_over\_lan\_policy β Manages UCS Serial Over Lan Policies on UCS Manager
==============================================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_serial_over_lan_policy`.
New in version 2.9: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Manages UCS Serial Over Lan Policies on UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **admin\_state** string | **Choices:*** disable
* enable
| The administrative state of the serial over lan policy. disable Serial over LAN access is blocked. enable Serial over LAN access is permitted. |
| **description** string | | A user-defined description of the serial over lan policy. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote) = (equal sign), > (greater than), < (less than), ' (single quote).
aliases: descr |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **name** string / required | | The name of the serial over lan policy. Enter up to 16 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote) = (equal sign), > (greater than), < (less than), ' (single quote). |
| **org\_dn** string | **Default:**"org-root" | Org dn (distinguished name) of the serial over lan policy. |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **speed** string | **Choices:*** 9600
* 19200
* 38400
* 57600
* 115200
| The transmission speed of the serial over lan policy. |
| **state** string | **Choices:*** absent
* **present** β
| If `absent`, will remove Serial Over Lan Policy. If `present`, will create or update Serial Over Lan Policy. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Add UCS Serial Over Lan Policy
cisco.ucs.ucs_serial_over_lan:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: present
name: sol_org_root
description: Serial Over Lan for Org root servers
admin_state: enable
speed: 115200
delegate_to: localhost
- name: Add UCS Serial Over Lan Policy in Organization
cisco.ucs.ucs_serial_over_lan:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: present
org_dn: org-root/org-prod
name: sol_org_prod
description: Serial Over Lan for Org Prod servers
admin_state: enable
speed: 115200
delegate_to: localhost
- name: Update UCS Serial Over Lan Policy in Organization
cisco.ucs.ucs_serial_over_lan:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: present
org_dn: org-root/org-prod
name: sol_org_prod
description: Serial Over Lan for Org Prod servers
admin_state: enable
speed: 38400
delegate_to: localhost
- name: Update UCS Serial Over Lan Policy in Organization
cisco.ucs.ucs_serial_over_lan:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: present
org_dn: org-root/org-prod
name: sol_org_prod
descr: Serial Over Lan for Org Prod servers
admin_state: enable
speed: 57600
delegate_to: localhost
- name: Delete UCS Serial Over Lan Policy in Organization
cisco.ucs.ucs_serial_over_lan:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: absent
org_dn: org-root/org-prod
name: sol_org_prod
delegate_to: localhost
- name: Delete UCS Serial Over Lan Policy
cisco.ucs.ucs_serial_over_lan:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: absent
name: sol_org_root
delegate_to: localhost
```
### Authors
* John McDonough (@movinalot)
| programming_docs |
ansible cisco.ucs.ucs_vhba_template β Configures vHBA templates on Cisco UCS Manager cisco.ucs.ucs\_vhba\_template β Configures vHBA templates on Cisco UCS Manager
==============================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_vhba_template`.
New in version 2.5: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures vHBA templates on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **description** string | | A user-defined description of the template. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **fabric** string | **Choices:*** **A** β
* B
| The Fabric ID field. The name of the fabric interconnect that vHBAs created with this template are associated with. |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **max\_data** string | **Default:**"2048" | The Max Data Field Size field. The maximum size of the Fibre Channel frame payload bytes that the vHBA supports. Enter an string between '256' and '2112'. |
| **name** string / required | | The name of the virtual HBA template. This name can be between 1 and 16 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). You cannot change this name after the template is created. |
| **org\_dn** string | **Default:**"org-root" | Org dn (distinguished name) |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **pin\_group** string | | The SAN pin group that is associated with vHBAs created from this template. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **qos\_policy** string | | The QoS policy that is associated with vHBAs created from this template. |
| **redundancy\_type** string | **Choices:*** **none** β
* primary
* secondary
| The Redundancy Type used for template pairing from the Primary or Secondary redundancy template. primary β Creates configurations that can be shared with the Secondary template. Any other shared changes on the Primary template are automatically synchronized to the Secondary template. secondary β All shared configurations are inherited from the Primary template. none - Legacy vHBA template behavior. Select this option if you do not want to use redundancy. |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify vHBA templates are present and will create if needed. If `absent`, will verify vHBA templates are absent and will delete if needed. |
| **stats\_policy** string | **Default:**"default" | The statistics collection policy that is associated with vHBAs created from this template. |
| **template\_type** string | **Choices:*** **initial-template** β
* updating-template
| The Template Type field. This can be one of the following: initial-template β vHBAs created from this template are not updated if the template changes. updating-template - vHBAs created from this template are updated if the template changes. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
| **vsan** string | **Default:**"default" | The VSAN to associate with vHBAs created from this template. |
| **wwpn\_pool** string | **Default:**"default" | The WWPN pool that a vHBA created from this template uses to derive its WWPN address. |
Examples
--------
```
- name: Configure vHBA template
cisco.ucs.ucs_vhba_template:
hostname: 172.16.143.150
username: admin
password: password
name: vHBA-A
fabric: A
vsan: VSAN-A
wwpn_pool: WWPN-Pool-A
- name: Remote vHBA template
cisco.ucs.ucs_vhba_template:
hostname: 172.16.143.150
username: admin
password: password
name: vHBA-A
state: absent
```
### Authors
* David Soper (@dsoper2)
* John McDonough (@movinalot)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_graphics_card_policy β Manages UCS Graphics Card Policies on UCS Manager cisco.ucs.ucs\_graphics\_card\_policy β Manages UCS Graphics Card Policies on UCS Manager
=========================================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_graphics_card_policy`.
New in version 2.9: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Manages UCS Graphics Card Policies on UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **description** string | | A user-defined description of the organization. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote) = (equal sign), > (greater than), < (less than), ' (single quote).
aliases: descr |
| **graphics\_card\_mode** string | **Choices:*** any-configuration
* compute
* graphics
| Set the Graphics Card Mode. |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **name** string / required | | The name of the organization. Enter up to 16 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote) = (equal sign), > (greater than), < (less than), ' (single quote). |
| **org\_dn** string | **Default:**"org-root" | Org dn (distinguished name) |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** absent
* **present** β
| If `absent`, will remove organization. If `present`, will create or update organization. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Add UCS Graphics Card Policy
cisco.ucs.ucs_graphics_card_policy:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: present
description: Any Graphics Mode Policy
name: any_graphics
graphics_card_mode: any-configuration
delegate_to: localhost
- name: Add UCS Graphics Card Policy in an Organization
cisco.ucs.ucs_graphics_card_policy:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: present
org_dn: org-root/org-prod
description: Any Graphics Mode Policy
name: prod_graphics
graphics_card_mode: any-configuration
delegate_to: localhost
- name: Update UCS Graphics Card Policy in an Organization
cisco.ucs.ucs_graphics_card_policy:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: present
org_dn: org-root/org-prod
description: Graphics Mode Policy
name: prod_graphics
graphics_card_mode: graphics
delegate_to: localhost
- name: Update UCS Graphics Card Policy in an Organization
cisco.ucs.ucs_graphics_card_policy:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: present
org_dn: org-root/org-prod
description: Compute Mode Policy
name: prod_graphics
graphics_card_mode: compute
delegate_to: localhost
- name: Delete UCS Graphics Card Policy in an Organization
cisco.ucs.ucs_graphics_card_policy:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: absent
org_dn: org-root/org-prod
name: prod_graphics
delegate_to: localhost
- name: Delete UCS Graphics Card Policy
cisco.ucs.ucs_graphics_card_policy:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: absent
name: any_graphics
delegate_to: localhost
```
### Authors
* John McDonough (@movinalot)
ansible cisco.ucs.ucs_managed_objects β Configures Managed Objects on Cisco UCS Manager cisco.ucs.ucs\_managed\_objects β Configures Managed Objects on Cisco UCS Manager
=================================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_managed_objects`.
New in version 2.8: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures Managed Objects on Cisco UCS Manager.
* The Python SDK module, Python class within the module (UCSM Class), and all properties must be directly specified.
* More information on the UCSM Python SDK and how to directly configure Managed Objects is available at [UCSM Python SDK](http://ucsmsdk.readthedocs.io/).
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **objects** string / required | | List of managed objects to configure. Each managed object has suboptions the specify the Python SDK module, class, and properties to configure. |
| | **children** string | | Optional list of child objects. Each child has its own module, class, and properties suboptions. The parent\_mo\_or\_dn property for child objects is automatically set as the list of children is configured. |
| | **class\_name** string / required | | Name of the Python class that will be used to configure the Managed Object. |
| | **module** string / required | | Name of the Python SDK module implementing the required class. |
| | **properties** string / required | | List of properties to configure on the Managed Object. See the UCSM Python SDK for information on properties for each class. |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** absent
* **present** β
| If `present`, will verify that the Managed Objects are present and will create if needed. If `absent`, will verify that the Managed Objects are absent and will delete if needed. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Configure Network Control Policy
cisco.ucs.ucs_managed_objects:
hostname: 172.16.143.150
username: admin
password: password
objects:
- module: ucsmsdk.mometa.nwctrl.NwctrlDefinition
class: NwctrlDefinition
properties:
parent_mo_or_dn: org-root
cdp: enabled
descr: ''
lldp_receive: enabled
lldp_transmit: enabled
name: Enable-CDP-LLDP
- name: Remove Network Control Policy
cisco.ucs.ucs_managed_objects:
hostname: 172.16.143.150
username: admin
password: password
objects:
- module: ucsmsdk.mometa.nwctrl.NwctrlDefinition
class: NwctrlDefinition
properties:
parent_mo_or_dn: org-root
name: Enable-CDP-LLDP
state: absent
- name: Configure Boot Policy Using JSON objects list with children
cisco.ucs.ucs_managed_objects:
hostname: 172.16.143.150
username: admin
password: password
objects:
- {
"module": "ucsmsdk.mometa.lsboot.LsbootPolicy",
"class": "LsbootPolicy",
"properties": {
"parent_mo_or_dn": "org-root",
"name": "Python_SDS",
"enforce_vnic_name": "yes",
"boot_mode": "legacy",
"reboot_on_update": "no"
},
"children": [
{
"module": "ucsmsdk.mometa.lsboot.LsbootVirtualMedia",
"class": "LsbootVirtualMedia",
"properties": {
"access": "read-only-local",
"lun_id": "0",
"order": "2"
}
},
{
"module": "ucsmsdk.mometa.lsboot.LsbootStorage",
"class": "LsbootStorage",
"properties": {
"order": "1"
},
"children": [
{
"module": "ucsmsdk.mometa.lsboot.LsbootLocalStorage",
"class": "LsbootLocalStorage",
"properties": {},
"children": [
{
"module": "ucsmsdk.mometa.lsboot.LsbootDefaultLocalImage",
"class": "LsbootDefaultLocalImage",
"properties": {
"order": "1"
}
}
]
}
]
}
]
}
- name: Remove Boot Policy Using JSON objects list
cisco.ucs.ucs_managed_objects:
hostname: 172.16.143.150
username: admin
password: password
objects:
- {
"module": "ucsmsdk.mometa.lsboot.LsbootPolicy",
"class": "LsbootPolicy",
"properties": {
"parent_mo_or_dn": "org-root",
"name": "Python_SDS"
}
}
state: absent
```
### Authors
* David Soper (@dsoper2)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_uuid_pool β Configures server UUID pools on Cisco UCS Manager cisco.ucs.ucs\_uuid\_pool β Configures server UUID pools on Cisco UCS Manager
=============================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_uuid_pool`.
New in version 2.7: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures server UUID pools and UUID blocks on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **description** string | | The user-defined description of the UUID pool. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **first\_uuid** string | | The first UUID in the block of UUIDs. This is the From field in the UCS Manager UUID Blocks menu. |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **last\_uuid** string | | The last UUID in the block of UUIDs. This is the To field in the UCS Manager Add UUID Blocks menu. |
| **name** string / required | | The name of the UUID pool. This name can be between 1 and 32 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). You cannot change this name after the UUID pool is created. |
| **order** string | **Choices:*** **default** β
* sequential
| The Assignment Order field. This can be one of the following: default - Cisco UCS Manager selects a random identity from the pool. sequential - Cisco UCS Manager selects the lowest available identity from the pool. |
| **org\_dn** string | **Default:**"org-root" | The distinguished name (dn) of the organization where the resource is assigned. |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **prefix** string | | UUID prefix used for the range of server UUIDs. If no value is provided, the system derived prefix will be used (equivalent to selecting 'derived' option in UI). If the user provides a value, the user provided prefix will be used (equivalent to selecting 'other' option in UI). A user provided value should be in the format XXXXXXXX-XXXX-XXXX. |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify UUID pool is present and will create if needed. If `absent`, will verify UUID pool is absent and will delete if needed. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Configure UUID address pool
cisco.ucs.ucs_uuid_pool:
hostname: 172.16.143.150
username: admin
password: password
name: UUID-Pool
order: sequential
first_uuid: 0000-000000000001
last_uuid: 0000-000000000078
- name: Remove UUID address pool
cisco.ucs.ucs_uuid_pool:
hostname: 172.16.143.150
username: admin
password: password
name: UUID-Pool
state: absent
```
### Authors
* David Soper (@dsoper2)
* CiscoUcs (@CiscoUcs)
| programming_docs |
ansible cisco.ucs.ucs_timezone β Configures timezone on Cisco UCS Manager cisco.ucs.ucs\_timezone β Configures timezone on Cisco UCS Manager
==================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_timezone`.
New in version 2.7: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures timezone on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **admin\_state** string | **Choices:*** disabled
* **enabled** β
| The admin\_state setting The enabled admin\_state indicates the timezone configuration is utilized by UCS Manager. The disabled admin\_state indicates the timezone configuration is ignored by UCS Manager. |
| **description** string | **Default:**"" | A user-defined description of the timezone. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** absent
* **present** β
| If `absent`, will unset timezone. If `present`, will set or update timezone. |
| **timezone** string | | The timezone name. Time zone names are from the [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
The timezone name is case sensitive. The timezone name can be between 0 and 510 alphanumeric characters. You cannot use spaces or any special characters other than "-" (hyphen), "\_" (underscore), "/" (backslash). |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Configure Time Zone
cisco.ucs.ucs_timezone:
hostname: 172.16.143.150
username: admin
password: password
state: present
admin_state: enabled
timezone: America/Los_Angeles
description: 'Time Zone for Los Angeles'
- name: Unconfigure Time Zone
cisco.ucs.ucs_timezone:
hostname: 172.16.143.150
username: admin
password: password
state: absent
admin_state: disabled
```
### Authors
* David Soper (@dsoper2)
* John McDonough (@movinalot)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_vsans β Configures VSANs on Cisco UCS Manager cisco.ucs.ucs\_vsans β Configures VSANs on Cisco UCS Manager
============================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_vsans`.
New in version 2.5: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures VSANs on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **fabric** string | **Choices:*** **common** β
* A
* B
| The fabric configuration of the VSAN. This can be one of the following: common - The VSAN maps to the same VSAN ID in all available fabrics. A - The VSAN maps to the a VSAN ID that exists only in fabric A. B - The VSAN maps to the a VSAN ID that exists only in fabric B. |
| **fc\_zoning** string | **Choices:*** **disabled** β
* enabled
| Fibre Channel zoning configuration for the Cisco UCS domain. Fibre Channel zoning can be set to one of the following values: disabled β The upstream switch handles Fibre Channel zoning, or Fibre Channel zoning is not implemented for the Cisco UCS domain. enabled β Cisco UCS Manager configures and controls Fibre Channel zoning for the Cisco UCS domain. If you enable Fibre Channel zoning, do not configure the upstream switch with any VSANs that are being used for Fibre Channel zoning. |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **name** string / required | | The name assigned to the VSAN. This name can be between 1 and 32 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). You cannot change this name after the VSAN is created. |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify VSANs are present and will create if needed. If `absent`, will verify VSANs are absent and will delete if needed. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
| **vlan\_id** string / required | | The unique string identifier assigned to the VLAN used for Fibre Channel connections. Note that Cisco UCS Manager uses VLAN '4048'. See the UCS Manager configuration guide if you want to assign '4048' to a VLAN. Optional if state is absent. |
| **vsan\_id** string / required | | The unique identifier assigned to the VSAN. The ID can be a string between '1' and '4078', or between '4080' and '4093'. '4079' is a reserved VSAN ID. In addition, if you plan to use FC end-host mode, the range between '3840' to '4079' is also a reserved VSAN ID range. Optional if state is absent. |
Examples
--------
```
- name: Configure VSAN
cisco.ucs.ucs_vsans:
hostname: 172.16.143.150
username: admin
password: password
name: vsan110
fabric: common
vsan_id: '110'
vlan_id: '110'
- name: Remove VSAN
cisco.ucs.ucs_vsans:
hostname: 172.16.143.150
username: admin
password: password
name: vsan110
state: absent
```
### Authors
* David Soper (@dsoper2)
* John McDonough (@movinalot)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_wwn_pool β Configures WWNN or WWPN pools on Cisco UCS Manager cisco.ucs.ucs\_wwn\_pool β Configures WWNN or WWPN pools on Cisco UCS Manager
=============================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_wwn_pool`.
New in version 2.5: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures WWNNs or WWPN pools on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **description** string | | A description of the WWNN or WWPN pool. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **first\_addr** string | | The first initiator in the World Wide Name (WWN) block. This is the From field in the UCS Manager Add WWN Blocks menu. |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **last\_addr** string | | The last initiator in the World Wide Name (WWN) block. This is the To field in the UCS Manager Add WWN Blocks menu. For WWxN pools, the pool size must be a multiple of ports-per-node + 1. For example, if there are 7 ports per node, the pool size must be a multiple of 8. If there are 63 ports per node, the pool size must be a multiple of 64. |
| **name** string / required | | The name of the World Wide Node Name (WWNN) or World Wide Port Name (WWPN) pool. This name can be between 1 and 32 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). You cannot change this name after the WWNN or WWPN pool is created. |
| **order** string | **Choices:*** **default** β
* sequential
| The Assignment Order field. This can be one of the following: default - Cisco UCS Manager selects a random identity from the pool. sequential - Cisco UCS Manager selects the lowest available identity from the pool. |
| **org\_dn** string | **Default:**"org-root" | Org dn (distinguished name) |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **purpose** string / required | **Choices:*** node
* port
| Specify whether this is a node (WWNN) or port (WWPN) pool. Optional if state is absent. |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify WWNNs/WWPNs are present and will create if needed. If `absent`, will verify WWNNs/WWPNs are absent and will delete if needed. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Configure WWNN/WWPN pools
cisco.ucs.ucs_wwn_pool:
hostname: 172.16.143.150
username: admin
password: password
name: WWNN-Pool
purpose: node
first_addr: 20:00:00:25:B5:48:00:00
last_addr: 20:00:00:25:B5:48:00:0F
- cisco.ucs.ucs_wwn_pool:
hostname: 172.16.143.150
username: admin
password: password
name: WWPN-Pool-A
purpose: port
order: sequential
first_addr: 20:00:00:25:B5:48:0A:00
last_addr: 20:00:00:25:B5:48:0A:0F
- name: Remove WWNN/WWPN pools
cisco.ucs.ucs_wwn_pool:
hostname: 172.16.143.150
username: admin
password: password
name: WWNN-Pool
state: absent
- cisco.ucs.ucs_wwn_pool:
hostname: 172.16.143.150
username: admin
password: password
name: WWPN-Pool-A
state: absent
```
### Authors
* David Soper (@dsoper2)
* John McDonough (@movinalot)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_service_profile_association β Configures Service Profile Association on Cisco UCS Manager cisco.ucs.ucs\_service\_profile\_association β Configures Service Profile Association on Cisco UCS Manager
==========================================================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_service_profile_association`.
New in version 2.1: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Configures Service Profile Association (change association or disassociate) on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **org\_dn** string | **Default:**"org-root" | The distinguished name (dn) of the organization where the resource is assigned. |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **restrict\_migration** string | **Choices:*** yes
* **no** β
| Restricts the migration of the service profile after it has been associated with a server. If set to no, Cisco UCS Manager does not perform any compatibility checks on the new server before migrating the existing service profile. If set to no and the hardware of both servers used in migration are not similar, the association might fail. |
| **server\_assignment** string / required | **Choices:*** server
* pool
| Specifies how to associate servers with this service profile using the following choices: server - Use to pre-provision a slot or select an existing server. Slot or server is specified by the server\_dn option. pool - Use to select from a server pool. The server\_pool option specifies the name of the server pool to use. Option is not valid if the service profile is bound to a template. Optional if the state is absent. |
| **server\_dn** string | | The Distinguished Name (dn) of the server object used for pre-provisioning or selecting an existing server. Required if the server\_assignment option is server. Optional if the state is absent. |
| **server\_pool\_name** string | | Name of the server pool used for server pool based assignment. Required if the server\_assignment option is pool. Optional if the state is absent. |
| **service\_profile\_name** string / required | | The name of the Service Profile being associated or disassociated. |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify service profile association and associate with specified server or server pool if needed. If `absent`, will verify service profile is not associated and will disassociate if needed. This is the same as specifying Assign Later in the webUI. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Change Service Profile Association to server pool Container-Pool and restrict migration
cisco.ucs.ucs_service_profile_association:
hostname: 172.16.143.150
username: admin
password: password
service_profile_name: test-sp
server_assignment: pool
server_pool_name: Container-Pool
restrict_migration: 'yes'
- name: Attempt to change association once a minute for up to 10 minutes
cisco.ucs.ucs_service_profile_association:
hostname: 172.16.143.150
username: admin
password: password
service_profile_name: test-sp
server_assignment: server
server_dn: sys/chassis-2/blade-1
register: result
until: result.assign_state == 'assigned' and result.assoc_state == 'associated'
retries: 10
delay: 60
- name: Disassociate Service Profile
cisco.ucs.ucs_service_profile_association:
hostname: 172.16.143.150
username: admin
password: password
service_profile_name: test-sp
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **assign\_state** string | success | The logical server Assigned State (assigned, unassigned, or failed). **Sample:** assigned |
| **assoc\_state** string | success | The logical server Association State (associated or unassociated). **Sample:** associated |
### Authors
* David Soper (@dsoper2)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_server_maintenance β Creates Server Maintenance Policy on Cisco UCS Manager cisco.ucs.ucs\_server\_maintenance β Creates Server Maintenance Policy on Cisco UCS Manager
===========================================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_server_maintenance`.
New in version 2.1: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures Server Maintenance Policy on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **description** string | | A description of the Server Maintenance Package Policy. Cisco recommends including information about where and when to use the policy. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **name** string / required | | The name assigned to the Server Maintenance Policy. The Server Maintenance Policy name is case sensitive. This name can be between 1 and 16 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). You cannot change this name after the Server Maintenance Policy is created. |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify Server Maintenance Policy is present and will create if needed. If `absent`, will verify Server Maintenance Policy is absent and will delete if needed. |
| **trigger\_config** string | **Choices:*** on-next-boot
| This option is used in combination with either User Ack (user-ack) or Timer Automatic (timer-automatic). When the On Next Boot option is enabled, the host OS reboot, shutdown, or server reset also triggers the associated FSM to apply the changes. Note that de-selecting the On Next Boot option disables the Maintenance Policy on the BMC. |
| **uptime\_disr** string / required | **Choices:*** immediate
* timer-automatic
* user-ack
| When a Server profile is associated with a Server, or when changes are made to a Server profile that is already associated with a Server, you must reboot the Server to complete the process. The Reboot Policy field determines when the reboot occurs for Server associated with any Server profiles that include this maintenance policy. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Add Server Maintenance Policy
cisco.ucs.ucs_server_maintenance:
hostname: 172.16.143.150
username: admin
password: password
name: user-ack
uptime_disr: user-ack
trigger_config: on-next-boot
```
### Authors
* Brett Johnson (@brettjohnson008)
| programming_docs |
ansible cisco.ucs.ucs_disk_group_policy β Configures disk group policies on Cisco UCS Manager cisco.ucs.ucs\_disk\_group\_policy β Configures disk group policies on Cisco UCS Manager
========================================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_disk_group_policy`.
New in version 2.8: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures disk group policies on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **configuration\_mode** string | **Choices:*** **automatic** β
* manual
| Disk group configuration mode. Choose one of the following: automatic - Automatically configures the disks in the disk group. manual - Enables you to manually configure the disks in the disk group. |
| **description** string | | The user-defined description of the storage profile. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **drive\_type** string | **Choices:*** **unspecified** β
* HDD
* SSD
| Specify the drive type to use in the drive group. This can be one of the following: unspecified β Selects the first available drive type, and applies that to all drives in the group. HDD β Hard disk drive SSD β Solid state drive Option only applies when configuration mode is automatic. |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **manual\_disks** string | | List of manually configured disks. Options are only used when you choose manual configuration\_mode. |
| | **name** string / required | | The name of the local LUN. |
| | **role** string | | The role of the disk. This can be one of the following: normal - Normal ded-hot-spare - Dedicated Hot Spare glob-hot-spare - Glob Hot Spare |
| | **slot\_num** string | | The slot number of the specific disk. |
| | **span\_id** string | **Default:**"unspecified" | The Span ID of the specific disk. |
| | **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify disk slot is configured within policy. If `absent`, will verify disk slot is absent from policy. |
| **min\_drive\_size** string | **Default:**"unspecified" | Specify the minimum drive size or unspecified to allow all drive sizes. This can be from 0 to 10240 GB. Option only applies when configuration mode is automatic. |
| **name** string / required | | The name of the disk group policy. This name can be between 1 and 16 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). You cannot change this name after the policy is created. |
| **num\_ded\_hot\_spares** string | **Default:**"unspecified" | Specify the number of hot spares for the disk group. This can be from 0 to 24. Option only applies when configuration mode is automatic. |
| **num\_drives** string | **Default:**1 | Specify the number of drives for the disk group. This can be from 0 to 24. Option only applies when configuration mode is automatic. |
| **num\_glob\_hot\_spares** string | **Default:**"unspecified" | Specify the number of global hot spares for the disk group. This can be from 0 to 24. Option only applies when configuration mode is automatic. |
| **org\_dn** string | **Default:**"org-root" | The distinguished name (dn) of the organization where the resource is assigned. |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **raid\_level** string | **Choices:*** **stripe** β
* mirror
* mirror-stripe
* stripe-parity
* stripe-dual-parity
* stripe-parity-stripe
* stripe-dual-parity-stripe
| The RAID level for the disk group policy. This can be one of the following: stripe - UCS Manager shows RAID 0 Striped mirror - RAID 1 Mirrored mirror-stripe - RAID 10 Mirrored and Striped stripe-parity - RAID 5 Striped Parity stripe-dual-parity - RAID 6 Striped Dual Parity stripe-parity-stripe - RAID 50 Striped Parity and Striped stripe-dual-parity-stripe - RAID 60 Striped Dual Parity and Striped |
| **state** string | **Choices:*** **present** β
* absent
| Desired state of the disk group policy. If `present`, will verify that the disk group policy is present and will create if needed. If `absent`, will verify that the disk group policy is absent and will delete if needed. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_remaining\_disks** string | **Choices:*** yes
* **no** β
| Specifies whether you can use all the remaining disks in the disk group or not. Option only applies when configuration mode is automatic. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
| **virtual\_drive** string | | Configuration of virtual drive options. |
| | **access\_policy** string | **Choices:*** blocked
* hidden
* **platform-default** β
* read-only
* read-write
* transport-ready
| Configure access policy to virtual drive. |
| | **drive\_cache** string | **Choices:*** disable
* enable
* no-change
* **platform-default** β
| Configure drive caching. |
| | **io\_policy** string | **Choices:*** cached
* direct
* **platform-default** β
| Direct or Cached IO path. |
| | **read\_policy** string | **Choices:*** normal
* **platform-default** β
* read-ahead
| Read access policy to virtual drive. |
| | **strip\_size** string | **Choices:*** present
* absent
**Default:**"platform-default" | Virtual drive strip size. |
| | **write\_cache\_policy** string | **Choices:*** always-write-back
* **platform-default** β
* write-back-good-bbu
* write-through
| Write back cache policy. |
Examples
--------
```
- name: Configure Disk Group Policy
cisco.ucs.ucs_disk_group_policy:
hostname: 172.16.143.150
username: admin
password: password
name: DEE-DG
raid_level: mirror
configuration_mode: manual
manual_disks:
- slot_num: '1'
role: normal
- slot_num: '2'
role: normal
- name: Remove Disk Group Policy
cisco.ucs.ucs_disk_group_policy:
name: DEE-DG
hostname: 172.16.143.150
username: admin
password: password
state: absent
- name: Remove Disk from Policy
cisco.ucs.ucs_disk_group_policy:
hostname: 172.16.143.150
username: admin
password: password
name: DEE-DG
description: Testing Ansible
raid_level: stripe
configuration_mode: manual
manual_disks:
- slot_num: '1'
role: normal
- slot_num: '2'
role: normal
state: absent
virtual_drive:
access_policy: platform-default
io_policy: direct
strip_size: 64KB
```
### Authors
* Sindhu Sudhir (@sisudhir)
* David Soper (@dsoper2)
* CiscoUcs (@CiscoUcs)
* Brett Johnson (@sdbrett)
* John McDonough (@movinalot)
ansible cisco.ucs.ucs_service_profile_from_template β Configures Service Profiles from templates on Cisco UCS Manager cisco.ucs.ucs\_service\_profile\_from\_template β Configures Service Profiles from templates on Cisco UCS Manager
=================================================================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_service_profile_from_template`.
New in version 2.5: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures Service Profile created from templates on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **name** string / required | | The name of the service profile. This name can be between 2 and 32 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). This name must be unique across all service profiles and service profile templates within the same organization. |
| **org\_dn** string | **Default:**"org-root" | Org dn (distinguished name) |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **power\_state** string | **Choices:*** up
* down
| The power state to be applied when this service profile is associated with a server. If no value is provided, the power\_state for the service profile will not be modified. |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **source\_template** string / required | | The name of the service profile template used to create this serivce profile. |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify Service Profiles are present and will create if needed. If `absent`, will verify Service Profiles are absent and will delete if needed. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **user\_label** string | | The User Label you want to assign to this service profile. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Configure Service Profile from Template
cisco.ucs.ucs_service_profile_from_template:
hostname: 172.16.143.150
username: admin
password: password
name: test-sp-instance1
source_template: test-sp
- name: Remove Service Profile
cisco.ucs.ucs_service_profile_from_template:
hostname: 172.16.143.150
username: admin
password: password
name: test-sp-instance1
state: absent
```
### Authors
* David Soper (@dsoper2)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_san_connectivity β Configures SAN Connectivity Policies on Cisco UCS Manager cisco.ucs.ucs\_san\_connectivity β Configures SAN Connectivity Policies on Cisco UCS Manager
============================================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_san_connectivity`.
New in version 2.5: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures SAN Connectivity Policies on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **description** string | | A description of the policy. Cisco recommends including information about where and when to use the policy. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **name** string / required | | The name of the SAN Connectivity Policy. This name can be between 1 and 16 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). You cannot change this name after the policy is created. |
| **org\_dn** string | **Default:**"org-root" | Org dn (distinguished name) |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify SAN Connectivity Policies are present and will create if needed. If `absent`, will verify SAN Connectivity Policies are absent and will delete if needed. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
| **vhba\_list** string | | List of vHBAs used by the SAN Connectivity Policy. vHBAs used by the SAN Connectivity Policy must be created from a vHBA template. Each list element has the following suboptions: = name The name of the virtual HBA (required). = vhba\_template The name of the virtual HBA template (required). - adapter\_policy The name of the Fibre Channel adapter policy. A user defined policy can be used, or one of the system defined policies (default, Linux, Solaris, VMware, Windows, WindowsBoot) [Default: default] - order String specifying the vHBA assignment order (e.g., '1', '2'). [Default: unspecified] |
| **wwnn\_pool** string | **Default:**"default" | Name of the WWNN pool to use for WWNN assignment. |
Examples
--------
```
- name: Configure SAN Connectivity Policy
cisco.ucs.ucs_san_connectivity:
hostname: 172.16.143.150
username: admin
password: password
name: Cntr-FC-Boot
wwnn_pool: WWNN-Pool
vhba_list:
- name: Fabric-A
vhba_template: vHBA-Template-A
adapter_policy: Linux
- name: Fabric-B
vhba_template: vHBA-Template-B
adapter_policy: Linux
- name: Remove SAN Connectivity Policy
cisco.ucs.ucs_san_connectivity:
hostname: 172.16.143.150
username: admin
password: password
name: Cntr-FC-Boot
state: absent
```
### Authors
* David Soper (@dsoper2)
* John McDonough (@movinalot)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_mac_pool β Configures MAC address pools on Cisco UCS Manager cisco.ucs.ucs\_mac\_pool β Configures MAC address pools on Cisco UCS Manager
============================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_mac_pool`.
New in version 2.5: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures MAC address pools and MAC address blocks on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **description** string | | A description of the MAC pool. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **first\_addr** string | | The first MAC address in the block of addresses. This is the From field in the UCS Manager MAC Blocks menu. |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **last\_addr** string | | The last MAC address in the block of addresses. This is the To field in the UCS Manager Add MAC Blocks menu. |
| **name** string / required | | The name of the MAC pool. This name can be between 1 and 32 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). You cannot change this name after the MAC pool is created. |
| **order** string | **Choices:*** **default** β
* sequential
| The Assignment Order field. This can be one of the following: default - Cisco UCS Manager selects a random identity from the pool. sequential - Cisco UCS Manager selects the lowest available identity from the pool. |
| **org\_dn** string | **Default:**"org-root" | The distinguished name (dn) of the organization where the resource is assigned. |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify MAC pool is present and will create if needed. If `absent`, will verify MAC pool is absent and will delete if needed. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Configure MAC address pool
cisco.ucs.ucs_mac_pool:
hostname: 172.16.143.150
username: admin
password: password
name: mac-A
first_addr: 00:25:B5:00:66:00
last_addr: 00:25:B5:00:67:F3
order: sequential
- name: Remove MAC address pool
cisco.ucs.ucs_mac_pool:
hostname: 172.16.143.150
username: admin
password: password
name: mac-A
state: absent
```
### Authors
* David Soper (@dsoper2)
* CiscoUcs (@CiscoUcs)
| programming_docs |
ansible cisco.ucs.ucs_service_profile_template β Configures Service Profile Templates on Cisco UCS Manager cisco.ucs.ucs\_service\_profile\_template β Configures Service Profile Templates on Cisco UCS Manager
=====================================================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_service_profile_template`.
New in version 2.8: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures Service Profile Templates on Cisco UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **bios\_policy** string | | The name of the BIOS policy you want to associate with service profiles created from this template. |
| **boot\_policy** string | **Default:**"default" | The name of the boot order policy you want to associate with service profiles created from this template. |
| **description** string | | A user-defined description of the service profile template. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote).
aliases: descr |
| **graphics\_card\_policy** string | | The name of the graphics card policy you want to associate with service profiles created from this template. |
| **host\_firmware\_package** string | | The name of the host firmware package you want to associate with service profiles created from this template. |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **ipmi\_access\_profile** string | | The name of the IPMI access profile you want to associate with service profiles created from this template. |
| **iqn\_pool** string | | The name of the IQN pool (initiator) you want to apply to all iSCSI vNICs for service profiles created from this template. |
| **kvm\_mgmt\_policy** string | | The name of the KVM management policy you want to associate with service profiles created from this template. |
| **lan\_connectivity\_policy** string | | The name of the LAN connectivity policy you want to associate with service profiles created from this template. |
| **local\_disk\_policy** string | | The name of the local disk policy you want to associate with service profiles created from this template. |
| **maintenance\_policy** string | | The name of the maintenance policy you want to associate with service profiles created from this template. |
| **mgmt\_inband\_pool\_name** string | | How the inband management IPv4 address is derived for the server associated with this service profile. |
| **mgmt\_interface\_mode** string | **Choices:*** * in-band
| The Management Interface you want to assign to service profiles created from this template. |
| **mgmt\_ip\_pool** string | **Default:**"ext-mgmt" | The name of the Outband Management IP pool you want to use with service profiles created from this template. |
| **mgmt\_ip\_state** string | **Choices:*** none
* **pooled** β
| The state for the Outband Management IP pool you want to use with service profiles created from this template. |
| **mgmt\_vnet\_name** string | | A VLAN selected from the associated VLAN group. |
| **name** string / required | | The name of the service profile template. This name can be between 2 and 32 alphanumeric characters. You cannot use spaces or any special characters other than - (hyphen), "\_" (underscore), : (colon), and . (period). This name must be unique across all service profiles and service profile templates within the same organization. |
| **org\_dn** string | **Default:**"org-root" | Org dn (distinguished name) |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **power\_control\_policy** string | **Default:**"default" | The name of the power control policy you want to associate with service profiles created from this template. |
| **power\_state** string | **Choices:*** **up** β
* down
| The power state to be applied when a service profile created from this template is associated with a server. |
| **power\_sync\_policy** string | | The name of the power sync policy you want to associate with service profiles created from this template. |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **san\_connectivity\_policy** string | | The name of the SAN connectivity policy you want to associate with service profiles created from this template. |
| **scrub\_policy** string | | The name of the scrub policy you want to associate with service profiles created from this template. |
| **server\_pool** string | | The name of the server pool you want to associate with this service profile template. |
| **server\_pool\_qualification** string | | The name of the server pool policy qualificaiton you want to use for this service profile template. |
| **sol\_policy** string | | The name of the Serial over LAN (SoL) policy you want to associate with service profiles created from this template. |
| **state** string | **Choices:*** **present** β
* absent
| If `present`, will verify Service Profile Templates are present and will create if needed. If `absent`, will verify Service Profile Templates are absent and will delete if needed. |
| **storage\_profile** string | | The name of the storage profile you want to associate with service profiles created from this template |
| **template\_type** string | **Choices:*** **initial-template** β
* updating-template
| The template type field which can be one of the following: initial-template β Any service profiles created from this template are not updated if the template changes. updating-template β Any service profiles created from this template are updated if the template changes. |
| **threshold\_policy** string | **Default:**"default" | The name of the threshold policy you want to associate with service profiles created from this template. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **user\_label** string | | The User Label you want to assign to service profiles created from this template. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
| **uuid\_pool** string | **Default:**"default" | Specifies how the UUID will be set on a server associated with a service profile created from this template. The uuid\_pool option can be the name of the UUID pool to use or '' (the empty string). An empty string will use the UUID assigned to the server by the manufacturer, and the UUID remains unassigned until a service profile created from this template is associated with a server. At that point, the UUID is set to the UUID value assigned to the server by the manufacturer. If the service profile is later moved to a different server, the UUID is changed to match the new server." |
| **vmedia\_policy** string | | The name of the vMedia policy you want to associate with service profiles created from this template. |
Examples
--------
```
- name: Configure Service Profile Template with LAN/SAN Connectivity and all other options defaulted
cisco.ucs.ucs_service_profile_template:
hostname: 172.16.143.150
username: admin
password: password
name: DEE-Ctrl
template_type: updating-template
uuid_pool: UUID-Pool
storage_profile: DEE-StgProf
lan_connectivity_policy: Cntr-FC-Boot
iqn_pool: iSCSI-Boot-A
san_connectivity_policy: Cntr-FC-Boot
boot_policy: DEE-vMedia
maintenance_policy: default
server_pool: Container-Pool
host_firmware_package: 3.1.2b
bios_policy: Docker
- name: Remove Service Profile Template
cisco.ucs.ucs_service_profile_template:
hostname: 172.16.143.150
username: admin
password: password
name: DEE-Ctrl
state: absent
```
### Authors
* David Soper (@dsoper2)
* CiscoUcs (@CiscoUcs)
ansible cisco.ucs.ucs_system_qos β Configures system QoS settings cisco.ucs.ucs\_system\_qos β Configures system QoS settings
===========================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_system_qos`.
New in version 2.1: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Configures system QoS settings
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **admin\_state** string | **Choices:*** disabled
* **enabled** β
| Admin state of QoS Policy |
| **cos** string / required | **Choices:*** any
* 0-6
| CoS setting |
| **drop** string | **Choices:*** **drop** β
* no-drop
| Set multicast optimization options |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **mtu** string | **Choices:*** fc
* **normal** β
* 0-4294967295
| MTU size |
| **multicast\_optimize** string | **Choices:*** false
* no
* true
* yes
| Set multicast optimization options |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **priority** string / required | **Choices:*** best-effort
* bronze
* fc
* gold
* platinum
* silver
| Priority to configure |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
| **weight** string / required | **Choices:*** best-effort
* none
* 0-10
| CoS profile weight |
Examples
--------
```
- name:
cisco.ucs.ucs_system_qos:
priority: platinum
admin_state: enabled
multicast_optimize: no
cos: '5'
weight: '10'
mtu: '9216'
hostname: 192.168.99.100
username: admin
password: password
```
### Authors
* Brett Johnson (@sdbrett)
ansible cisco.ucs.ucs_scrub_policy β Manages UCS Scrub Policies on UCS Manager cisco.ucs.ucs\_scrub\_policy β Manages UCS Scrub Policies on UCS Manager
========================================================================
Note
This plugin is part of the [cisco.ucs collection](https://galaxy.ansible.com/cisco/ucs) (version 1.6.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cisco.ucs`.
To use it in a playbook, specify: `cisco.ucs.ucs_scrub_policy`.
New in version 2.9: of cisco.ucs
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Manages UCS Scrub Policies on UCS Manager.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ucsmsdk
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **bios\_settings\_scrub** string | **Choices:*** True
* False
| Scrub the BIOS settings. If the field is set to Yes, when a service profile containing this scrub policy is disassociated from a server, the BIOS settings for that server are erased and reset to the defaults for that server type and vendor. If this field is set to No, the BIOS settings are preserved. yes scrub the BIOS settings. no do not scrub the BIOS settings. |
| **description** string | | A user-defined description of the organization. Enter up to 256 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote) = (equal sign), > (greater than), < (less than), ' (single quote).
aliases: descr |
| **disk\_scrub** string | **Choices:*** True
* False
| Scrub the BIOS settings. If this field is set to Yes, when a service profile containing this scrub policy is disassociated from a server, all data on the server local drives is completely erased. If this field is set to No, the data on the local drives is preserved, including all local storage configuration. yes scrub the server disks. no do not scrub the server disks. |
| **flex\_flash\_scrub** string | **Choices:*** True
* False
| Scrub the BIOS settings. If the field is set to Yes, the HV partition on the SD card is formatted using the PNUOS formatting utility when the server is reacknowledged. If this field is set to No, the SD card is preserved. yes scrub the flex flash. no do not scrub the flex flash. |
| **hostname** string / required | | IP address or hostname of Cisco UCS Manager. Modules can be used with the UCS Platform Emulator <https://cs.co/ucspe>
|
| **name** string / required | | The name of the organization. Enter up to 16 characters. You can use any characters or spaces except the following: ` (accent mark), (backslash), ^ (carat), " (double quote) = (equal sign), > (greater than), < (less than), ' (single quote). |
| **org\_dn** string | **Default:**"org-root" | Org dn (distinguished name) |
| **password** string / required | | Password for Cisco UCS Manager authentication. |
| **persistent\_memory\_scrub** string | **Choices:*** True
* False
| Scrub the BIOS settings. If the field is set to Yes, when a service profile containing this scrub policy is disassociated from a server, all persistent memory modules for that server are erased and reset to the defaults for that server type and vendor. If this field is set to No, the persistent memory modules are preserved. yes scrub the persistent memory. no do not scrub the persistent memory. |
| **port** integer | | Port number to be used during connection (by default uses 443 for https and 80 for http connection). |
| **proxy** string | | If use\_proxy is no, specfies proxy to be used for connection. e.g. 'http://proxy.xy.z:8080' |
| **state** string | **Choices:*** absent
* **present** β
| If `absent`, will remove organization. If `present`, will create or update organization. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| If `no`, will not use the proxy as defined by system environment variable. |
| **use\_ssl** boolean | **Choices:*** no
* **yes** β
| If `no`, an HTTP connection will be used instead of the default HTTPS connection. |
| **username** string | **Default:**"admin" | Username for Cisco UCS Manager authentication. |
Examples
--------
```
- name: Add UCS Scrub Policy
cisco.ucs.ucs_scrub_policy:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: present
description: Scrub All Policy
name: all_scrub
bios_settings_scrub: yes
disk_scrub: yes
flex_flash_scrub: yes
persistent_memory_scrub: yes
delegate_to: localhost
- name: Add UCS Scrub Policy in an Organization
cisco.ucs.ucs_scrub_policy:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: present
org_dn: org-root/org-prod
name: all_scrub
description: Scrub All Policy Org Prod servers
bios_settings_scrub: yes
disk_scrub: yes
flex_flash_scrub: yes
persistent_memory_scrub: yes
delegate_to: localhost
- name: Update UCS Scrub Policy
cisco.ucs.ucs_scrub_policy:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: present
org_dn: org-root/org-prod
name: BD_scrub
description: Scrub BIOS and Disk Policy Org Prod servers
bios_settings_scrub: yes
disk_scrub: yes
flex_flash_scrub: no
persistent_memory_scrub: no
delegate_to: localhost
- name: Update UCS Scrub Policy
cisco.ucs.ucs_scrub_policy:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: present
org_dn: org-root/org-prod
name: BD_scrub
description: Scrub BIOS and Disk Policy Org Prod servers
bios_settings_scrub: yes
disk_scrub: yes
flex_flash_scrub: yes
delegate_to: localhost
- name: Delete UCS Scrub Policy
cisco.ucs.ucs_scrub_policy:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: absent
org_dn: org-root/org-prod
name: BD_scrub
delegate_to: localhost
- name: Delete UCS Scrub Policy
cisco.ucs.ucs_scrub_policy:
hostname: "{{ ucs_hostname }}"
username: "{{ ucs_username }}"
password: "{{ ucs_password }}"
state: absent
name: BD_scrub
delegate_to: localhost
```
### Authors
* John McDonough (@movinalot)
ansible Collections in the Cloudscale_ch Namespace Collections in the Cloudscale\_ch Namespace
===========================================
These are the collections with docs hosted on [docs.ansible.com](https://docs.ansible.com/) in the **cloudscale\_ch** namespace.
* [cloudscale\_ch.cloud](cloud/index#plugins-in-cloudscale-ch-cloud)
ansible Cloudscale_Ch.Cloud Cloudscale\_Ch.Cloud
====================
Collection version 2.2.0
Plugin Index
------------
These are the plugins in the cloudscale\_ch.cloud collection
### Inventory Plugins
* [inventory](inventory_inventory#ansible-collections-cloudscale-ch-cloud-inventory-inventory) β cloudscale.ch inventory source
### Modules
* [custom\_image](custom_image_module#ansible-collections-cloudscale-ch-cloud-custom-image-module) β Manage custom images on the cloudscale.ch IaaS service
* [floating\_ip](floating_ip_module#ansible-collections-cloudscale-ch-cloud-floating-ip-module) β Manages floating IPs on the cloudscale.ch IaaS service
* [network](network_module#ansible-collections-cloudscale-ch-cloud-network-module) β Manages networks on the cloudscale.ch IaaS service
* [objects\_user](objects_user_module#ansible-collections-cloudscale-ch-cloud-objects-user-module) β Manages objects users on the cloudscale.ch IaaS service
* [server](server_module#ansible-collections-cloudscale-ch-cloud-server-module) β Manages servers on the cloudscale.ch IaaS service
* [server\_group](server_group_module#ansible-collections-cloudscale-ch-cloud-server-group-module) β Manages server groups on the cloudscale.ch IaaS service
* [subnet](subnet_module#ansible-collections-cloudscale-ch-cloud-subnet-module) β Manages subnets on the cloudscale.ch IaaS service
* [volume](volume_module#ansible-collections-cloudscale-ch-cloud-volume-module) β Manages volumes on the cloudscale.ch IaaS service.
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
| programming_docs |
ansible cloudscale_ch.cloud.inventory β cloudscale.ch inventory source cloudscale\_ch.cloud.inventory β cloudscale.ch inventory source
===============================================================
Note
This plugin is part of the [cloudscale\_ch.cloud collection](https://galaxy.ansible.com/cloudscale_ch/cloud) (version 2.2.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cloudscale_ch.cloud`.
To use it in a playbook, specify: `cloudscale_ch.cloud.inventory`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Get inventory hosts from cloudscale.ch API
* Uses an YAML configuration file ending with either *cloudscale.yml* or *cloudscale.yaml* to set parameter values (also see examples).
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **ansible\_host** string | **Choices:*** **public\_v4** β
* public\_v6
* private
* none
| | Which IP address to register as the ansible\_host. If the requested value does not exist or this is set to 'none', no ansible\_host will be set. |
| **api\_token** string | | | cloudscale.ch API token. This can also be passed in the `CLOUDSCALE_API_TOKEN` environment variable. |
| **compose** dictionary | **Default:**{} | | Create vars from jinja2 expressions. |
| **groups** dictionary | **Default:**{} | | Add hosts to group based on Jinja2 conditionals. |
| **inventory\_hostname** string | **Choices:*** **name** β
* uuid
| | What to register as the inventory hostname. If set to 'uuid' the uuid of the server will be used and a group will be created for the server name. If set to 'name' the name of the server will be used unless there are more than one server with the same name in which case the 'uuid' logic will be used. |
| **keyed\_groups** list / elements=string | **Default:**[] | | Add hosts to group based on the values of a variable. |
| **leading\_separator** boolean added in 2.11 of ansible.builtin | **Choices:*** no
* **yes** β
| | Use in conjunction with keyed\_groups. By default, a keyed group that does not have a prefix or a separator provided will have a name that starts with an underscore. This is because the default prefix is "" and the default separator is "\_". Set this option to False to omit the leading underscore (or other separator) if no prefix is given. If the group name is derived from a mapping the separator is still used to concatenate the items. To not use a separator in the group name at all, set the separator for the keyed group to an empty string instead. |
| **plugin** string / required | **Choices:*** cloudscale
| | Token that ensures this is a source file for the 'cloudscale' plugin. |
| **strict** boolean | **Choices:*** **no** β
* yes
| | If `yes` make invalid entries a fatal error, otherwise skip and continue. Since it is possible to use facts in the expressions they might not always be available and we ignore those errors by default. |
| **use\_extra\_vars** boolean added in 2.11 of ansible.builtin | **Choices:*** **no** β
* yes
| ini entries: [inventory\_plugins]use\_extra\_vars = no env:ANSIBLE\_INVENTORY\_USE\_EXTRA\_VARS | Merge extra vars into the available variables for composition (highest precedence). |
Examples
--------
```
# cloudscale.yml name ending file in YAML format
# Example command line: ansible-inventory --list -i inventory_cloudscale.yml
plugin: cloudscale_ch.cloud.inventory
# Example grouping by tag key "project"
plugin: cloudscale_ch.cloud.inventory
keyed_groups:
- prefix: project
key: cloudscale.tags.project
# Example grouping by key "operating_system" lowercased and prefixed with "os"
plugin: cloudscale_ch.cloud.inventory
keyed_groups:
- prefix: os
key: cloudscale.image.operating_system | lower
```
### Authors
* Gaudenz Steinlin (@gaudenz)
ansible cloudscale_ch.cloud.volume β Manages volumes on the cloudscale.ch IaaS service. cloudscale\_ch.cloud.volume β Manages volumes on the cloudscale.ch IaaS service.
================================================================================
Note
This plugin is part of the [cloudscale\_ch.cloud collection](https://galaxy.ansible.com/cloudscale_ch/cloud) (version 2.2.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cloudscale_ch.cloud`.
To use it in a playbook, specify: `cloudscale_ch.cloud.volume`.
New in version 1.0.0: of cloudscale\_ch.cloud
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, attach/detach, update and delete volumes on the cloudscale.ch IaaS service.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_timeout** integer | **Default:**45 | Timeout in seconds for calls to the cloudscale.ch API. This can also be passed in the `CLOUDSCALE_API_TIMEOUT` environment variable. |
| **api\_token** string / required | | cloudscale.ch API token. This can also be passed in the `CLOUDSCALE_API_TOKEN` environment variable. |
| **api\_url** string added in 1.3.0 of cloudscale\_ch.cloud | **Default:**"https://api.cloudscale.ch/v1" | cloudscale.ch API URL. This can also be passed in the `CLOUDSCALE_API_URL` environment variable. |
| **name** string | | Name of the volume. Either name or UUID must be present to change an existing volume. |
| **servers** list / elements=string | | UUIDs of the servers this volume is attached to. Set this to `[]` to detach the volume. Currently a volume can only be attached to a single server. The aliases `server_uuids` and `server_uuid` are deprecated and will be removed in version 3.0.0 of this collection.
aliases: server\_uuids, server\_uuid |
| **size\_gb** integer | | Size of the volume in GB. |
| **state** string | **Choices:*** **present** β
* absent
| State of the volume. |
| **tags** dictionary | | Tags associated with the volume. Set this to `{}` to clear any tags. |
| **type** string | **Choices:*** ssd
* bulk
| Type of the volume. Cannot be changed after creating the volume. Defaults to `ssd` on volume creation. |
| **uuid** string | | UUID of the volume. Either name or UUID must be present to change an existing volume. |
| **zone** string | | Zone in which the volume resides (e.g. `lgp1` or `rma1`). Cannot be changed after creating the volume. Defaults to the project default zone. |
Notes
-----
Note
* To create a new volume at least the *name* and *size\_gb* options are required.
* A volume can be created and attached to a server in the same task.
* All operations are performed using the cloudscale.ch public API v1.
* For details consult the full API documentation: <https://www.cloudscale.ch/en/api/v1>.
* A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at <https://control.cloudscale.ch>.
Examples
--------
```
# Create a new SSD volume
- name: Create an SSD volume
cloudscale_ch.cloud.volume:
name: my_ssd_volume
zone: 'lpg1'
size_gb: 50
api_token: xxxxxx
register: my_ssd_volume
# Attach an existing volume to a server
- name: Attach volume to server
cloudscale_ch.cloud.volume:
uuid: "{{ my_ssd_volume.uuid }}"
servers:
- ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
api_token: xxxxxx
# Create and attach a volume to a server
- name: Create and attach volume to server
cloudscale_ch.cloud.volume:
name: my_ssd_volume
zone: 'lpg1'
size_gb: 50
servers:
- ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
api_token: xxxxxx
# Detach volume from server
- name: Detach volume from server
cloudscale_ch.cloud.volume:
uuid: "{{ my_ssd_volume.uuid }}"
servers: []
api_token: xxxxxx
# Delete a volume
- name: Delete volume
cloudscale_ch.cloud.volume:
name: my_ssd_volume
state: absent
api_token: xxxxxx
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **href** string | state == present | The API URL to get details about this volume. **Sample:** https://api.cloudscale.ch/v1/volumes/2db69ba3-1864-4608-853a-0771b6885a3a |
| **name** string | state == present | The display name of the volume. **Sample:** my\_ssd\_volume |
| **server\_uuids** list / elements=string | state == present | The UUIDs of the servers this volume is attached to. This return value is deprecated and will disappear in the future when the field is removed from the API. **Sample:** ['47cec963-fcd2-482f-bdb6-24461b2d47b1'] |
| **servers** list / elements=string | state == present | The list of servers this volume is attached to. **Sample:** [{'href': 'https://api.cloudscale.ch/v1/servers/47cec963-fcd2-482f-bdb6-24461b2d47b1', 'name': 'my\_server', 'uuid': '47cec963-fcd2-482f-bdb6-24461b2d47b1'}] |
| **size\_gb** string | state == present | The size of the volume in GB. **Sample:** 50 |
| **state** string | success | The current status of the volume. **Sample:** present |
| **tags** dictionary | state == present | Tags associated with the volume. **Sample:** {'project': 'my project'} |
| **type** string | state == present | The type of the volume. **Sample:** bulk |
| **uuid** string | state == present | The unique identifier for this volume. **Sample:** 2db69ba3-1864-4608-853a-0771b6885a3a |
| **zone** dictionary | state == present | The zone of the volume. **Sample:** {'slug': 'lpg1'} |
### Authors
* Gaudenz Steinlin (@gaudenz)
* RenΓ© Moser (@resmo)
* Denis KrienbΓΌhl (@href)
ansible cloudscale_ch.cloud.server β Manages servers on the cloudscale.ch IaaS service cloudscale\_ch.cloud.server β Manages servers on the cloudscale.ch IaaS service
===============================================================================
Note
This plugin is part of the [cloudscale\_ch.cloud collection](https://galaxy.ansible.com/cloudscale_ch/cloud) (version 2.2.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cloudscale_ch.cloud`.
To use it in a playbook, specify: `cloudscale_ch.cloud.server`.
New in version 1.0.0: of cloudscale\_ch.cloud
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update, start, stop and delete servers on the cloudscale.ch IaaS service.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_timeout** integer | **Default:**45 | Timeout in seconds for calls to the cloudscale.ch API. This can also be passed in the `CLOUDSCALE_API_TIMEOUT` environment variable. |
| **api\_token** string / required | | cloudscale.ch API token. This can also be passed in the `CLOUDSCALE_API_TOKEN` environment variable. |
| **api\_url** string added in 1.3.0 of cloudscale\_ch.cloud | **Default:**"https://api.cloudscale.ch/v1" | cloudscale.ch API URL. This can also be passed in the `CLOUDSCALE_API_URL` environment variable. |
| **bulk\_volume\_size\_gb** integer | | Size of the bulk storage volume in GB. No bulk storage volume if not set. |
| **flavor** string | | Flavor of the server. |
| **force** boolean | **Choices:*** **no** β
* yes
| Allow to stop the running server for updating if necessary. |
| **image** string | | Image used to create the server. |
| **interfaces** list / elements=dictionary added in 1.4.0 of cloudscale\_ch.cloud | | List of network interface objects specifying the interfaces to be attached to the server. See <https://www.cloudscale.ch/en/api/v1/#interfaces-attribute-specification> for more details. |
| | **addresses** list / elements=dictionary | | Attach a private network interface and configure a subnet and/or an IP address. |
| | | **address** string | | The static IP address of the interface. Use '[]' to avoid assigning an IP address via DHCP. |
| | | **subnet** string | | UUID of the subnet from which an address will be assigned. |
| | **network** string | | Create a network interface on the network identified by UUID. Use 'public' instead of an UUID to attach a public network interface. Can be omitted if a subnet is provided under addresses. |
| **name** string | | Name of the Server. Either *name* or *uuid* are required. |
| **password** string | | Password for the server. |
| **server\_groups** list / elements=string | | List of UUID or names of server groups. |
| **ssh\_keys** list / elements=string | | List of SSH public keys. Use the full content of your .pub file here. |
| **state** string | **Choices:*** **running** β
* stopped
* absent
| State of the server. |
| **tags** dictionary | | Tags assosiated with the servers. Set this to `{}` to clear any tags. |
| **use\_ipv6** boolean | **Choices:*** no
* **yes** β
| Enable IPv6 on the public network interface. |
| **use\_private\_network** boolean | **Choices:*** no
* yes
| Attach a private network interface to the server. |
| **use\_public\_network** boolean | **Choices:*** no
* yes
| Attach a public network interface to the server. |
| **user\_data** string | | Cloud-init configuration (cloud-config) data to use for the server. |
| **uuid** string | | UUID of the server. Either *name* or *uuid* are required. |
| **volume\_size\_gb** integer | **Default:**10 | Size of the root volume in GB. |
| **zone** string | | Zone in which the server resides (e.g. `lgp1` or `rma1`). |
Notes
-----
Note
* If *uuid* option is provided, it takes precedence over *name* for server selection. This allows to update the serverβs name.
* If no *uuid* option is provided, *name* is used for server selection. If more than one server with this name exists, execution is aborted.
* Only the *name* and *flavor* are evaluated for the update.
* The option *force=true* must be given to allow the reboot of existing running servers for applying the changes.
* All operations are performed using the cloudscale.ch public API v1.
* For details consult the full API documentation: <https://www.cloudscale.ch/en/api/v1>.
* A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at <https://control.cloudscale.ch>.
Examples
--------
```
# Create and start a server with an existing server group (shiny-group)
- name: Start cloudscale.ch server
cloudscale_ch.cloud.server:
name: my-shiny-cloudscale-server
image: debian-10
flavor: flex-4
ssh_keys: ssh-rsa XXXXXXXXXX...XXXX ansible@cloudscale
server_groups: shiny-group
zone: lpg1
use_private_network: True
bulk_volume_size_gb: 100
api_token: xxxxxx
# Start another server in anti-affinity (server group shiny-group)
- name: Start second cloudscale.ch server
cloudscale_ch.cloud.server:
name: my-other-shiny-server
image: ubuntu-16.04
flavor: flex-8
ssh_keys: ssh-rsa XXXXXXXXXXX ansible@cloudscale
server_groups: shiny-group
zone: lpg1
api_token: xxxxxx
# Force to update the flavor of a running server
- name: Start cloudscale.ch server
cloudscale_ch.cloud.server:
name: my-shiny-cloudscale-server
image: debian-10
flavor: flex-8
force: yes
ssh_keys: ssh-rsa XXXXXXXXXX...XXXX ansible@cloudscale
use_private_network: True
bulk_volume_size_gb: 100
api_token: xxxxxx
register: server1
# Stop the first server
- name: Stop my first server
cloudscale_ch.cloud.server:
uuid: '{{ server1.uuid }}'
state: stopped
api_token: xxxxxx
# Delete my second server
- name: Delete my second server
cloudscale_ch.cloud.server:
name: my-other-shiny-server
state: absent
api_token: xxxxxx
# Start a server and wait for the SSH host keys to be generated
- name: Start server and wait for SSH host keys
cloudscale_ch.cloud.server:
name: my-cloudscale-server-with-ssh-key
image: debian-10
flavor: flex-4
ssh_keys: ssh-rsa XXXXXXXXXXX ansible@cloudscale
api_token: xxxxxx
register: server
until: server is not failed
retries: 5
delay: 2
# Start a server with two network interfaces:
#
# A public interface with IPv4/IPv6
# A private interface on a specific private network with an IPv4 address
- name: Start a server with a public and private network interface
cloudscale_ch.cloud.server:
name: my-cloudscale-server-with-two-network-interfaces
image: debian-10
flavor: flex-4
ssh_keys: ssh-rsa XXXXXXXXXXX ansible@cloudscale
api_token: xxxxxx
interfaces:
- network: 'public'
- addresses:
- subnet: UUID_of_private_subnet
# Start a server with a specific IPv4 address from subnet range
- name: Start a server with a specific IPv4 address from subnet range
cloudscale_ch.cloud.server:
name: my-cloudscale-server-with-specific-address
image: debian-10
flavor: flex-4
ssh_keys: ssh-rsa XXXXXXXXXXX ansible@cloudscale
api_token: xxxxxx
interfaces:
- addresses:
- subnet: UUID_of_private_subnet
address: 'A.B.C.D'
# Start a server with two network interfaces:
#
# A public interface with IPv4/IPv6
# A private interface on a specific private network with no IPv4 address
- name: Start a server with a private network interface and no IP address
cloudscale_ch.cloud.server:
name: my-cloudscale-server-with-specific-address
image: debian-10
flavor: flex-4
ssh_keys: ssh-rsa XXXXXXXXXXX ansible@cloudscale
api_token: xxxxxx
interfaces:
- network: 'public'
- network: UUID_of_private_network
addresses: []
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **flavor** dictionary | success when not state == absent | The flavor that has been used for this server **Sample:** {'memory\_gb': 4, 'name': 'Flex-4', 'slug': 'flex-4', 'vcpu\_count': 2} |
| **href** string | success when not state == absent | API URL to get details about this server **Sample:** https://api.cloudscale.ch/v1/servers/cfde831a-4e87-4a75-960f-89b0148aa2cc |
| **image** dictionary | success when not state == absent | The image used for booting this server **Sample:** {'default\_username': 'ubuntu', 'name': 'Ubuntu 18.04 LTS', 'operating\_system': 'Ubuntu', 'slug': 'ubuntu-18.04'} |
| **interfaces** list / elements=string | success when not state == absent | List of network ports attached to the server **Sample:** [{'addresses': ['...'], 'type': 'public'}] |
| **name** string | success | The display name of the server **Sample:** its-a-me-mario.cloudscale.ch |
| **server\_groups** list / elements=string | success when not state == absent | List of server groups **Sample:** [{'href': 'https://api.cloudscale.ch/v1/server-groups/...', 'name': 'db-group', 'uuid': '...'}] |
| **ssh\_fingerprints** list / elements=string | success when not state == absent | A list of SSH host key fingerprints. Will be null until the host keys could be retrieved from the server. **Sample:** ['ecdsa-sha2-nistp256 SHA256:XXXX', '...'] |
| **ssh\_host\_keys** list / elements=string | success when not state == absent | A list of SSH host keys. Will be null until the host keys could be retrieved from the server. **Sample:** ['ecdsa-sha2-nistp256 XXXXX', '...'] |
| **state** string | success | The current status of the server **Sample:** running |
| **tags** dictionary | success | Tags assosiated with the server. **Sample:** {'project': 'my project'} |
| **uuid** string | success | The unique identifier for this server **Sample:** cfde831a-4e87-4a75-960f-89b0148aa2cc |
| **volumes** list / elements=string | success when not state == absent | List of volumes attached to the server **Sample:** [{'device': '/dev/vda', 'size\_gb': '50', 'type': 'ssd'}] |
| **zone** dictionary | success when not state == absent | The zone used for booting this server **Sample:** {'slug': 'lpg1'} |
### Authors
* Gaudenz Steinlin (@gaudenz)
* RenΓ© Moser (@resmo)
* Denis KrienbΓΌhl (@href)
| programming_docs |
ansible cloudscale_ch.cloud.floating_ip β Manages floating IPs on the cloudscale.ch IaaS service cloudscale\_ch.cloud.floating\_ip β Manages floating IPs on the cloudscale.ch IaaS service
==========================================================================================
Note
This plugin is part of the [cloudscale\_ch.cloud collection](https://galaxy.ansible.com/cloudscale_ch/cloud) (version 2.2.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cloudscale_ch.cloud`.
To use it in a playbook, specify: `cloudscale_ch.cloud.floating_ip`.
New in version 1.0.0: of cloudscale\_ch.cloud
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, assign and delete floating IPs on the cloudscale.ch IaaS service.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_timeout** integer | **Default:**45 | Timeout in seconds for calls to the cloudscale.ch API. This can also be passed in the `CLOUDSCALE_API_TIMEOUT` environment variable. |
| **api\_token** string / required | | cloudscale.ch API token. This can also be passed in the `CLOUDSCALE_API_TOKEN` environment variable. |
| **api\_url** string added in 1.3.0 of cloudscale\_ch.cloud | **Default:**"https://api.cloudscale.ch/v1" | cloudscale.ch API URL. This can also be passed in the `CLOUDSCALE_API_URL` environment variable. |
| **ip\_version** integer | **Choices:*** 4
* 6
| IP protocol version of the floating IP. Required when assigning a new floating IP. |
| **name** string added in 1.3.0 of cloudscale\_ch.cloud | | Name to identifiy the floating IP address for idempotency. One of *network* or *name* is required to identify the floating IP. Required for assigning a new floating IP. |
| **network** string | | Floating IP address to change. One of *network* or *name* is required to identify the floating IP.
aliases: ip |
| **prefix\_length** integer | **Choices:*** 56
| Only valid if *ip\_version* is 6. Prefix length for the IPv6 network. Currently only a prefix of /56 can be requested. If no *prefix\_length* is present, a single address is created. |
| **region** string | | Region in which the floating IP resides (e.g. `lgp` or `rma`). If omitted, the region of the project default zone is used. This parameter must be omitted if *type* is set to `global`. |
| **reverse\_ptr** string | | Reverse PTR entry for this address. You cannot set a reverse PTR entry for IPv6 floating networks. Reverse PTR entries are only allowed for single addresses. |
| **server** string | | UUID of the server assigned to this floating IP. |
| **state** string | **Choices:*** **present** β
* absent
| State of the floating IP. |
| **tags** dictionary added in 1.1.0 of cloudscale\_ch.cloud | | Tags associated with the floating IP. Set this to `{}` to clear any tags. |
| **type** string | **Choices:*** **regional** β
* global
| The type of the floating IP. |
Notes
-----
Note
* Once a floating\_ip is created, all parameters except `server`, `reverse_ptr` and `tags` are read-only.
* All operations are performed using the cloudscale.ch public API v1.
* For details consult the full API documentation: <https://www.cloudscale.ch/en/api/v1>.
* A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at <https://control.cloudscale.ch>.
Examples
--------
```
# Request a new floating IP without assignment to a server
- name: Request a floating IP
cloudscale_ch.cloud.floating_ip:
name: IP to my server
ip_version: 4
reverse_ptr: my-server.example.com
api_token: xxxxxx
# Request a new floating IP with assignment
- name: Request a floating IP
cloudscale_ch.cloud.floating_ip:
name: web
ip_version: 4
server: 47cec963-fcd2-482f-bdb6-24461b2d47b1
reverse_ptr: my-server.example.com
api_token: xxxxxx
# Assign an existing floating IP to a different server by its IP address
- name: Move floating IP to backup server
cloudscale_ch.cloud.floating_ip:
ip: 192.0.2.123
server: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
api_token: xxxxxx
# Assign an existing floating IP to a different server by name
- name: Move floating IP to backup server
cloudscale_ch.cloud.floating_ip:
name: IP to my server
server: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
api_token: xxxxxx
# Request a new floating IPv6 network
- name: Request a floating IP
cloudscale_ch.cloud.floating_ip:
name: IPv6 to my server
ip_version: 6
prefix_length: 56
server: 47cec963-fcd2-482f-bdb6-24461b2d47b1
api_token: xxxxxx
region: lpg1
# Assign an existing floating network to a different server
- name: Move floating IP to backup server
cloudscale_ch.cloud.floating_ip:
ip: '{{ floating_ip.ip }}'
server: ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
api_token: xxxxxx
# Remove a floating IP
- name: Release floating IP
cloudscale_ch.cloud.floating_ip:
ip: 192.0.2.123
state: absent
api_token: xxxxxx
# Remove a floating IP by name
- name: Release floating IP
cloudscale_ch.cloud.floating_ip:
name: IP to my server
state: absent
api_token: xxxxxx
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **href** string | success when state == present | The API URL to get details about this floating IP. **Sample:** https://api.cloudscale.ch/v1/floating-ips/2001:db8::cafe |
| **ip** string | success when state == present | The floating IP address. **Sample:** 185.98.122.176 |
| **name** string added in 1.3.0 of cloudscale\_ch.cloud | success | The name of the floating IP. **Sample:** my floating ip |
| **network** string | success | The CIDR notation of the network that is routed to your server. **Sample:** 2001:db8::cafe/128 |
| **next\_hop** string | success when state == present | Your floating IP is routed to this IP address. **Sample:** 2001:db8:dead:beef::42 |
| **region** dictionary | success when state == present | The region of the floating IP. **Sample:** {'slug': 'lpg'} |
| **reverse\_ptr** string | success when state == present | The reverse pointer for this floating IP address. **Sample:** 185-98-122-176.cust.cloudscale.ch |
| **server** string | success when state == present | The floating IP is routed to this server. **Sample:** 47cec963-fcd2-482f-bdb6-24461b2d47b1 |
| **state** string | success | The current status of the floating IP. **Sample:** present |
| **tags** dictionary added in 1.1.0 of cloudscale\_ch.cloud | success | Tags assosiated with the floating IP. **Sample:** {'project': 'my project'} |
### Authors
* Gaudenz Steinlin (@gaudenz)
* Denis KrienbΓΌhl (@href)
* RenΓ© Moser (@resmo)
ansible cloudscale_ch.cloud.server_group β Manages server groups on the cloudscale.ch IaaS service cloudscale\_ch.cloud.server\_group β Manages server groups on the cloudscale.ch IaaS service
============================================================================================
Note
This plugin is part of the [cloudscale\_ch.cloud collection](https://galaxy.ansible.com/cloudscale_ch/cloud) (version 2.2.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cloudscale_ch.cloud`.
To use it in a playbook, specify: `cloudscale_ch.cloud.server_group`.
New in version 1.0.0: of cloudscale\_ch.cloud
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and remove server groups.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_timeout** integer | **Default:**45 | Timeout in seconds for calls to the cloudscale.ch API. This can also be passed in the `CLOUDSCALE_API_TIMEOUT` environment variable. |
| **api\_token** string / required | | cloudscale.ch API token. This can also be passed in the `CLOUDSCALE_API_TOKEN` environment variable. |
| **api\_url** string added in 1.3.0 of cloudscale\_ch.cloud | **Default:**"https://api.cloudscale.ch/v1" | cloudscale.ch API URL. This can also be passed in the `CLOUDSCALE_API_URL` environment variable. |
| **name** string | | Name of the server group. Either *name* or *uuid* is required. These options are mutually exclusive. |
| **state** string | **Choices:*** **present** β
* absent
| State of the server group. |
| **tags** dictionary | | Tags assosiated with the server groups. Set this to `{}` to clear any tags. |
| **type** string | **Default:**"anti-affinity" | Type of the server group. |
| **uuid** string | | UUID of the server group. Either *name* or *uuid* is required. These options are mutually exclusive. |
| **zone** string | | Zone slug of the server group (e.g. `lgp1` or `rma1`). |
Notes
-----
Note
* All operations are performed using the cloudscale.ch public API v1.
* For details consult the full API documentation: <https://www.cloudscale.ch/en/api/v1>.
* A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at <https://control.cloudscale.ch>.
Examples
--------
```
---
- name: Ensure server group exists
cloudscale_ch.cloud.server_group:
name: my-name
type: anti-affinity
api_token: xxxxxx
- name: Ensure server group in a specific zone
cloudscale_ch.cloud.server_group:
name: my-rma-group
type: anti-affinity
zone: lpg1
api_token: xxxxxx
- name: Ensure a server group is absent
cloudscale_ch.cloud.server_group:
name: my-name
state: absent
api_token: xxxxxx
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **href** string | if available | API URL to get details about this server group **Sample:** https://api.cloudscale.ch/v1/server-group/cfde831a-4e87-4a75-960f-89b0148aa2cc |
| **name** string | always | The display name of the server group **Sample:** load balancers |
| **servers** list / elements=string | if available | A list of servers that are part of the server group. |
| **state** string | always | State of the server group. **Sample:** present |
| **tags** dictionary | success | Tags assosiated with the server group. **Sample:** {'project': 'my project'} |
| **type** string | if available | The type the server group **Sample:** anti-affinity |
| **uuid** string | always | The unique identifier for this server **Sample:** cfde831a-4e87-4a75-960f-89b0148aa2cc |
| **zone** dictionary | success | The zone of the server group **Sample:** {'slug': 'rma1'} |
### Authors
* RenΓ© Moser (@resmo)
* Denis KrienbΓΌhl (@href)
ansible cloudscale_ch.cloud.objects_user β Manages objects users on the cloudscale.ch IaaS service cloudscale\_ch.cloud.objects\_user β Manages objects users on the cloudscale.ch IaaS service
============================================================================================
Note
This plugin is part of the [cloudscale\_ch.cloud collection](https://galaxy.ansible.com/cloudscale_ch/cloud) (version 2.2.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cloudscale_ch.cloud`.
To use it in a playbook, specify: `cloudscale_ch.cloud.objects_user`.
New in version 1.1.0: of cloudscale\_ch.cloud
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and remove objects users cloudscale.ch IaaS service.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_timeout** integer | **Default:**45 | Timeout in seconds for calls to the cloudscale.ch API. This can also be passed in the `CLOUDSCALE_API_TIMEOUT` environment variable. |
| **api\_token** string / required | | cloudscale.ch API token. This can also be passed in the `CLOUDSCALE_API_TOKEN` environment variable. |
| **api\_url** string added in 1.3.0 of cloudscale\_ch.cloud | **Default:**"https://api.cloudscale.ch/v1" | cloudscale.ch API URL. This can also be passed in the `CLOUDSCALE_API_URL` environment variable. |
| **display\_name** string | | Display name of the objects user. Either *display\_name* or *id* is required.
aliases: name |
| **id** string | | Name of the objects user. Either *display\_name* or *id* is required. |
| **state** string | **Choices:*** **present** β
* absent
| State of the objects user. |
| **tags** dictionary | | Tags associated with the objects user. Set this to `{}` to clear any tags. |
Notes
-----
Note
* All operations are performed using the cloudscale.ch public API v1.
* For details consult the full API documentation: <https://www.cloudscale.ch/en/api/v1>.
* A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at <https://control.cloudscale.ch>.
Examples
--------
```
- name: Create an objects user
cloudscale_ch.cloud.objects_user:
display_name: alan
tags:
project: luna
api_token: xxxxxx
register: object_user
- name: print keys
debug:
var: object_user.keys
- name: Update an objects user
cloudscale_ch.cloud.objects_user:
display_name: alan
tags:
project: gemini
api_token: xxxxxx
- name: Remove an objects user
cloudscale_ch.cloud.objects_user:
display_name: alan
state: absent
api_token: xxxxxx
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **display\_name** string | success | The display name of the objects user. **Sample:** alan |
| **href** string | success when state == present | The API URL to get details about this resource. **Sample:** https://api.cloudscale.ch/v1/objects-users/6fe39134bf4178747eebc429f82cfafdd08891d4279d0d899bc4012db1db6a15 |
| **id** string | success | The ID of the objects user. **Sample:** 6fe39134bf4178747eebc429f82cfafdd08891d4279d0d899bc4012db1db6a15 |
| **keys** complex | success | List of key objects. |
| | **access\_key** string | success | The access key. **Sample:** 0ZTAIBKSGYBRHQ09G11W |
| | **secret\_key** string | success | The secret key. **Sample:** bn2ufcwbIa0ARLc5CLRSlVaCfFxPHOpHmjKiH34T |
| **state** string | success | The current status of the objects user. **Sample:** present |
| **tags** dictionary | success | Tags assosiated with the objects user. **Sample:** {'project': 'my project'} |
### Authors
* Rene Moser (@resmo)
ansible cloudscale_ch.cloud.subnet β Manages subnets on the cloudscale.ch IaaS service cloudscale\_ch.cloud.subnet β Manages subnets on the cloudscale.ch IaaS service
===============================================================================
Note
This plugin is part of the [cloudscale\_ch.cloud collection](https://galaxy.ansible.com/cloudscale_ch/cloud) (version 2.2.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cloudscale_ch.cloud`.
To use it in a playbook, specify: `cloudscale_ch.cloud.subnet`.
New in version 1.3.0: of cloudscale\_ch.cloud
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and remove subnets.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_timeout** integer | **Default:**45 | Timeout in seconds for calls to the cloudscale.ch API. This can also be passed in the `CLOUDSCALE_API_TIMEOUT` environment variable. |
| **api\_token** string / required | | cloudscale.ch API token. This can also be passed in the `CLOUDSCALE_API_TOKEN` environment variable. |
| **api\_url** string added in 1.3.0 of cloudscale\_ch.cloud | **Default:**"https://api.cloudscale.ch/v1" | cloudscale.ch API URL. This can also be passed in the `CLOUDSCALE_API_URL` environment variable. |
| **cidr** string | | The cidr of the subnet. Required if *state=present*. |
| **dns\_servers** list / elements=string | | A list of DNS resolver IP addresses, that act as DNS servers. If not set, the cloudscale.ch default resolvers are used. |
| **gateway\_address** string | | The gateway address of the subnet. If not set, no gateway is used. Cannot be within the DHCP range, which is the lowest .101-.254 in the subnet. |
| **network** dictionary | | The name of the network the subnet is related to. Required if *state=present*. |
| | **name** string | | The uuid of the network. |
| | **uuid** string | | The uuid of the network. |
| | **zone** string | | The zone the network allocated in. |
| **reset** boolean | **Choices:*** **no** β
* yes
| Resets *gateway\_address* and *dns\_servers* to default values by the API. Note: Idempotency is not given. |
| **state** string | **Choices:*** **present** β
* absent
| State of the subnet. |
| **tags** dictionary | | Tags associated with the subnet. Set this to `{}` to clear any tags. |
| **uuid** string | | UUID of the subnet. |
Notes
-----
Note
* All operations are performed using the cloudscale.ch public API v1.
* For details consult the full API documentation: <https://www.cloudscale.ch/en/api/v1>.
* A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at <https://control.cloudscale.ch>.
Examples
--------
```
---
- name: Ensure subnet exists
cloudscale_ch.cloud.subnet:
cidr: 172.16.0.0/24
network:
uuid: 2db69ba3-1864-4608-853a-0771b6885a3a
api_token: xxxxxx
- name: Ensure subnet exists
cloudscale_ch.cloud.subnet:
cidr: 192.168.1.0/24
gateway_address: 192.168.1.1
dns_servers:
- 192.168.1.10
- 192.168.1.11
network:
name: private
zone: lpg1
api_token: xxxxxx
- name: Ensure a subnet is absent
cloudscale_ch.cloud.subnet:
cidr: 172.16.0.0/24
network:
name: private
zone: lpg1
state: absent
api_token: xxxxxx
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **cidr** string | success | The CIDR of the subnet. **Sample:** 172.16.0.0/24 |
| **dns\_servers** list / elements=string | success | List of DNS resolver IP addresses. **Sample:** ['9.9.9.9', '149.112.112.112'] |
| **gateway\_address** string | success | The gateway address of the subnet. **Sample:** 192.168.42.1 |
| **href** string | success | API URL to get details about the subnet. **Sample:** https://api.cloudscale.ch/v1/subnets/33333333-1864-4608-853a-0771b6885a3 |
| **network** complex | success | The network object of the subnet. |
| | **href** string | success | API URL to get details about the network. **Sample:** https://api.cloudscale.ch/v1/networks/33333333-1864-4608-853a-0771b6885a3 |
| | **name** string | success | The name of the network. **Sample:** my network |
| | **uuid** string | success | The unique identifier for the network. **Sample:** 33333333-1864-4608-853a-0771b6885a3 |
| | **zone** dictionary added in 1.4.0 of cloudscale\_ch.cloud | success | The zone the network is allocated in. **Sample:** {'slug': 'rma1'} |
| **state** string | success | State of the subnet. **Sample:** present |
| **tags** dictionary | success | Tags associated with the subnet. **Sample:** {'project': 'my project'} |
| **uuid** string | success | The unique identifier for the subnet. **Sample:** 33333333-1864-4608-853a-0771b6885a3 |
### Authors
* RenΓ© Moser (@resmo)
| programming_docs |
ansible cloudscale_ch.cloud.network β Manages networks on the cloudscale.ch IaaS service cloudscale\_ch.cloud.network β Manages networks on the cloudscale.ch IaaS service
=================================================================================
Note
This plugin is part of the [cloudscale\_ch.cloud collection](https://galaxy.ansible.com/cloudscale_ch/cloud) (version 2.2.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cloudscale_ch.cloud`.
To use it in a playbook, specify: `cloudscale_ch.cloud.network`.
New in version 1.2.0: of cloudscale\_ch.cloud
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Create, update and remove networks.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_timeout** integer | **Default:**45 | Timeout in seconds for calls to the cloudscale.ch API. This can also be passed in the `CLOUDSCALE_API_TIMEOUT` environment variable. |
| **api\_token** string / required | | cloudscale.ch API token. This can also be passed in the `CLOUDSCALE_API_TOKEN` environment variable. |
| **api\_url** string added in 1.3.0 of cloudscale\_ch.cloud | **Default:**"https://api.cloudscale.ch/v1" | cloudscale.ch API URL. This can also be passed in the `CLOUDSCALE_API_URL` environment variable. |
| **auto\_create\_ipv4\_subnet** boolean | **Choices:*** no
* **yes** β
| Whether to automatically create an IPv4 subnet in the network or not. |
| **mtu** integer | **Default:**9000 | The MTU of the network. |
| **name** string | | Name of the network. Either *name* or *uuid* is required. |
| **state** string | **Choices:*** **present** β
* absent
| State of the network. |
| **tags** dictionary | | Tags assosiated with the networks. Set this to `{}` to clear any tags. |
| **uuid** string | | UUID of the network. Either *name* or *uuid* is required. |
| **zone** string | | Zone slug of the network (e.g. `lgp1` or `rma1`). |
Notes
-----
Note
* All operations are performed using the cloudscale.ch public API v1.
* For details consult the full API documentation: <https://www.cloudscale.ch/en/api/v1>.
* A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at <https://control.cloudscale.ch>.
Examples
--------
```
---
- name: Ensure network exists
cloudscale_ch.cloud.network:
name: my network
api_token: xxxxxx
- name: Ensure network in a specific zone
cloudscale_ch.cloud.network:
name: my network
zone: lpg1
api_token: xxxxxx
- name: Ensure a network is absent
cloudscale_ch.cloud.network:
name: my network
state: absent
api_token: xxxxxx
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **created\_at** string | success | The creation date and time of the network. **Sample:** 2019-05-29T13:18:42.511407Z |
| **href** string | success | API URL to get details about this network. **Sample:** https://api.cloudscale.ch/v1/networks/cfde831a-4e87-4a75-960f-89b0148aa2cc |
| **mtu** integer | success | The MTU of the network. **Sample:** 9000 |
| **name** string | success | The name of the network. **Sample:** my network |
| **state** string | success | State of the network. **Sample:** present |
| **subnets** complex | success | A list of subnets objects of the network. |
| | **cidr** string | success | The CIDR of the subnet. **Sample:** 172.16.0.0/24 |
| | **href** string | success | API URL to get details about the subnet. **Sample:** https://api.cloudscale.ch/v1/subnets/33333333-1864-4608-853a-0771b6885a3 |
| | **uuid** string | success | The unique identifier for the subnet. **Sample:** 33333333-1864-4608-853a-0771b6885a3 |
| **tags** dictionary | success | Tags assosiated with the network. **Sample:** {'project': 'my project'} |
| **uuid** string | success | The unique identifier for the network. **Sample:** cfde831a-4e87-4a75-960f-89b0148aa2cc |
| **zone** dictionary | success | The zone of the network. **Sample:** {'slug': 'rma1'} |
### Authors
* RenΓ© Moser (@resmo)
ansible cloudscale_ch.cloud.custom_image β Manage custom images on the cloudscale.ch IaaS service cloudscale\_ch.cloud.custom\_image β Manage custom images on the cloudscale.ch IaaS service
===========================================================================================
Note
This plugin is part of the [cloudscale\_ch.cloud collection](https://galaxy.ansible.com/cloudscale_ch/cloud) (version 2.2.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install cloudscale_ch.cloud`.
To use it in a playbook, specify: `cloudscale_ch.cloud.custom_image`.
New in version 2.2.0: of cloudscale\_ch.cloud
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Import, modify and delete custom images.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **api\_timeout** integer | **Default:**45 | Timeout in seconds for calls to the cloudscale.ch API. This can also be passed in the `CLOUDSCALE_API_TIMEOUT` environment variable. |
| **api\_token** string / required | | cloudscale.ch API token. This can also be passed in the `CLOUDSCALE_API_TOKEN` environment variable. |
| **api\_url** string added in 1.3.0 of cloudscale\_ch.cloud | **Default:**"https://api.cloudscale.ch/v1" | cloudscale.ch API URL. This can also be passed in the `CLOUDSCALE_API_URL` environment variable. |
| **force\_retry** boolean | **Choices:*** **no** β
* yes
| Retry the image import even if a failed import using the same name and URL already exists. This is necessary to recover from download errors. |
| **name** string | | The human readable name of the custom image. Either name or UUID must be present to change an existing image. |
| **slug** string | | A string identifying the custom image for use within the API. |
| **source\_format** string | | The file format of the image referenced in the url. Currently only raw is supported. |
| **state** string | **Choices:*** **present** β
* absent
| State of the coustom image. |
| **tags** dictionary | | The tags assigned to the custom image. |
| **url** string | | The URL used to download the image. |
| **user\_data\_handling** string | **Choices:*** pass-through
* extend-cloud-config
| How user\_data will be handled when creating a server. There are currently two options, "pass-through" and "extend-cloud-config". |
| **uuid** string | | The unique identifier of the custom image import. Either name or UUID must be present to change an existing image. |
| **zones** list / elements=string | | Specify zones in which the custom image will be available (e.g. `lpg1` or `rma1`). |
Notes
-----
Note
* To import a new custom-image the *url* and *name* options are required.
* All operations are performed using the cloudscale.ch public API v1.
* For details consult the full API documentation: <https://www.cloudscale.ch/en/api/v1>.
* A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at <https://control.cloudscale.ch>.
Examples
--------
```
- name: Import custom image
cloudscale_ch.cloud.custom_image:
name: "My Custom Image"
url: https://ubuntu.com/downloads/hirsute.img
slug: my-custom-image
user_data_handling: extend-cloud-config
zones: lpg1
tags:
project: luna
state: present
register: my_custom_image
- name: Wait until import succeeded
cloudscale_ch.cloud.custom_image:
uuid: "{{ my_custom_image.uuid }}"
retries: 15
delay: 5
register: image
until: image.import_status == 'success'
failed_when: image.import_status == 'failed'
- name: Import custom image and wait until import succeeded
cloudscale_ch.cloud.custom_image:
name: "My Custom Image"
url: https://ubuntu.com/downloads/hirsute.img
slug: my-custom-image
user_data_handling: extend-cloud-config
zones: lpg1
tags:
project: luna
state: present
retries: 15
delay: 5
register: image
until: image.import_status == 'success'
failed_when: image.import_status == 'failed'
- name: Update custom image
cloudscale_ch.cloud.custom_image:
name: "My Custom Image"
slug: my-custom-image
user_data_handling: extend-cloud-config
tags:
project: luna
state: present
- name: Delete custom image
cloudscale_ch.cloud.custom_image:
uuid: '{{ my_custom_image.uuid }}'
state: absent
- name: List all custom images
uri:
url: 'https://api.cloudscale.ch/v1/custom-images'
headers:
Authorization: 'Bearer {{ query("env", "CLOUDSCALE_API_TOKEN") }}'
status_code: 200
register: image_list
- name: Search the image list for all images with name 'My Custom Image'
set_fact:
my_custom_images: '{{ image_list.json | selectattr("name","search", "My Custom Image" ) }}'
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **checksums** dictionary | success | The checksums of the custom image as key and value pairs. The algorithm (e.g. sha256) name is in the key and the checksum in the value. The set of algorithms used might change in the future. **Sample:** {'md5': '5b3a1f21cde154cfb522b582f44f1a87', 'sha256': '5b03bcbd00b687e08791694e47d235a487c294e58ca3b1af704120123aa3f4e6'} |
| **created\_at** string | success | The creation date and time of the resource. **Sample:** 2020-05-29T13:18:42.511407Z |
| **error\_message** string | success | Error message in case of a failed import. **Sample:** Expected HTTP 200, got HTTP 403 |
| **href** string | success when state == present | The API URL to get details about this resource. **Sample:** https://api.cloudscale.ch/v1/custom-imges/11111111-1864-4608-853a-0771b6885a3a |
| **import\_status** string | success | Shows the progress of an import. Values are one of "started", "in\_progress", "success" or "failed". **Sample:** in\_progress |
| **name** string | success | The human readable name of the custom image. **Sample:** alan |
| **slug** string | success | A string identifying the custom image for use within the API. **Sample:** foo |
| **state** string | success | The current status of the custom image. **Sample:** present |
| **tags** dictionary | success | Tags assosiated with the custom image. **Sample:** {'project': 'my project'} |
| **user\_data\_handling** string | success | How user\_data will be handled when creating a server. There are currently two options, "pass-through" and "extend-cloud-config". **Sample:** pass-through |
| **uuid** string | success | The unique identifier of the custom image. **Sample:** 11111111-1864-4608-853a-0771b6885a3a |
### Authors
* Ciril Troxler (@ctx)
* Gaudenz Steinlin (@gaudenz)
ansible Collections in the Mellanox Namespace Collections in the Mellanox Namespace
=====================================
These are the collections with docs hosted on [docs.ansible.com](https://docs.ansible.com/) in the **mellanox** namespace.
* [mellanox.onyx](onyx/index#plugins-in-mellanox-onyx)
ansible mellanox.onyx.onyx_config β Manage Mellanox ONYX configuration sections mellanox.onyx.onyx\_config β Manage Mellanox ONYX configuration sections
========================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_config`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Mellanox ONYX configurations uses a simple block indent file syntax for segmenting configuration into sections. This module provides an implementation for working with ONYX configuration sections in a deterministic way.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **after** string | | The ordered set of commands to append to the end of the command stack if a change needs to be made. Just like with *before* this allows the playbook designer to append a set of commands to be executed after the command set. |
| **backup** boolean | **Choices:*** **no** β
* yes
| This argument will cause the module to create a full backup of the current `running-config` from the remote device before any changes are made. If the `backup_options` value is not given, the backup file is written to the `backup` folder in the playbook root directory. If the directory does not exist, it is created. |
| **backup\_options** dictionary | | This is a dict object containing configurable options related to backup file path. The value of this option is read only when `backup` is set to *yes*, if `backup` is set to *no* this option will be silently ignored. |
| | **dir\_path** path | | This option provides the path ending with directory name in which the backup configuration file will be stored. If the directory does not exist it will be first created and the filename is either the value of `filename` or default filename as described in `filename` options description. If the path value is not given in that case a *backup* directory will be created in the current working directory and backup configuration will be copied in `filename` within *backup* directory. |
| | **filename** string | | The filename to be used to store the backup configuration. If the filename is not given it will be generated based on the hostname, current time and date in format defined by <hostname>\_config.<current-date>@<current-time> |
| **before** string | | The ordered set of commands to push on to the command stack if a change needs to be made. This allows the playbook designer the opportunity to perform configuration commands prior to pushing any changes without affecting how the set of commands are matched against the system. |
| **config** string | | The `config` argument allows the playbook designer to supply the base configuration to be used to validate configuration changes necessary. If this argument is provided, the module will not download the running-config from the remote node. |
| **lines** string | | The ordered set of commands that should be configured in the section. The commands must be the exact same commands as found in the device running-config. Be sure to note the configuration command syntax as some commands are automatically modified by the device config parser.
aliases: commands |
| **match** string | **Choices:*** **line** β
* strict
* exact
* none
| Instructs the module on the way to perform the matching of the set of commands against the current device config. If match is set to *line*, commands are matched line by line. If match is set to *strict*, command lines are matched with respect to position. If match is set to *exact*, command lines must be an equal match. Finally, if match is set to *none*, the module will not attempt to compare the source configuration with the running configuration on the remote device. |
| **parents** string | | The ordered set of parents that uniquely identify the section the commands should be checked against. If the parents argument is omitted, the commands are checked against the set of top level or global commands. |
| **replace** string | **Choices:*** **line** β
* block
| Instructs the module on the way to perform the configuration on the device. If the replace argument is set to *line* then the modified lines are pushed to the device in configuration mode. If the replace argument is set to *block* then the entire command block is pushed to the device in configuration mode if any line is not correct |
| **save** boolean | **Choices:*** **no** β
* yes
| The `save` argument instructs the module to save the running- config to the startup-config at the conclusion of the module running. If check mode is specified, this argument is ignored. |
| **src** string | | Specifies the source path to the file that contains the configuration or configuration template to load. The path to the source file can either be the full path on the Ansible control host or a relative path from the playbook or role root directory. This argument is mutually exclusive with *lines*, *parents*. |
Examples
--------
```
---
- onyx_config:
lines:
- snmp-server community
- snmp-server host 10.2.2.2 traps version 2c
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **backup\_path** string | when backup is yes | The full path to the backup file **Sample:** /playbooks/ansible/backup/onyx\_config.2016-07-16@22:28:34 |
| **updates** list / elements=string | always | The set of commands that will be pushed to the remote device **Sample:** ['...', '...'] |
### Authors
* Alex Tabachnik (@atabachnik), Samer Deeb (@samerd)
ansible mellanox.onyx.onyx_command β Run commands on remote devices running Mellanox ONYX mellanox.onyx.onyx\_command β Run commands on remote devices running Mellanox ONYX
==================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_command`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Sends arbitrary commands to an Mellanox ONYX network device and returns the results read from the device. This module includes an argument that will cause the module to wait for a specific condition before returning or timing out if the condition is not met.
* This module does not support running commands in configuration mode. Please use M(onyx\_config) to configure Mellanox ONYX devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **commands** string / required | | List of commands to send to the remote Mellanox ONYX network device. The resulting output from the command is returned. If the *wait\_for* argument is provided, the module is not returned until the condition is satisfied or the number of retries has expired. |
| **interval** string | **Default:**1 | Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified conditions, the interval indicates how long to wait before trying the command again. |
| **match** string | **Choices:*** any
* **all** β
| The *match* argument is used in conjunction with the *wait\_for* argument to specify the match policy. Valid values are `all` or `any`. If the value is set to `all` then all conditionals in the wait\_for must be satisfied. If the value is set to `any` then only one of the values must be satisfied. |
| **retries** string | **Default:**10 | Specifies the number of retries a command should by tried before it is considered failed. The command is run on the target device every retry and evaluated against the *wait\_for* conditions. |
| **wait\_for** string | | List of conditions to evaluate against the output of the command. The task will wait for each condition to be true before moving forward. If the conditional is not true within the configured number of retries, the task fails. See examples. |
Notes
-----
Note
* Tested on ONYX 3.6.4000
Examples
--------
```
tasks:
- name: Run show version on remote devices
onyx_command:
commands: show version
- name: Run show version and check to see if output contains MLNXOS
onyx_command:
commands: show version
wait_for: result[0] contains MLNXOS
- name: Run multiple commands on remote nodes
onyx_command:
commands:
- show version
- show interfaces
- name: Run multiple commands and evaluate the output
onyx_command:
commands:
- show version
- show interfaces
wait_for:
- result[0] contains MLNXOS
- result[1] contains mgmt1
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **failed\_conditions** list / elements=string | failed | The list of conditionals that have failed **Sample:** ['...', '...'] |
| **stdout** list / elements=string | always apart from low level errors (such as action plugin) | The set of responses from the commands **Sample:** ['...', '...'] |
| **stdout\_lines** list / elements=string | always apart from low level errors (such as action plugin) | The value of stdout split into a list **Sample:** [['...', '...'], ['...'], ['...']] |
### Authors
* Samer Deeb (@samerd)
| programming_docs |
ansible mellanox.onyx.onyx_facts β Collect facts from Mellanox ONYX network devices mellanox.onyx.onyx\_facts β Collect facts from Mellanox ONYX network devices
============================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_facts`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Collects a base set of device facts from a ONYX Mellanox network devices This module prepends all of the base network fact keys with `ansible_net_<fact>`. The facts module will always collect a base set of facts from the device and can enable or disable collection of additional facts.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **gather\_subset** string | **Default:**"version" | When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument include all, version, module, and interfaces. Can specify a list of values to include a larger subset. Values can also be used with an initial `M(!`) to specify that a specific subset should not be collected. |
Notes
-----
Note
* Tested against ONYX 3.6
Examples
--------
```
---
- name: Collect all facts from the device
onyx_facts:
gather_subset: all
- name: Collect only the interfaces facts
onyx_facts:
gather_subset:
- interfaces
- name: Do not collect version facts
onyx_facts:
gather_subset:
- "!version"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **ansible\_net\_gather\_subset** list / elements=string | always | The list of fact subsets collected from the device |
| **ansible\_net\_interfaces** dictionary | when interfaces is configured | A hash of all interfaces running on the system |
| **ansible\_net\_modules** dictionary | when modules is configured | A hash of all modules on the systeme with status |
| **ansible\_net\_version** dictionary | when version is configured or when no gather\_subset is provided | A hash of all currently running system image information |
### Authors
* Waleed Mousa (@waleedym), Samer Deeb (@samerd)
ansible mellanox.onyx.onyx_vlan β Manage VLANs on Mellanox ONYX network devices mellanox.onyx.onyx\_vlan β Manage VLANs on Mellanox ONYX network devices
========================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_vlan`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of VLANs on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of VLANs definitions. |
| **name** string | | Name of the VLAN. |
| **purge** boolean | **Choices:*** **no** β
* yes
| Purge VLANs not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** β
* absent
| State of the VLAN configuration. |
| **vlan\_id** string | | ID of the VLAN. |
Examples
--------
```
- name: Configure VLAN ID and name
onyx_vlan:
vlan_id: 20
name: test-vlan
- name: Remove configuration
onyx_vlan:
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always. | The list of configuration mode commands to send to the device **Sample:** ['vlan 20', 'name test-vlan', 'exit'] |
### Authors
* Samer Deeb (@samerd) Alex Tabachnik (@atabachnik)
ansible mellanox.onyx.onyx_interface β Manage Interfaces on Mellanox ONYX network devices mellanox.onyx.onyx\_interface β Manage Interfaces on Mellanox ONYX network devices
==================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of Interfaces on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of Interfaces definitions. |
| **delay** string | **Default:**10 | Time in seconds to wait before checking for the operational state on remote device. This wait is applicable for operational state argument which are *state* with values `up`/`down`. |
| **description** string | | Description of Interface. |
| **duplex** string | **Choices:*** full
* half
* **auto** β
| Interface link status |
| **enabled** boolean | **Choices:*** no
* yes
| Interface link status. |
| **mtu** string | | Maximum size of transmit packet. |
| **name** string / required | | Name of the Interface. |
| **purge** boolean | **Choices:*** **no** β
* yes
| Purge Interfaces not defined in the aggregate parameter. This applies only for logical interface. |
| **rx\_rate** string | | Receiver rate in bits per second (bps). This is state check parameter only. Supports conditionals, see [Conditionals in Networking Modules](../network/user_guide/network_working_with_command_output)
|
| **speed** string | **Choices:*** 1G
* 10G
* 25G
* 40G
* 50G
* 56G
* 100G
| Interface link speed. |
| **state** string | **Choices:*** **present** β
* absent
* up
* down
| State of the Interface configuration, `up` means present and operationally up and `down` means present and operationally `down`
|
| **tx\_rate** string | | Transmit rate in bits per second (bps). This is state check parameter only. Supports conditionals, see [Conditionals in Networking Modules](../network/user_guide/network_working_with_command_output)
|
Examples
--------
```
- name: Configure interface
onyx_interface:
name: Eth1/2
description: test-interface
speed: 100G
mtu: 512
- name: Make interface up
onyx_interface:
name: Eth1/2
enabled: True
- name: Make interface down
onyx_interface:
name: Eth1/2
enabled: False
- name: Check intent arguments
onyx_interface:
name: Eth1/2
state: up
- name: Config + intent
onyx_interface:
name: Eth1/2
enabled: False
state: down
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['interface ethernet 1/2', 'description test-interface', 'mtu 512', 'exit'] |
### Authors
* Samer Deeb (@samerd)
ansible mellanox.onyx.onyx_syslog_remote β Configure remote syslog module mellanox.onyx.onyx\_syslog\_remote β Configure remote syslog module
===================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_syslog_remote`.
New in version 0.2.0: of mellanox.onyx
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of syslog on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **enabled** boolean | **Choices:*** no
* **yes** β
| Disable/Enable logging to given remote host |
| **filter** string | **Choices:*** include
* exclude
| Specify a filter type |
| **filter\_str** string | | Specify a regex filter string |
| **host** string / required | | <IP4/IP6 Hostname> Send event logs to this server using the syslog protocol |
| **port** integer | | Set remote server destination port for log messages |
| **trap** string | **Choices:*** none
* debug
* info
* notice
* alert
* warning
* err
* emerg
* crit
| Minimum severity level for messages to this syslog server |
| **trap\_override** list / elements=string | | Override log levels for this sink on a per-class basis |
| | **override\_class** string / required | **Choices:*** mgmt-front
* mgmt-back
* mgmt-core
* events
* debug-module
* sx-sdk
* mlx-daemons
* protocol-stack
| Specify a class whose log level to override |
| | **override\_enabled** boolean | **Choices:*** no
* **yes** β
| disable override priorities for specific class. |
| | **override\_priority** string | **Choices:*** none
* debug
* info
* notice
* alert
* warning
* err
* emerg
* crit
| -Specify a priority whose log level to override |
Examples
--------
```
- name: Remote logging port 8080
- onyx_syslog_remote:
host: 10.10.10.10
port: 8080
- name: Remote logging trap override
- onyx_syslog_remote:
host: 10.10.10.10
trap_override:
- override_class: events
override_priority: emerg
- name: Remote logging trap emerg
- onyx_syslog_remote:
host: 10.10.10.10
trap: emerg
- name: Remote logging filter include 'ERR'
- onyx_syslog_remote:
host: 10.10.10.10
filter: include
filter_str: /ERR/
- name: Disable remote logging with class events
- onyx_syslog_remote:
enabled: False
host: 10.10.10.10
class: events
- name : disable remote logging
- onyx_syslog_remote:
enabled: False
host: 10.10.10.10
- name : enable/disable override class
- onyx_syslog_remote:
host: 10.7.144.71
trap_override:
- override_class: events
override_priority: emerg
override_enabled: False
- override_class: mgmt-front
override_priority: alert
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['logging x port 8080', 'logging 10.10.10.10 trap override class events priority emerg', 'no logging 10.10.10.10 trap override class events', 'logging 10.10.10.10 trap emerg', 'logging 10.10.10.10 filter [include | exclude] ERR'] |
### Authors
* Anas Shami (@anass)
ansible mellanox.onyx.onyx_snmp_users β Configures SNMP User parameters mellanox.onyx.onyx\_snmp\_users β Configures SNMP User parameters
=================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_snmp_users`.
New in version 0.2.0: of mellanox.onyx
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of SNMP Users protocol params on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **users** list / elements=string | | List of snmp users |
| | **auth\_password** string | | The password needed to configure the hash type. |
| | **auth\_type** string | **Choices:*** md5
* sha
* sha224
* sha256
* sha384
* sha512
| Configures the hash type used to configure SNMP v3 security parameters. |
| | **capability\_level** string | **Choices:*** admin
* monitor
* unpriv
* v\_admin
| Sets capability level for SET requests. |
| | **enabled** boolean | **Choices:*** no
* yes
| Enables/Disables SNMP v3 access for the user. |
| | **name** string / required | | Specifies the name of the user. |
| | **require\_privacy** boolean | **Choices:*** no
* yes
| Enables/Disables the Require privacy (encryption) for requests from this user |
| | **set\_access\_enabled** boolean | **Choices:*** no
* yes
| Enables/Disables SNMP SET requests for the user. |
Examples
--------
```
- name: Enables snmp user
onyx_snmp_users:
users:
- name: sara
enabled: true
- name: Enables snmp set requests
onyx_snmp_users:
users:
- name: sara
set_access_enabled: yes
- name: Enables user require privacy
onyx_snmp_users:
users:
- name: sara
require_privacy: true
- name: Configures user hash type
onyx_snmp_users:
users:
- auth_type: md5
auth_password: 1297sara1234sara
- name: Configures user capability_level
onyx_snmp_users:
users:
- name: sara
capability_level: admin
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['snmp-server user <user\_name> v3 enable', 'no snmp-server user <user\_name> v3 enable', 'snmp-server user <user\_name> v3 enable sets', 'no snmp-server user <user\_name> v3 enable sets', 'snmp-server user <user\_name> v3 require-privacy', 'no snmp-server user <user\_name> v3 require-privacy', 'snmp-server user <user\_name> v3 capability <capability\_level>', 'snmp-server user <user\_name> v3 auth <hash\_type> <password>'] |
### Authors
* Sara Touqan (@sarato)
ansible mellanox.onyx.onyx_qos β Configures QoS mellanox.onyx.onyx\_qos β Configures QoS
========================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_qos`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of Onyx QoS configuration on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **interfaces** string / required | | list of interfaces name. |
| **rewrite\_dscp** string | **Choices:*** enabled
* **disabled** β
| rewrite with type dscp. |
| **rewrite\_pcp** string | **Choices:*** enabled
* **disabled** β
| rewrite with type pcp. |
| **trust** string | **Choices:*** **L2** β
* L3
* both
| trust type. |
Notes
-----
Note
* Tested on ONYX 3.6.8130
Examples
--------
```
- name: Configure QoS
onyx_QoS:
interfaces:
- Mpo7
- Mpo7
trust: L3
rewrite_pcp: disabled
rewrite_dscp: enabled
- name: Configure QoS
onyx_QoS:
interfaces:
- Eth1/1
- Eth1/2
trust: both
rewrite_pcp: disabled
rewrite_dscp: enabled
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['interface ethernet 1/16 qos trust L3', 'interface mlag-port-channel 7 qos trust L3', 'interface port-channel 1 qos trust L3', 'interface mlag-port-channel 7 qos trust L2', 'interface mlag-port-channel 7 qos rewrite dscp', 'interface ethernet 1/16 qos rewrite pcp', 'interface ethernet 1/1 no qos rewrite pcp'] |
### Authors
* Anas Badaha (@anasb)
ansible Mellanox.Onyx Mellanox.Onyx
=============
Collection version 1.0.0
Plugin Index
------------
These are the plugins in the mellanox.onyx collection
### Cliconf Plugins
* [onyx](onyx_cliconf#ansible-collections-mellanox-onyx-onyx-cliconf) β Use onyx cliconf to run command on Mellanox ONYX platform
### Modules
* [onyx\_aaa](onyx_aaa_module#ansible-collections-mellanox-onyx-onyx-aaa-module) β Configures AAA parameters
* [onyx\_bfd](onyx_bfd_module#ansible-collections-mellanox-onyx-onyx-bfd-module) β Configures BFD parameters
* [onyx\_bgp](onyx_bgp_module#ansible-collections-mellanox-onyx-onyx-bgp-module) β Configures BGP on Mellanox ONYX network devices
* [onyx\_buffer\_pool](onyx_buffer_pool_module#ansible-collections-mellanox-onyx-onyx-buffer-pool-module) β Configures Buffer Pool
* [onyx\_command](onyx_command_module#ansible-collections-mellanox-onyx-onyx-command-module) β Run commands on remote devices running Mellanox ONYX
* [onyx\_config](onyx_config_module#ansible-collections-mellanox-onyx-onyx-config-module) β Manage Mellanox ONYX configuration sections
* [onyx\_facts](onyx_facts_module#ansible-collections-mellanox-onyx-onyx-facts-module) β Collect facts from Mellanox ONYX network devices
* [onyx\_igmp](onyx_igmp_module#ansible-collections-mellanox-onyx-onyx-igmp-module) β Configures IGMP global parameters
* [onyx\_igmp\_interface](onyx_igmp_interface_module#ansible-collections-mellanox-onyx-onyx-igmp-interface-module) β Configures IGMP interface parameters
* [onyx\_igmp\_vlan](onyx_igmp_vlan_module#ansible-collections-mellanox-onyx-onyx-igmp-vlan-module) β Configures IGMP Vlan parameters
* [onyx\_interface](onyx_interface_module#ansible-collections-mellanox-onyx-onyx-interface-module) β Manage Interfaces on Mellanox ONYX network devices
* [onyx\_l2\_interface](onyx_l2_interface_module#ansible-collections-mellanox-onyx-onyx-l2-interface-module) β Manage Layer-2 interface on Mellanox ONYX network devices
* [onyx\_l3\_interface](onyx_l3_interface_module#ansible-collections-mellanox-onyx-onyx-l3-interface-module) β Manage L3 interfaces on Mellanox ONYX network devices
* [onyx\_linkagg](onyx_linkagg_module#ansible-collections-mellanox-onyx-onyx-linkagg-module) β Manage link aggregation groups on Mellanox ONYX network devices
* [onyx\_lldp](onyx_lldp_module#ansible-collections-mellanox-onyx-onyx-lldp-module) β Manage LLDP configuration on Mellanox ONYX network devices
* [onyx\_lldp\_interface](onyx_lldp_interface_module#ansible-collections-mellanox-onyx-onyx-lldp-interface-module) β Manage LLDP interfaces configuration on Mellanox ONYX network devices
* [onyx\_magp](onyx_magp_module#ansible-collections-mellanox-onyx-onyx-magp-module) β Manage MAGP protocol on Mellanox ONYX network devices
* [onyx\_mlag\_ipl](onyx_mlag_ipl_module#ansible-collections-mellanox-onyx-onyx-mlag-ipl-module) β Manage IPL (inter-peer link) on Mellanox ONYX network devices
* [onyx\_mlag\_vip](onyx_mlag_vip_module#ansible-collections-mellanox-onyx-onyx-mlag-vip-module) β Configures MLAG VIP on Mellanox ONYX network devices
* [onyx\_ntp](onyx_ntp_module#ansible-collections-mellanox-onyx-onyx-ntp-module) β Manage NTP general configurations and ntp keys configurations on Mellanox ONYX network devices
* [onyx\_ntp\_servers\_peers](onyx_ntp_servers_peers_module#ansible-collections-mellanox-onyx-onyx-ntp-servers-peers-module) β Configures NTP peers and servers parameters
* [onyx\_ospf](onyx_ospf_module#ansible-collections-mellanox-onyx-onyx-ospf-module) β Manage OSPF protocol on Mellanox ONYX network devices
* [onyx\_pfc\_interface](onyx_pfc_interface_module#ansible-collections-mellanox-onyx-onyx-pfc-interface-module) β Manage priority flow control on ONYX network devices
* [onyx\_protocol](onyx_protocol_module#ansible-collections-mellanox-onyx-onyx-protocol-module) β Enables/Disables protocols on Mellanox ONYX network devices
* [onyx\_ptp\_global](onyx_ptp_global_module#ansible-collections-mellanox-onyx-onyx-ptp-global-module) β Configures PTP Global parameters
* [onyx\_ptp\_interface](onyx_ptp_interface_module#ansible-collections-mellanox-onyx-onyx-ptp-interface-module) β Configures PTP on interface
* [onyx\_qos](onyx_qos_module#ansible-collections-mellanox-onyx-onyx-qos-module) β Configures QoS
* [onyx\_snmp](onyx_snmp_module#ansible-collections-mellanox-onyx-onyx-snmp-module) β Manages SNMP general configurations on Mellanox ONYX network devices
* [onyx\_snmp\_hosts](onyx_snmp_hosts_module#ansible-collections-mellanox-onyx-onyx-snmp-hosts-module) β Configures SNMP host parameters
* [onyx\_snmp\_users](onyx_snmp_users_module#ansible-collections-mellanox-onyx-onyx-snmp-users-module) β Configures SNMP User parameters
* [onyx\_syslog\_files](onyx_syslog_files_module#ansible-collections-mellanox-onyx-onyx-syslog-files-module) β Configure file management syslog module
* [onyx\_syslog\_remote](onyx_syslog_remote_module#ansible-collections-mellanox-onyx-onyx-syslog-remote-module) β Configure remote syslog module
* [onyx\_traffic\_class](onyx_traffic_class_module#ansible-collections-mellanox-onyx-onyx-traffic-class-module) β Configures Traffic Class
* [onyx\_username](onyx_username_module#ansible-collections-mellanox-onyx-onyx-username-module) β Configure username module
* [onyx\_vlan](onyx_vlan_module#ansible-collections-mellanox-onyx-onyx-vlan-module) β Manage VLANs on Mellanox ONYX network devices
* [onyx\_vxlan](onyx_vxlan_module#ansible-collections-mellanox-onyx-onyx-vxlan-module) β Configures Vxlan
* [onyx\_wjh](onyx_wjh_module#ansible-collections-mellanox-onyx-onyx-wjh-module) β Configure what-just-happend module
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
| programming_docs |
ansible mellanox.onyx.onyx_pfc_interface β Manage priority flow control on ONYX network devices mellanox.onyx.onyx\_pfc\_interface β Manage priority flow control on ONYX network devices
=========================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_pfc_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of priority flow control (PFC) on interfaces of Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of interfaces PFC should be configured on. |
| **name** string | | Name of the interface PFC should be configured on. |
| **purge** boolean | **Choices:*** **no** β
* yes
| Purge interfaces not defined in the aggregate parameter. |
| **state** string | **Choices:*** **enabled** β
* disabled
| State of the PFC configuration. |
Notes
-----
Note
* Tested on ONYX 3.6.4000
Examples
--------
```
- name: Configure PFC
onyx_pfc_interface:
name: Eth1/1
state: enabled
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['interface ethernet 1/17 dcb priority-flow-control mode on'] |
### Authors
* Samer Deeb (@samerd)
ansible mellanox.onyx.onyx_bgp β Configures BGP on Mellanox ONYX network devices mellanox.onyx.onyx\_bgp β Configures BGP on Mellanox ONYX network devices
=========================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_bgp`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of BGP router and neighbors on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **as\_number** string / required | | Local AS number. |
| **ecmp\_bestpath** boolean | **Choices:*** no
* yes
| Enables ECMP across AS paths. |
| **evpn** boolean | **Choices:*** no
* yes
| Configure evpn peer-group. |
| **fast\_external\_fallover** boolean | **Choices:*** no
* yes
| will configure fast\_external\_fallover when it is True. |
| **max\_paths** string | | Maximum bgp paths. |
| **neighbors** string | | List of neighbors. Required if *state=present*. |
| | **multihop** string | | multihop number. |
| | **neighbor** string / required | | Neighbor IP address. |
| | **remote\_as** string / required | | Remote AS number. |
| **networks** string | | List of advertised networks. |
| **purge** boolean | **Choices:*** **no** β
* yes
| will remove all neighbors when it is True. |
| **router\_id** string | | Router IP address. |
| **state** string | **Choices:*** **present** β
* absent
| BGP state. |
| **vrf** string | | vrf name. |
Notes
-----
Note
* Tested on ONYX 3.6.4000
Examples
--------
```
- name: Configure bgp
onyx_bgp:
as_number: 320
router_id: 10.3.3.3
neighbors:
- remote_as: 321
neighbor: 10.3.3.4
- remote_as: 322
neighbor: 10.3.3.5
multihop: 250
purge: True
state: present
networks:
- 172.16.1.0/24
vrf: default
evpn: yes
fast_external_fallover: yes
max_paths: 32
ecmp_bestpath: yes
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['router bgp 320 vrf default', 'exit', 'router bgp 320 router-id 10.3.3.3 force', 'router bgp 320 vrf default bgp fast-external-fallover', 'router bgp 320 vrf default maximum-paths 32', 'router bgp 320 vrf default bestpath as-path multipath-relax force', 'router bgp 320 vrf default neighbor evpn peer-group', 'router bgp 320 vrf default neighbor evpn send-community extended', 'router bgp 320 vrf default address-family l2vpn-evpn neighbor evpn next-hop-unchanged', 'router bgp 320 vrf default address-family l2vpn-evpn neighbor evpn activate', 'router bgp 320 vrf default address-family l2vpn-evpn auto-create', 'router bgp 320 vrf default neighbor 10.3.3.4 remote-as 321', 'router bgp 320 vrf default neighbor 10.3.3.4 ebgp-multihop 250', 'router bgp 320 vrf default neighbor 10.3.3.5 remote-as 322', 'router bgp 320 vrf default network 172.16.1.0 /24'] |
### Authors
* Samer Deeb (@samerd), Anas Badaha (@anasb)
ansible mellanox.onyx.onyx_traffic_class β Configures Traffic Class mellanox.onyx.onyx\_traffic\_class β Configures Traffic Class
=============================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_traffic_class`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of Traffic Class configuration on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **congestion\_control** string | | configure congestion control on interface. |
| | **control** string / required | **Choices:*** red
* ecn
* both
| congestion control type. |
| | **max\_threshold** string / required | | Set maximum-threshold value (in KBs) for marking traffic-class queue. |
| | **min\_threshold** string / required | | Set minimum-threshold value (in KBs) for marking traffic-class queue. |
| | **threshold\_mode** string / required | **Choices:*** absolute
* relative
| congestion control threshold mode. |
| **dcb** string | | configure dcb control on interface. |
| | **mode** string / required | **Choices:*** strict
* wrr
| dcb control mode. |
| | **weight** string | | Relevant only for wrr mode. |
| **interfaces** string / required | | list of interfaces name. |
| **state** string | **Choices:*** **enabled** β
* disabled
| enable congestion control on interface. |
| **tc** string / required | | traffic class, range 0-7. |
Examples
--------
```
- name: Configure traffic class
onyx_traffic_class:
interfaces:
- Eth1/1
- Eth1/2
tc: 3
congestion_control:
control: ecn
threshold_mode: absolute
min_threshold: 500
max_threshold: 1500
dcb:
mode: strict
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['interface ethernet 1/15 traffic-class 3 congestion-control ecn minimum-absolute 150 maximum-absolute 1500', 'interface ethernet 1/16 traffic-class 3 congestion-control ecn minimum-absolute 150 maximum-absolute 1500', 'interface mlag-port-channel 7 traffic-class 3 congestion-control ecn minimum-absolute 150 maximum-absolute 1500', 'interface port-channel 1 traffic-class 3 congestion-control ecn minimum-absolute 150 maximum-absolute 1500', 'interface ethernet 1/15 traffic-class 3 dcb ets strict', 'interface ethernet 1/16 traffic-class 3 dcb ets strict', 'interface mlag-port-channel 7 traffic-class 3 dcb ets strict', 'interface port-channel 1 traffic-class 3 dcb ets strict'] |
### Authors
* Anas Badaha (@anasb)
ansible mellanox.onyx.onyx_magp β Manage MAGP protocol on Mellanox ONYX network devices mellanox.onyx.onyx\_magp β Manage MAGP protocol on Mellanox ONYX network devices
================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_magp`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of MAGP protocol on vlan interface of Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **interface** string / required | | VLAN Interface name. |
| **magp\_id** string / required | | MAGP instance number 1-255 |
| **router\_ip** string | | MAGP router IP address. |
| **router\_mac** string | | MAGP router MAC address. |
| **state** string | **Choices:*** **present** β
* absent
* enabled
* disabled
| MAGP state. |
Notes
-----
Note
* Tested on ONYX 3.6.4000
Examples
--------
```
- name: Run add vlan interface with magp
onyx_magp:
magp_id: 103
router_ip: 192.168.8.2
router_mac: AA:1B:2C:3D:4E:5F
interface: Vlan 1002
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['interface vlan 234 magp 103', 'exit', 'interface vlan 234 magp 103 ip virtual-router address 1.2.3.4'] |
### Authors
* Samer Deeb (@samerd)
ansible mellanox.onyx.onyx_username β Configure username module mellanox.onyx.onyx\_username β Configure username module
========================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_username`.
New in version 0.2.0: of mellanox.onyx
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of users/roles on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **capability** string | **Choices:*** monitor
* unpriv
* v\_admin
* admin
| Grant capability to this user account |
| **disabled** string | **Choices:*** none
* login
* password
* all
| Disable means of logging into this account |
| **disconnected** boolean | **Choices:*** **no** β
* yes
| Disconnect all sessions of this user |
| **encrypted\_password** boolean | **Choices:*** **no** β
* yes
| Decide the type of setted password (plain text or encrypted) |
| **full\_name** string | | Set the full name of this user |
| **nopassword** boolean | **Choices:*** **no** β
* yes
| Clear password for such user |
| **password** string | | Set password fot such user |
| **reset\_capability** boolean | **Choices:*** **no** β
* yes
| Reset capability to this user account |
| **state** string | **Choices:*** **present** β
* absent
| Set state of the given account |
| **username** string / required | | Create/Edit user using username |
Examples
--------
```
- name: Create new user
onyx_username:
username: anass
- name: Set the user full-name
onyx_username:
username: anass
full_name: anasshami
- name: Set the user encrypted password
onyx_username:
username: anass
password: 12345
encrypted_password: True
- name: Set the user capability
onyx_username:
username: anass
capability: monitor
- name: Reset the user capability
onyx_username:
username: anass
reset_capability: True
- name: Remove the user configuration
onyx_username:
username: anass
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['username \*', 'username \* password \*', 'username \* nopassword', 'username \* disable login', 'username \* capability admin', 'no username \*', 'no username \* disable'] |
### Authors
* Anas Shami (@anass)
ansible mellanox.onyx.onyx_protocol β Enables/Disables protocols on Mellanox ONYX network devices mellanox.onyx.onyx\_protocol β Enables/Disables protocols on Mellanox ONYX network devices
==========================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_protocol`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides a mechanism for enabling and disabling protocols Mellanox on ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **bfd** string added in 0.2.0 of mellanox.onyx | **Choices:*** enabled
* disabled
| bfd protocol |
| **bgp** string | **Choices:*** enabled
* disabled
| BGP protocol |
| **dcb\_pfc** string | **Choices:*** enabled
* disabled
| DCB priority flow control |
| **igmp\_snooping** string | **Choices:*** enabled
* disabled
| IP IGMP snooping |
| **ip\_l3** string | **Choices:*** enabled
* disabled
| IP L3 support |
| **ip\_routing** string | **Choices:*** enabled
* disabled
| IP routing support |
| **lacp** string | **Choices:*** enabled
* disabled
| LACP protocol |
| **lldp** string | **Choices:*** enabled
* disabled
| LLDP protocol |
| **magp** string | **Choices:*** enabled
* disabled
| MAGP protocol |
| **mlag** string | **Choices:*** enabled
* disabled
| MLAG protocol |
| **nve** string | **Choices:*** enabled
* disabled
| nve protocol |
| **ospf** string | **Choices:*** enabled
* disabled
| OSPF protocol |
| **spanning\_tree** string | **Choices:*** enabled
* disabled
| Spanning Tree support |
Notes
-----
Note
* Tested on ONYX 3.6.4000
Examples
--------
```
- name: Enable protocols for MLAG
onyx_protocol:
lacp: enabled
spanning_tree: disabled
ip_routing: enabled
mlag: enabled
dcb_pfc: enabled
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['no spanning-tree', 'protocol mlag'] |
### Authors
* Samer Deeb (@samerd)
ansible mellanox.onyx.onyx_l3_interface β Manage L3 interfaces on Mellanox ONYX network devices mellanox.onyx.onyx\_l3\_interface β Manage L3 interfaces on Mellanox ONYX network devices
=========================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_l3_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of L3 interfaces on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of L3 interfaces definitions |
| **ipv4** string | | IPv4 of the L3 interface. |
| **ipv6** string | | IPv6 of the L3 interface (not supported for now). |
| **name** string | | Name of the L3 interface. |
| **purge** boolean | **Choices:*** **no** β
* yes
| Purge L3 interfaces not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** β
* absent
| State of the L3 interface configuration. |
Examples
--------
```
- name: Set Eth1/1 IPv4 address
onyx_l3_interface:
name: Eth1/1
ipv4: 192.168.0.1/24
- name: Remove Eth1/1 IPv4 address
onyx_l3_interface:
name: Eth1/1
state: absent
- name: Set IP addresses on aggregate
onyx_l3_interface:
aggregate:
- { name: Eth1/1, ipv4: 192.168.2.10/24 }
- { name: Eth1/2, ipv4: 192.168.3.10/24 }
- name: Remove IP addresses on aggregate
onyx_l3_interface:
aggregate:
- { name: Eth1/1, ipv4: 192.168.2.10/24 }
- { name: Eth1/2, ipv4: 192.168.3.10/24 }
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always. | The list of configuration mode commands to send to the device **Sample:** ['interfaces ethernet 1/1 ip address 192.168.0.1 /24'] |
### Authors
* Samer Deeb (@samerd)
| programming_docs |
ansible mellanox.onyx.onyx_snmp β Manages SNMP general configurations on Mellanox ONYX network devices mellanox.onyx.onyx\_snmp β Manages SNMP general configurations on Mellanox ONYX network devices
===============================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_snmp`.
New in version 0.2.0: of mellanox.onyx
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of SNMP on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **communities\_enabled** boolean | **Choices:*** no
* yes
| Enables/Disables community-based authentication on the system. |
| **contact\_name** string | | Sets the SNMP contact name. |
| **engine\_id\_reset** boolean | **Choices:*** no
* yes
| Sets SNMPv3 engineID to node unique value. |
| **location** string | | Sets the SNMP location. |
| **multi\_communities\_enabled** boolean | **Choices:*** no
* yes
| Enables/Disables multiple communities to be configured. |
| **notify\_community** string | | Sets the default community for SNMP v1 and v2c notifications sent to hosts which do not have a community override set. |
| **notify\_enabled** boolean | **Choices:*** no
* yes
| Enables/Disables sending of SNMP notifications (traps and informs) from thee system. |
| **notify\_event** string | **Choices:*** asic-chip-down
* dcbx-pfc-port-oper-state-trap
* insufficient-power
* mstp-new-bridge-root
* ospf-lsdb-approaching-overflow
* sm-stop
* user-logout
* cli-line-executed
* dcbx-pfc-port-peer-state-trap
* interface-down
* mstp-new-root-port
* ospf-lsdb-overflow
* snmp-authtrap
* xstp-new-root-bridge
* cpu-util-high
* disk-io-high
* interface-up
* mstp-topology-change
* ospf-nbr-state-change
* temperature-too-high
* xstp-root-port-change
* dcbx-ets-module-state-change
* disk-space-low
* internal-bus-error
* netusage-high
* paging-high
* topology\_change
* xstp-topology-change
* dcbx-ets-port-admin-state-trap
* entity-state-change
* internal-link-speed-mismatch
* new\_root
* power-redundancy-mismatch
* unexpected-cluster-join
* dcbx-ets-port-oper-state-trap
* expected-shutdown
* liveness-failure
* ospf-auth-fail
* process-crash
* unexpected-cluster-leave
* dcbx-ets-port-peer-state-trap
* health-module-status
* low-power
* ospf-config-error
* process-exit
* unexpected-cluster-size
* dcbx-pfc-module-state-change
* insufficient-fans
* low-power-recover
* ospf-if-rx-bad-packet
* sm-restart
* unexpected-shutdown
* dcbx-pfc-port-admin-state-trap
* insufficient-fans-recover
* memusage-high
* ospf-if-state-change
* sm-start
* user-login
| Specifys which events will be sent as SNMP notifications. |
| **notify\_port** string | | Sets the default port to which notifications are sent. |
| **notify\_send\_test** string | **Choices:*** yes
* no
| Sends a test notification. |
| **snmp\_communities** list / elements=string | | List of snmp communities |
| | **community\_name** string / required | | Configures snmp community name. |
| | **community\_type** string | **Choices:*** read-only
* read-write
| Add this community as either a read-only or read-write community. |
| | **state** string | **Choices:*** present
* absent
| Used to decide if you want to delete the given snmp community or not |
| **snmp\_permissions** list / elements=string | | Allow SNMPSET requests for items in a MIB. |
| | **permission\_type** string | **Choices:*** MELLANOX-CONFIG-DB-MIB
* MELLANOX-EFM-MIB
* MELLANOX-POWER-CYCLE
* MELLANOX-SW-UPDATE
* RFC1213-MIB
| Configures the request type. |
| | **state\_enabled** boolean / required | **Choices:*** no
* yes
| Enables/Disables the request. |
| **state\_enabled** boolean | **Choices:*** no
* yes
| Enables/Disables the state of the SNMP configuration. |
Examples
--------
```
- name: Configure SNMP
onyx_snmp:
state_enabled: yes
contact_name: sara
location: Nablus
communities_enabled: no
multi_communities_enabled: no
notify_enabled: yes
notify_port: 1
notify_community: community_1
notify_send_test: yes
notify_event: temperature-too-high
snmp_communities:
- community_name: public
community_type: read-only
state: absent
snmp_permissions:
- state_enabled: yes
permission_type: MELLANOX-CONFIG-DB-MIB
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always. | The list of configuration mode commands to send to the device **Sample:** ['snmp-server enable', 'no snmp-server enable', 'snmp-server location <location\_name>', 'snmp-server contact <contact\_name>', 'snmp-server enable communities', 'no snmp-server enable communities', 'snmp-server enable mult-communities', 'no snmp-server enable mult-communities', 'snmp-server enable notify', 'snmp-server notify port <port\_number>', 'snmp-server notify community <community\_name>', 'snmp-server notify send-test', 'snmp-server notify event <event\_name>', 'snmp-server enable set-permission <permission\_type>', 'no snmp-server enable set-permission <permission\_type>', 'snmp-server community <community\_name> <community\_type>', 'no snmp-server community <community\_name>.', 'snmp-server engineID reset.'] |
### Authors
* Sara-Touqan (@sarato)
ansible mellanox.onyx.onyx_mlag_vip β Configures MLAG VIP on Mellanox ONYX network devices mellanox.onyx.onyx\_mlag\_vip β Configures MLAG VIP on Mellanox ONYX network devices
====================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_mlag_vip`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of MLAG virtual IPs on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **delay** string | **Default:**12 | Delay interval, in seconds, waiting for the changes on mlag VIP to take effect. |
| **group\_name** string | | MLAG group name. Required if *state=present*. |
| **ipaddress** string | | Virtual IP address of the MLAG. Required if *state=present*. |
| **mac\_address** string | | MLAG system MAC address. Required if *state=present*. |
| **state** string | **Choices:*** present
* absent
| MLAG VIP state. |
Notes
-----
Note
* Tested on ONYX 3.6.4000
Examples
--------
```
- name: Configure mlag-vip
onyx_mlag_vip:
ipaddress: 50.3.3.1/24
group_name: ansible-test-group
mac_address: 00:11:12:23:34:45
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['mlag-vip ansible\_test\_group ip 50.3.3.1 /24 force', 'no mlag shutdown'] |
### Authors
* Samer Deeb (@samerd)
ansible mellanox.onyx.onyx_vxlan β Configures Vxlan mellanox.onyx.onyx\_vxlan β Configures Vxlan
============================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_vxlan`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of Vxlan configuration on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **arp\_suppression** boolean | **Choices:*** **no** β
* yes
| A flag telling if to configure arp suppression. |
| **bgp** boolean | **Choices:*** no
* **yes** β
| configure bgp on nve interface. |
| **loopback\_id** string | | loopback interface ID. |
| **mlag\_tunnel\_ip** string | | vxlan Mlag tunnel IP |
| **nve\_id** string / required | | nve interface ID. |
| **vni\_vlan\_list** string | | Each item in the list has two attributes vlan\_id, vni\_id. |
Notes
-----
Note
* Tested on ONYX evpn\_dev.031.
* nve protocol must be enabled.
Examples
--------
```
- name: Configure Vxlan
onyx_vxlan:
nve_id: 1
loopback_id: 1
bgp: yes
mlag-tunnel-ip: 100.0.0.1
vni_vlan_list:
- vlan_id: 10
vni_id: 10010
- vlan_id: 6
vni_id: 10060
arp_suppression: yes
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['interface nve 1', 'interface nve 1 vxlan source interface loopback 1', 'interface nve 1 nve controller bgp', 'interface nve 1 vxlan mlag-tunnel-ip 100.0.0.1', 'interface nve 1 nve vni 10010 vlan 10', 'interface nve 1 nve vni 10060 vlan 6', 'interface nve 1 nve neigh-suppression', 'interface vlan 6', 'interface vlan 10'] |
### Authors
* Anas Badaha (@anasb)
ansible mellanox.onyx.onyx_ptp_global β Configures PTP Global parameters mellanox.onyx.onyx\_ptp\_global β Configures PTP Global parameters
==================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_ptp_global`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of PTP Global configuration on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **domain** string | | set PTP domain number Range 0-127 |
| **ntp\_state** string | **Choices:*** enabled
* disabled
| NTP state. |
| **primary\_priority** string | | set PTP primary priority Range 0-225 |
| **ptp\_state** string | **Choices:*** **enabled** β
* disabled
| PTP state. |
| **secondary\_priority** string | | set PTP secondary priority Range 0-225 |
Notes
-----
Note
* Tested on ONYX 3.6.8130 ptp and ntp protocols cannot be enabled at the same time
Examples
--------
```
- name: Configure PTP
onyx_ptp_global:
ntp_state: enabled
ptp_state: disabled
domain: 127
primary_priority: 128
secondary_priority: 128
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['no ntp enable', 'protocol ptp', 'ptp domain 127'] |
### Authors
* Anas Badaha (@anasb)
ansible mellanox.onyx.onyx_syslog_files β Configure file management syslog module mellanox.onyx.onyx\_syslog\_files β Configure file management syslog module
===========================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_syslog_files`.
New in version 0.2.0: of mellanox.onyx
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of syslog on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **debug** boolean | **Choices:*** **no** β
* yes
| Configure settings for debug log files |
| **delete\_group** string | **Choices:*** current
* oldest
| Delete certain log files |
| **rotation** dictionary | | rotation related attributes |
| | **force** boolean | **Choices:*** no
* yes
| force an immediate rotation of log files |
| | **frequency** string | **Choices:*** daily
* weekly
* monthly
| Rotate log files on a fixed time-based schedule |
| | **max\_num** integer | | Sepcify max\_num of old log files to keep |
| | **size** float | | Rotate files when they pass max size |
| | **size\_pct** float | | Rotatoe files when they pass percent of HD |
| **upload\_file** string | | Upload compressed log file (current or filename) |
| **upload\_url** string | | upload local log files to remote host (ftp, scp, sftp, tftp) with format protocol://username[:password]@server/path |
Examples
--------
```
- name: Syslog delete old files
- onyx_syslog_files:
delete_group: oldest
- name: Syslog upload file
- onyx_syslog_files:
upload_url: scp://username:password@hostnamepath/filename
upload_file: current
- name: Syslog rotation force, frequency and max number
- onyx_syslog_files:
rotation:
force: true
max_num: 30
frequency: daily
size: 128
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['logging files delete current', 'logging files rotate criteria', 'logging files upload current url'] |
### Authors
* Anas Shami (@anass)
ansible mellanox.onyx.onyx_linkagg β Manage link aggregation groups on Mellanox ONYX network devices mellanox.onyx.onyx\_linkagg β Manage link aggregation groups on Mellanox ONYX network devices
=============================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_linkagg`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of link aggregation groups on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of link aggregation definitions. |
| **members** string / required | | List of members interfaces of the link aggregation group. The value can be single interface or list of interfaces. |
| **mode** string | **Choices:*** on
* active
* passive
**Default:**"yes" | Mode of the link aggregation group. A value of `on` will enable LACP. `active` configures the link to actively information about the state of the link, or it can be configured in `passive` mode ie. send link state information only when received them from another link. |
| **name** string / required | | Name of the link aggregation group. |
| **purge** boolean | **Choices:*** **no** β
* yes
| Purge link aggregation groups not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** β
* absent
* up
* down
| State of the link aggregation group. |
Examples
--------
```
- name: Configure link aggregation group
onyx_linkagg:
name: Po1
members:
- Eth1/1
- Eth1/2
- name: Remove configuration
onyx_linkagg:
name: Po1
state: absent
- name: Create aggregate of linkagg definitions
onyx_linkagg:
aggregate:
- { name: Po1, members: [Eth1/1] }
- { name: Po2, members: [Eth1/2] }
- name: Remove aggregate of linkagg definitions
onyx_linkagg:
aggregate:
- name: Po1
- name: Po2
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always. | The list of configuration mode commands to send to the device **Sample:** ['interface port-channel 1', 'exit', 'interface ethernet 1/1 channel-group 1 mode on', 'interface ethernet 1/2 channel-group 1 mode on'] |
### Authors
* Samer Deeb (@samerd)
ansible mellanox.onyx.onyx_mlag_ipl β Manage IPL (inter-peer link) on Mellanox ONYX network devices mellanox.onyx.onyx\_mlag\_ipl β Manage IPL (inter-peer link) on Mellanox ONYX network devices
=============================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_mlag_ipl`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of IPL (inter-peer link) management on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **name** string / required | | Name of the interface (port-channel) IPL should be configured on. |
| **peer\_address** string | | IPL peer IP address. |
| **state** string | **Choices:*** **present** β
* absent
| IPL state. |
| **vlan\_interface** string | | Name of the IPL vlan interface. |
Notes
-----
Note
* Tested on ONYX 3.6.4000
Examples
--------
```
- name: Run configure ipl
onyx_mlag_ipl:
name: Po1
vlan_interface: Vlan 322
state: present
peer_address: 192.168.7.1
- name: Run remove ipl
onyx_mlag_ipl:
name: Po1
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['interface port-channel 1 ipl 1', 'interface vlan 1024 ipl 1 peer-address 10.10.10.10'] |
### Authors
* Samer Deeb (@samerd)
| programming_docs |
ansible mellanox.onyx.onyx_lldp β Manage LLDP configuration on Mellanox ONYX network devices mellanox.onyx.onyx\_lldp β Manage LLDP configuration on Mellanox ONYX network devices
=====================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_lldp`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of LLDP service configuration on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **state** string | **Choices:*** **present** β
* absent
| State of the LLDP protocol configuration. |
Examples
--------
```
- name: Enable LLDP protocol
onyx_lldp:
state: present
- name: Disable LLDP protocol
onyx_lldp:
state: lldp
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always. | The list of configuration mode commands to send to the device **Sample:** ['lldp'] |
### Authors
* Samer Deeb (@samerd)
ansible mellanox.onyx.onyx_ntp_servers_peers β Configures NTP peers and servers parameters mellanox.onyx.onyx\_ntp\_servers\_peers β Configures NTP peers and servers parameters
=====================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_ntp_servers_peers`.
New in version 0.2.0: of mellanox.onyx
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of NTP peers and servers configuration on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **ntpdate** string | | Sets system clock once from a remote server using NTP. |
| **peer** list / elements=string | | List of ntp peers. |
| | **enabled** boolean | **Choices:*** no
* yes
| Disables/Enables ntp peer state |
| | **ip\_or\_name** string / required | | Configures ntp peer name or ip. |
| | **key\_id** integer | | Used to configure the key-id for the ntp peer |
| | **state** string | **Choices:*** present
* absent
| Indicates if the ntp peer exists or should be deleted |
| | **version** integer | **Choices:*** 3
* 4
| version number for the ntp peer |
| **server** list / elements=string | | List of ntp servers. |
| | **enabled** boolean | **Choices:*** no
* yes
| Disables/Enables ntp server |
| | **ip\_or\_name** string / required | | Configures ntp server name or ip. |
| | **key\_id** integer | | Used to configure the key-id for the ntp server |
| | **state** string | **Choices:*** present
* absent
| Indicates if the ntp peer exists or should be deleted. |
| | **trusted\_enable** boolean | **Choices:*** no
* yes
| Disables/Enables the trusted state for the ntp server. |
| | **version** integer | **Choices:*** 3
* 4
| version number for the ntp server |
Examples
--------
```
- name: Configure NTP peers and servers
onyx_ntp_peers_servers:
peer:
- ip_or_name: 1.1.1.1
enabled: yes
version: 4
key_id: 6
state: present
server:
- ip_or_name: 2.2.2.2
enabled: true
version: 3
key_id: 8
trusted_enable: no
state: present
ntpdate: 192.168.10.10
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always. | The list of configuration mode commands to send to the device **Sample:** ['ntp peer 1.1.1.1 disable no ntp peer 1.1.1.1 disable ntp peer 1.1.1.1 keyId 6 ntp peer 1.1.1.1 version 4 no ntp peer 1.1.1.1 ntp server 2.2.2.2 disable no ntp server 2.2.2.2 disable ntp server 2.2.2.2 keyID 8 ntp server 2.2.2.2 version 3 ntp server 2.2.2.2 trusted-enable no ntp server 2.2.2.2 ntp server 192.168.10.10 ntpdate 192.168.10.10'] |
### Authors
* Sara-Touqan (@sarato)
ansible mellanox.onyx.onyx_igmp_interface β Configures IGMP interface parameters mellanox.onyx.onyx\_igmp\_interface β Configures IGMP interface parameters
==========================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_igmp_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of IGMP interface configuration on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **name** string / required | | interface name that we want to configure IGMP on it |
| **state** string | **Choices:*** **enabled** β
* disabled
| IGMP Interface state. |
Notes
-----
Note
* Tested on ONYX 3.6.8130
Examples
--------
```
- name: Configure igmp interface
onyx_igmp_interface:
state: enabled
name: Eth1/1
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['interface ethernet 1/1 ip igmp snooping fast-leave'] |
### Authors
* Anas Badaha (@anasb)
ansible mellanox.onyx.onyx_wjh β Configure what-just-happend module mellanox.onyx.onyx\_wjh β Configure what-just-happend module
============================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_wjh`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of wjh on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auto\_export** boolean | **Choices:*** no
* yes
| wjh group auto export pcap file status |
| **clear\_group** string | **Choices:*** all
* user
* auto-export
| clear pcap file by group |
| **enabled** boolean | **Choices:*** no
* yes
| wjh group status |
| **export\_group** string | **Choices:*** all
* forwarding
* acl
| wjh group auto export group |
| **group** string | **Choices:*** all
* forwarding
* acl
| Name of wjh group. |
Examples
--------
```
- name: Enable wjh
onyx_wjh:
group: forwarding
enabled: True
- name: Disable wjh
onyx_wjh:
group: forwarding
enabled: False
- name: Enable auto-export
onyx_wjh:
auto_export: True
export_group: forwarding
- name: Disable auto-export
onyx_wjh:
auto_export: False
export_group: forwarding
- name: Clear pcap file
onyx_wjh:
clear_group: auto-export
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['what-just-happend forwarding enable', 'what-just-happend auto-export forwarding enable', 'clear what-just-happend pcap-file user'] |
### Authors
* Anas Shami (@anass)
ansible mellanox.onyx.onyx β Use onyx cliconf to run command on Mellanox ONYX platform mellanox.onyx.onyx β Use onyx cliconf to run command on Mellanox ONYX platform
==============================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx`.
New in version 2.5: of mellanox.onyx
Synopsis
--------
* This onyx plugin provides low level abstraction apis for sending and receiving CLI commands from Mellanox ONYX network devices.
ansible mellanox.onyx.onyx_buffer_pool β Configures Buffer Pool mellanox.onyx.onyx\_buffer\_pool β Configures Buffer Pool
=========================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_buffer_pool`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of Onyx Buffer Pool configuration on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **memory\_percent** string | | memory percent. |
| **name** string / required | | pool name. |
| **pool\_type** string | **Choices:*** lossless
* **lossy** β
| pool type. |
| **switch\_priority** string | | switch priority, range 1-7. |
Notes
-----
Note
* Tested on ONYX 3.6.8130
Examples
--------
```
- name: Configure buffer pool
onyx_buffer_pool:
name: roce
pool_type: lossless
memory_percent: 50.00
switch_priority: 3
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['traffic pool roce type lossless', 'traffic pool roce memory percent 50.00', 'traffic pool roce map switch-priority 3'] |
### Authors
* Anas Badaha (@anasb)
ansible mellanox.onyx.onyx_snmp_hosts β Configures SNMP host parameters mellanox.onyx.onyx\_snmp\_hosts β Configures SNMP host parameters
=================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_snmp_hosts`.
New in version 0.2.0: of mellanox.onyx
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of SNMP hosts protocol params on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **hosts** list / elements=string | | List of snmp hosts |
| | **auth\_password** string | | The password needed to configure the auth type. |
| | **auth\_type** string | **Choices:*** md5
* sha
* sha224
* sha256
* sha384
* sha512
| Configures SNMP v3 security parameters, specifying passwords in a nother parameter (auth\_password) (passwords are always stored encrypted). |
| | **enabled** boolean | **Choices:*** no
* yes
| Temporarily Enables/Disables sending of all notifications to this host. |
| | **name** string / required | | Specifies the name of the host. |
| | **notification\_type** string | **Choices:*** trap
* inform
| Configures the type of sending notification to the specified host. |
| | **port** string | | Overrides default target port for this host. |
| | **privacy\_password** string | | The password needed to configure the privacy type. |
| | **privacy\_type** string | **Choices:*** 3des
* aes-128
* aes-192
* aes-192-cfb
* aes-256
* aes-256-cfb
* des
| Specifys SNMP v3 privacy settings for this user. |
| | **state** string | **Choices:*** present
* absent
| Used to decide if you want to delete the specified host or not. |
| | **user\_name** string | | Specifys username for this inform sink. |
| | **version** string | **Choices:*** 1
* 2c
* 3
| Specifys SNMP version of informs to send. |
Examples
--------
```
- name: Enables snmp host
onyx_snmp_hosts:
hosts:
- name: 1.1.1.1
enabled: true
- name: Configures snmp host with version 2c
onyx_snmp_hosts:
hosts:
- name: 2.3.2.4
enabled: true
notification_type: trap
port: 66
version: 2c
- name: Configures snmp host with version 3 and configures it with user as sara
onyx_snmp_hosts:
hosts:
- name: 2.3.2.4
enabled: true
notification_type: trap
port: 66
version: 3
user_name: sara
auth_type: sha
auth_password: jnbdfijbdsf
privacy_type: 3des
privacy_password: nojfd8uherwiugfh
- name: Deletes the snmp host
onyx_snmp_hosts:
hosts:
- name: 2.3.2.4
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['snmp-server host <host\_name> disable', 'no snmp-server host <host\_name> disable', 'snmp-server host <host\_name> informs port <port\_number> version <version\_number>', 'snmp-server host <host\_name> traps port <port\_number> version <version\_number>', 'snmp-server host <host\_name> informs port <port\_number> version <version\_number> user <user\_name> auth <auth\_type> <auth\_password> priv <privacy\_type> <privacy\_password>', 'snmp-server host <host\_name> traps port <port\_number> version <version\_number> user <user\_name> auth <auth\_type> <auth\_password> priv <privacy\_type> <privacy\_password>', 'no snmp-server host <host\_name>.'] |
### Authors
* Sara Touqan (@sarato)
ansible mellanox.onyx.onyx_aaa β Configures AAA parameters mellanox.onyx.onyx\_aaa β Configures AAA parameters
===================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_aaa`.
New in version 0.2.0: of mellanox.onyx
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of AAA protocol params on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **auth\_default\_user** string | **Choices:*** admin
* monitor
| Sets local user default mapping. |
| **auth\_fallback\_enabled** boolean | **Choices:*** no
* yes
| Enables/Disables fallback server-err option. |
| **auth\_order** string | **Choices:*** local-only
* remote-first
* remote-only
| Sets the order on how to handle remote to local user mappings. |
| **tacacs\_accounting\_enabled** boolean | **Choices:*** no
* yes
| Configures accounting settings. |
Examples
--------
```
- name: Configures aaa
onyx_aaa:
tacacs_accounting_enabled: yes
auth_default_user: monitor
auth_order: local-only
auth_fallback_enabled: false
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['aaa accounting changes default stop-only tacacs+', 'no aaa accounting changes default stop-only tacacs+', 'aaa authorization map default-user <user>', 'aaa authorization map order <order>', 'aaa authorization map fallback server-err', 'no aaa authorization map fallback server-err'] |
### Authors
* Sara Touqan (@sarato)
ansible mellanox.onyx.onyx_bfd β Configures BFD parameters mellanox.onyx.onyx\_bfd β Configures BFD parameters
===================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_bfd`.
New in version 0.2.0: of mellanox.onyx
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of BFD protocol params on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **interval\_min\_rx** integer | | Minimum desired receive rate, should be between 50 and 6000. |
| **interval\_multiplier** integer | | Desired detection multiplier, should be between 3 and 50. |
| **interval\_transmit\_rate** integer | | Minimum desired transmit rate, should be between 50 and 60000. |
| **iproute\_mask\_length** integer | | Configures the mask length of the ip route network prefix, e.g 24. |
| **iproute\_network\_prefix** string | | Configures the ip route network prefix, e.g 1.1.1.1. |
| **iproute\_next\_hop** string | | Configures the ip route next hop, e.g 2.2.2.2. |
| **shutdown** boolean | **Choices:*** no
* yes
| Administratively shut down BFD protection. |
| **vrf** string | | Specifys the vrf name. |
Examples
--------
```
- name: Configures bfd
onyx_bfd:
shutdown: yes
vrf: 5
interval_min_rx: 55
interval_multiplier: 8
interval_transmit_rate: 88
iproute_network_prefix: 1.1.1.0
iproute_mask_length: 24
iproute_next_hop: 3.2.2.2
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['ip bfd shutdown', 'no ip bfd shutdown', 'ip bfd shutdown vrf <vrf\_name>', 'no ip bfd shutdown vrf <vrf\_name>', 'ip bfd vrf <vrf\_name> interval min-rx <min\_rx> multiplier <multiplier> transmit-rate <transmit\_rate> force', 'ip bfd interval min-rx <min\_rx> multiplier <multiplier> transmit-rate <transmit\_rate> force', 'ip route vrf <vrf\_name> <network\_prefix>/<mask\_length> <next\_hop> bfd', 'ip route <network\_prefix>/<mask\_length> <next\_hop> bfd'] |
### Authors
* Sara Touqan (@sarato)
| programming_docs |
ansible mellanox.onyx.onyx_igmp β Configures IGMP global parameters mellanox.onyx.onyx\_igmp β Configures IGMP global parameters
============================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_igmp`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of IGMP protocol params on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **default\_version** string | **Choices:*** V2
* V3
| Configure the default operating version of the IGMP snooping |
| **last\_member\_query\_interval** string | | Configure the last member query interval, range 1-25 |
| **mrouter\_timeout** string | | Configure the mrouter timeout, range 60-600 |
| **port\_purge\_timeout** string | | Configure the host port purge timeout, range 130-1225 |
| **proxy\_reporting** string | **Choices:*** enabled
* disabled
| Configure ip igmp snooping proxy and enable reporting mode |
| **report\_suppression\_interval** string | | Configure the report suppression interval, range 1-25 |
| **state** string / required | **Choices:*** enabled
* disabled
| IGMP state. |
| **unregistered\_multicast** string | **Choices:*** flood
* forward-to-mrouter-ports
| Configure the unregistered multicast mode Flood unregistered multicast Forward unregistered multicast to mrouter ports |
Notes
-----
Note
* Tested on ONYX 3.6.6107
Examples
--------
```
- name: Configure igmp
onyx_igmp:
state: enabled
unregistered_multicast: flood
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['ip igmp snooping', 'ip igmp snooping last-member-query-interval 10', 'ip igmp snooping mrouter-timeout 150', 'ip igmp snooping port-purge-timeout 150'] |
### Authors
* Samer Deeb (@samerd)
ansible mellanox.onyx.onyx_ntp β Manage NTP general configurations and ntp keys configurations on Mellanox ONYX network devices mellanox.onyx.onyx\_ntp β Manage NTP general configurations and ntp keys configurations on Mellanox ONYX network devices
========================================================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_ntp`.
New in version 0.2.0: of mellanox.onyx
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of NTP & NTP Keys on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **authenticate\_state** string | **Choices:*** enabled
* disabled
| State of the NTP authentication configuration. |
| **ntp\_authentication\_keys** list / elements=string | | List of ntp authentication keys |
| | **auth\_key\_encrypt\_type** string / required | **Choices:*** md5
* sha1
| encryption type used to configure ntp authentication key. |
| | **auth\_key\_id** integer / required | | Configures ntp key-id, range 1-65534 |
| | **auth\_key\_password** string / required | | password used for ntp authentication key. |
| | **auth\_key\_state** string | **Choices:*** present
* absent
| Used to decide if you want to delete given ntp key or not |
| **state** string | **Choices:*** enabled
* disabled
| State of the NTP configuration. |
| **trusted\_keys** list / elements=string | | List of ntp trusted keys |
Examples
--------
```
- name: Configure NTP
onyx_ntp:
state: enabled
authenticate_state: enabled
ntp_authentication_keys:
- auth_key_id: 1
auth_key_encrypt_type: md5
auth_key_password: 12345
auth_key_state: absent
trusted_keys: 1,2,3
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always. | The list of configuration mode commands to send to the device **Sample:** ['ntp enable', 'ntp disable', 'ntp authenticate', 'no ntp authenticate', 'ntp authentication-key 1 md5 12345', 'no ntp authentication-key 1', 'ntp trusted-key 1,2,3'] |
### Authors
* Sara-Touqan (@sarato)
ansible mellanox.onyx.onyx_l2_interface β Manage Layer-2 interface on Mellanox ONYX network devices mellanox.onyx.onyx\_l2\_interface β Manage Layer-2 interface on Mellanox ONYX network devices
=============================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_l2_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of Layer-2 interface on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_vlan** string | | Configure given VLAN in access port. |
| **aggregate** string | | List of Layer-2 interface definitions. |
| **mode** string | **Choices:*** **access** β
* trunk
* hybrid
| Mode in which interface needs to be configured. |
| **name** string | | Name of the interface. |
| **state** string | **Choices:*** **present** β
* absent
| State of the Layer-2 Interface configuration. |
| **trunk\_allowed\_vlans** string | | List of allowed VLANs in a given trunk port. |
Examples
--------
```
- name: Configure Layer-2 interface
onyx_l2_interface:
name: Eth1/1
mode: access
access_vlan: 30
- name: Remove Layer-2 interface configuration
onyx_l2_interface:
name: Eth1/1
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always. | The list of configuration mode commands to send to the device **Sample:** ['interface ethernet 1/1', 'switchport mode access', 'switchport access vlan 30'] |
### Authors
* Samer Deeb (@samerd)
ansible mellanox.onyx.onyx_ptp_interface β Configures PTP on interface mellanox.onyx.onyx\_ptp\_interface β Configures PTP on interface
================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_ptp_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of PTP interfaces configuration on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **announce\_interval** string | | configure PTP announce setting for interval, Range -3-1 |
| **announce\_timeout** string | | configure PTP announce setting for timeout, Range 2-10 |
| **delay\_request** string | | configure PTP delay request interval, Range 0-5 |
| **name** string / required | | ethernet or vlan interface name that we want to configure PTP on it |
| **state** string | **Choices:*** **enabled** β
* disabled
| Enable/Disable PTP on Interface |
| **sync\_interval** string | | configure PTP sync interval, Range -7--1 |
Notes
-----
Note
* Tested on ONYX 3.6.8130
* PTP Protocol must be enabled on switch.
* Interface must not be a switch port interface.
Examples
--------
```
- name: Configure PTP interface
onyx_ptp_interface:
state: enabled
name: Eth1/1
delay_request: 0
announce_interval: -2
announce_timeout: 3
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['interface ethernet 1/16 ptp enable', 'interface ethernet 1/16 ptp delay-req interval 0', 'interface ethernet 1/16 ptp announce interval -1'] |
### Authors
* Anas Badaha (@anasb)
ansible mellanox.onyx.onyx_lldp_interface β Manage LLDP interfaces configuration on Mellanox ONYX network devices mellanox.onyx.onyx\_lldp\_interface β Manage LLDP interfaces configuration on Mellanox ONYX network devices
===========================================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_lldp_interface`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of LLDP interfaces configuration on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of interfaces LLDP should be configured on. |
| **name** string | | Name of the interface LLDP should be configured on. |
| **purge** boolean | **Choices:*** **no** β
* yes
| Purge interfaces not defined in the aggregate parameter. |
| **state** string | **Choices:*** **present** β
* absent
* enabled
* disabled
| State of the LLDP configuration. |
Examples
--------
```
- name: Configure LLDP on specific interfaces
onyx_lldp_interface:
name: Eth1/1
state: present
- name: Disable LLDP on specific interfaces
onyx_lldp_interface:
name: Eth1/1
state: disabled
- name: Enable LLDP on specific interfaces
onyx_lldp_interface:
name: Eth1/1
state: enabled
- name: Delete LLDP on specific interfaces
onyx_lldp_interface:
name: Eth1/1
state: absent
- name: Create aggregate of LLDP interface configurations
onyx_lldp_interface:
aggregate:
- { name: Eth1/1 }
- { name: Eth1/2 }
state: present
- name: Delete aggregate of LLDP interface configurations
onyx_lldp_interface:
aggregate:
- { name: Eth1/1 }
- { name: Eth1/2 }
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always. | The list of configuration mode commands to send to the device **Sample:** ['interface ethernet 1/1 lldp transmit', 'interface ethernet 1/1 lldp receive'] |
### Authors
* Samer Deeb (@samerd)
ansible mellanox.onyx.onyx_igmp_vlan β Configures IGMP Vlan parameters mellanox.onyx.onyx\_igmp\_vlan β Configures IGMP Vlan parameters
================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_igmp_vlan`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management of IGMP vlan configuration on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **mrouter** string | | Configure ip igmp snooping mrouter port on vlan |
| | **name** string / required | | Configure mrouter interface |
| | **state** string | **Choices:*** **enabled** β
* disabled
| Enable IGMP snooping mrouter on vlan interface. |
| **querier** string | | Configure the IGMP querier parameters |
| | **address** string | | Update IP address for the querier |
| | **interval** string | | Update time interval between querier queries, range 60-600 |
| | **state** string | **Choices:*** **enabled** β
* disabled
| Enable IGMP snooping querier on vlan in the switch. |
| **state** string | **Choices:*** **enabled** β
* disabled
| IGMP state. |
| **static\_groups** string | | List of IGMP static groups. |
| | **multicast\_ip\_address** string / required | | Configure static IP multicast group, range 224.0.1.0-239.255.255.25. |
| | **name** string | | interface name to configure static groups on it. |
| | **sources** string | | List of IP sources to be configured |
| **version** string | **Choices:*** V2
* V3
| IGMP snooping operation version on this vlan |
| **vlan\_id** string / required | | VLAN ID, vlan should exist. |
Notes
-----
Note
* Tested on ONYX 3.7.0932-01
Examples
--------
```
- name: Configure igmp vlan
onyx_igmp_vlan:
state: enabled
vlan_id: 10
version:
V2
querier:
state: enabled
interval: 70
address: 10.11.121.13
mrouter:
state: disabled
name: Eth1/2
static_groups:
- multicast_ip_address: 224.5.5.8
name: Eth1/1
sources:
- 1.1.1.1
- 1.1.1.2
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['vlan 10 ip igmp snooping', 'vlan 10 ip igmp snooping static-group 224.5.5.5 interface ethernet 1/1'] |
### Authors
* Anas Badaha (@anasbadaha)
ansible mellanox.onyx.onyx_ospf β Manage OSPF protocol on Mellanox ONYX network devices mellanox.onyx.onyx\_ospf β Manage OSPF protocol on Mellanox ONYX network devices
================================================================================
Note
This plugin is part of the [mellanox.onyx collection](https://galaxy.ansible.com/mellanox/onyx) (version 1.0.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install mellanox.onyx`.
To use it in a playbook, specify: `mellanox.onyx.onyx_ospf`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides declarative management and configuration of OSPF protocol on Mellanox ONYX network devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **interfaces** string | | List of interfaces and areas. Required if *state=present*. |
| | **area** string / required | | OSPF area. |
| | **name** string / required | | Interface name. |
| **ospf** string / required | | OSPF instance number 1-65535 |
| **router\_id** string | | OSPF router ID. Required if *state=present*. |
| **state** string | **Choices:*** **present** β
* absent
| OSPF state. |
Notes
-----
Note
* Tested on ONYX 3.6.4000
Examples
--------
```
- name: Add ospf router to interface
onyx_ospf:
ospf: 2
router_id: 192.168.8.2
interfaces:
- name: Eth1/1
- area: 0.0.0.0
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device. **Sample:** ['router ospf 2', 'router-id 192.168.8.2', 'exit', 'interface ethernet 1/1 ip ospf area 0.0.0.0'] |
### Authors
* Samer Deeb (@samerd)
ansible Collections in the Ibm Namespace Collections in the Ibm Namespace
================================
These are the collections with docs hosted on [docs.ansible.com](https://docs.ansible.com/) in the **ibm** namespace.
* [ibm.qradar](qradar/index#plugins-in-ibm-qradar)
ansible ibm.qradar.offense_note β Create or update a QRadar Offense Note ibm.qradar.offense\_note β Create or update a QRadar Offense Note
=================================================================
Note
This plugin is part of the [ibm.qradar collection](https://galaxy.ansible.com/ibm/qradar) (version 1.0.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ibm.qradar`.
To use it in a playbook, specify: `ibm.qradar.offense_note`.
New in version 1.0.0: of ibm.qradar
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* This module allows to create a QRadar Offense note
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **id** integer / required | | Offense ID to operate on |
| **note\_text** string / required | | The note's text contents |
Examples
--------
```
- name: Add a note to QRadar Offense ID 1
ibm.qradar.offense_note:
id: 1
note_text: This an example note entry that should be made on offense id 1
```
### Authors
* Ansible Security Automation Team (@maxamillion) <<https://github.com/ansible-security>>
| programming_docs |
ansible ibm.qradar.deploy β Trigger a qradar configuration deployment ibm.qradar.deploy β Trigger a qradar configuration deployment
=============================================================
Note
This plugin is part of the [ibm.qradar collection](https://galaxy.ansible.com/ibm/qradar) (version 1.0.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ibm.qradar`.
To use it in a playbook, specify: `ibm.qradar.deploy`.
New in version 1.0.0: of ibm.qradar
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* This module allows for INCREMENTAL or FULL deployments
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **type** string | **Choices:*** **INCREMENTAL** β
* FULL
| Type of deployment |
Notes
-----
Note
* This module does not support check mode because the QRadar REST API does not offer stateful inspection of configuration deployments
Examples
--------
```
- name: run an incremental deploy
ibm.qradar.deploy:
type: INCREMENTAL
```
### Authors
* Ansible Security Automation Team (@maxamillion) <<https://github.com/ansible-security>>
ansible ibm.qradar.offense_action β Take action on a QRadar Offense ibm.qradar.offense\_action β Take action on a QRadar Offense
============================================================
Note
This plugin is part of the [ibm.qradar collection](https://galaxy.ansible.com/ibm/qradar) (version 1.0.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ibm.qradar`.
To use it in a playbook, specify: `ibm.qradar.offense_action`.
New in version 1.0.0: of ibm.qradar
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* This module allows to assign, protect, follow up, set status, and assign closing reason to QRadar Offenses
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **assigned\_to** string | | Assign to an user, the QRadar username should be provided |
| **closing\_reason** string | | Assign a predefined closing reason here, by name. |
| **closing\_reason\_id** integer | | Assign a predefined closing reason here, by id. |
| **follow\_up** boolean | **Choices:*** no
* yes
| Set or unset the flag to follow up on a QRadar Offense |
| **id** integer / required | | ID of Offense |
| **protected** boolean | **Choices:*** no
* yes
| Set or unset the flag to protect a QRadar Offense |
| **status** string | **Choices:*** open
* OPEN
* hidden
* HIDDEN
* closed
* CLOSED
| One of "open", "hidden" or "closed". (Either all lower case or all caps) |
Notes
-----
Note
* Requires one of `name` or `id` be provided
* Only one of `closing_reason` or `closing_reason_id` can be provided
Examples
--------
### Authors
* Ansible Security Automation Team (@maxamillion) <<https://github.com/ansible-security>>
ansible ibm.qradar.rule β Manage state of QRadar Rules, with filter options ibm.qradar.rule β Manage state of QRadar Rules, with filter options
===================================================================
Note
This plugin is part of the [ibm.qradar collection](https://galaxy.ansible.com/ibm/qradar) (version 1.0.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ibm.qradar`.
To use it in a playbook, specify: `ibm.qradar.rule`.
New in version 1.0.0: of ibm.qradar
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Manage state of QRadar Rules, with filter options
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **id** integer | | Manage state of a QRadar Rule by ID |
| **name** string | | Manage state of a QRadar Rule by name |
| **owner** string | | Manage ownership of a QRadar Rule |
| **state** string / required | **Choices:*** enabled
* disabled
* absent
| Manage state of a QRadar Rule |
Examples
--------
```
- name: Enable Rule 'Ansible Example DDoS Rule'
qradar_rule:
name: 'Ansible Example DDOS Rule'
state: enabled
```
### Authors
* Ansible Security Automation Team (@maxamillion) <<https://github.com/ansible-security>>
ansible Ibm.Qradar Ibm.Qradar
==========
Collection version 1.0.3
Plugin Index
------------
These are the plugins in the ibm.qradar collection
### Httpapi Plugins
* [qradar](qradar_httpapi#ansible-collections-ibm-qradar-qradar-httpapi) β HttpApi Plugin for IBM QRadar
### Modules
* [deploy](deploy_module#ansible-collections-ibm-qradar-deploy-module) β Trigger a qradar configuration deployment
* [log\_source\_management](log_source_management_module#ansible-collections-ibm-qradar-log-source-management-module) β Manage Log Sources in QRadar
* [offense\_action](offense_action_module#ansible-collections-ibm-qradar-offense-action-module) β Take action on a QRadar Offense
* [offense\_info](offense_info_module#ansible-collections-ibm-qradar-offense-info-module) β Obtain information about one or many QRadar Offenses, with filter options
* [offense\_note](offense_note_module#ansible-collections-ibm-qradar-offense-note-module) β Create or update a QRadar Offense Note
* [rule](rule_module#ansible-collections-ibm-qradar-rule-module) β Manage state of QRadar Rules, with filter options
* [rule\_info](rule_info_module#ansible-collections-ibm-qradar-rule-info-module) β Obtain information about one or many QRadar Rules, with filter options
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible ibm.qradar.rule_info β Obtain information about one or many QRadar Rules, with filter options ibm.qradar.rule\_info β Obtain information about one or many QRadar Rules, with filter options
==============================================================================================
Note
This plugin is part of the [ibm.qradar collection](https://galaxy.ansible.com/ibm/qradar) (version 1.0.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ibm.qradar`.
To use it in a playbook, specify: `ibm.qradar.rule_info`.
New in version 1.0.0: of ibm.qradar
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* This module obtains information about one or many QRadar Rules, with filter options
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **id** integer | | Obtain only information of the Rule with provided ID |
| **name** string | | Obtain only information of the Rule that matches the provided name |
| **origin** string | **Choices:*** SYSTEM
* OVERRIDE
* USER
| Obtain only information of Rules that are of a certain origin |
| **owner** string | | Obtain only information of Rules owned by a certain user |
| **type** string | **Choices:*** EVENT
* FLOW
* COMMON
* USER
| Obtain only information for the Rules of a certain type |
Notes
-----
Note
* You may provide many filters and they will all be applied, except for `id` as that will return only the Rule identified by the unique ID provided.
Examples
--------
```
- name: Get information about the Rule named "Custom Company DDoS Rule"
ibm.qradar.rule_info:
name: "Custom Company DDoS Rule"
register: custom_ddos_rule_info
- name: debugging output of the custom_ddos_rule_info registered variable
debug:
var: custom_ddos_rule_info
```
### Authors
* Ansible Security Automation Team (@maxamillion) <<https://github.com/ansible-security>>β
ansible ibm.qradar.log_source_management β Manage Log Sources in QRadar ibm.qradar.log\_source\_management β Manage Log Sources in QRadar
=================================================================
Note
This plugin is part of the [ibm.qradar collection](https://galaxy.ansible.com/ibm/qradar) (version 1.0.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ibm.qradar`.
To use it in a playbook, specify: `ibm.qradar.log_source_management`.
New in version 1.0.0: of ibm.qradar
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* This module allows for addition, deletion, or modification of Log Sources in QRadar
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **description** string / required | | Description of log source |
| **identifier** string / required | | Log Source Identifier (Typically IP Address or Hostname of log source) |
| **name** string / required | | Name of Log Source |
| **protocol\_type\_id** integer | | Type of protocol by id, as defined in QRadar Log Source Types Documentation |
| **state** string / required | **Choices:*** present
* absent
| Add or remove a log source. |
| **type\_id** integer | | Type of resource by id, as defined in QRadar Log Source Types Documentation |
| **type\_name** string | | Type of resource by name |
Notes
-----
Note
* Either `type` or `type_id` is required
Examples
--------
```
- name: Add a snort log source to IBM QRadar
ibm.qradar.log_source_management:
name: "Snort logs"
type_name: "Snort Open Source IDS"
state: present
description: "Snort IDS remote logs from rsyslog"
identifier: "192.168.1.101"
```
### Authors
* Ansible Security Automation Team (@maxamillion) <<https://github.com/ansible-security>>
ansible ibm.qradar.qradar β HttpApi Plugin for IBM QRadar ibm.qradar.qradar β HttpApi Plugin for IBM QRadar
=================================================
Note
This plugin is part of the [ibm.qradar collection](https://galaxy.ansible.com/ibm/qradar) (version 1.0.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ibm.qradar`.
To use it in a playbook, specify: `ibm.qradar.qradar`.
New in version 1.0: of ibm.qradar
Synopsis
--------
* This HttpApi plugin provides methods to connect to IBM QRadar over a HTTP(S)-based api.
### Authors
* Ansible Security Automation Team
ansible ibm.qradar.offense_info β Obtain information about one or many QRadar Offenses, with filter options ibm.qradar.offense\_info β Obtain information about one or many QRadar Offenses, with filter options
====================================================================================================
Note
This plugin is part of the [ibm.qradar collection](https://galaxy.ansible.com/ibm/qradar) (version 1.0.3).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ibm.qradar`.
To use it in a playbook, specify: `ibm.qradar.offense_info`.
New in version 1.0.0: of ibm.qradar
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module allows to obtain information about one or many QRadar Offenses, with filter options
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **assigned\_to** string | | Obtain only information of Offenses assigned to a certain user |
| **closing\_reason** string | | Obtain only information of Offenses that were closed by a specific closing reason |
| **closing\_reason\_id** integer | | Obtain only information of Offenses that were closed by a specific closing reason ID |
| **follow\_up** boolean | **Choices:*** no
* yes
| Obtain only information of Offenses that are marked with the follow up flag |
| **id** integer | | Obtain only information of the Offense with provided ID |
| **name** string | | Obtain only information of the Offense that matches the provided name |
| **protected** boolean | **Choices:*** no
* yes
| Obtain only information of Offenses that are protected |
| **status** string | **Choices:*** **open** β
* OPEN
* hidden
* HIDDEN
* closed
* CLOSED
| Obtain only information of Offenses of a certain status |
Notes
-----
Note
* You may provide many filters and they will all be applied, except for `id` as that will return only
Examples
--------
```
- name: Get list of all currently OPEN IBM QRadar Offenses
ibm.qradar.offense_info:
status: OPEN
register: offense_list
- name: display offense information for debug purposes
debug:
var: offense_list
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **offenses** list / elements=dictionary | always | Information |
| | **qradar\_offenses** complex | always | IBM QRadar Offenses found based on provided filters |
| | | **name** string | always | Name of the service. **Sample:** arp-ethers.service |
| | | **source** string | always | Init system of the service. One of `systemd`, `sysv`, `upstart`. **Sample:** sysv |
| | | **state** string | always | State of the service. Either `running`, `stopped`, or `unknown`. **Sample:** running |
| | | **status** string | systemd systems or RedHat/SUSE flavored sysvinit/upstart | State of the service. Either `enabled`, `disabled`, or `unknown`. **Sample:** enabled |
### Authors
* Ansible Security Automation Team (@maxamillion) <<https://github.com/ansible-security>>
ansible Collections in the Ansible Namespace Collections in the Ansible Namespace
====================================
These are the collections with docs hosted on [docs.ansible.com](https://docs.ansible.com/) in the **ansible** namespace.
* [ansible.builtin](builtin/index#plugins-in-ansible-builtin)
* [ansible.netcommon](netcommon/index#plugins-in-ansible-netcommon)
* [ansible.posix](posix/index#plugins-in-ansible-posix)
* [ansible.utils](utils/index#plugins-in-ansible-utils)
* [ansible.windows](windows/index#plugins-in-ansible-windows)
ansible ansible.posix.selinux β Change policy and state of SELinux ansible.posix.selinux β Change policy and state of SELinux
==========================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.selinux`.
New in version 1.0.0: of ansible.posix
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Configures the SELinux mode and policy.
* A reboot may be required after usage.
* Ansible will not issue this reboot but will let you know when it is required.
Requirements
------------
The below requirements are needed on the host that executes this module.
* libselinux-python
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **configfile** string | **Default:**"/etc/selinux/config" | The path to the SELinux configuration file, if non-standard.
aliases: conf, file |
| **policy** string | | The name of the SELinux policy to use (e.g. `targeted`) will be required if *state* is not `disabled`. |
| **state** string / required | **Choices:*** disabled
* enforcing
* permissive
| The SELinux mode. |
Examples
--------
```
- name: Enable SELinux
ansible.posix.selinux:
policy: targeted
state: enforcing
- name: Put SELinux in permissive mode, logging actions that would be blocked.
ansible.posix.selinux:
policy: targeted
state: permissive
- name: Disable SELinux
ansible.posix.selinux:
state: disabled
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **configfile** string | always | Path to SELinux configuration file. **Sample:** /etc/selinux/config |
| **msg** string | always | Messages that describe changes that were made. **Sample:** Config SELinux state changed from 'disabled' to 'permissive' |
| **policy** string | always | Name of the SELinux policy. **Sample:** targeted |
| **reboot\_required** boolean | always | Whether or not an reboot is required for the changes to take effect. **Sample:** True |
| **state** string | always | SELinux mode. **Sample:** enforcing |
### Authors
* Derek Carter (@goozbach) <[[email protected]](https://docs.ansible.com/cdn-cgi/l/email-protection#22454d4d584043414a040111151904011710190401161a1944504b4d414d5056470401161419414d4f)>
ansible ansible.posix.debug β formatted stdout/stderr display ansible.posix.debug β formatted stdout/stderr display
=====================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.debug`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
Synopsis
--------
* Use this callback to sort through extensive debug output
Requirements
------------
The below requirements are needed on the local controller node that executes this callback.
* set as stdout in configuration
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **check\_mode\_markers** boolean added in 2.9 of ansible.builtin | **Choices:*** **no** β
* yes
| ini entries: [defaults]check\_mode\_markers = no env:ANSIBLE\_CHECK\_MODE\_MARKERS | Toggle to control displaying markers when running in check mode. The markers are `DRY RUN` at the beggining and ending of playbook execution (when calling `ansible-playbook --check`) and `CHECK MODE` as a suffix at every play and task that is run in check mode. |
| **display\_failed\_stderr** boolean added in 2.7 of ansible.builtin | **Choices:*** **no** β
* yes
| ini entries: [defaults]display\_failed\_stderr = no env:ANSIBLE\_DISPLAY\_FAILED\_STDERR | Toggle to control whether failed and unreachable tasks are displayed to STDERR (vs. STDOUT) |
| **display\_ok\_hosts** boolean added in 2.7 of ansible.builtin | **Choices:*** no
* **yes** β
| ini entries: [defaults]display\_ok\_hosts = yes env:ANSIBLE\_DISPLAY\_OK\_HOSTS | Toggle to control displaying 'ok' task/host results in a task |
| **display\_skipped\_hosts** boolean | **Choices:*** no
* **yes** β
| ini entries: [defaults]display\_skipped\_hosts = yes env:DISPLAY\_SKIPPED\_HOSTS Removed in: version 2.12 of ansible.builtin Why: environment variables without "ANSIBLE\_" prefix are deprecated Alternative: the "ANSIBLE\_DISPLAY\_SKIPPED\_HOSTS" environment variable env:ANSIBLE\_DISPLAY\_SKIPPED\_HOSTS | Toggle to control displaying skipped task/host results in a task |
| **show\_custom\_stats** boolean | **Choices:*** **no** β
* yes
| ini entries: [defaults]show\_custom\_stats = no env:ANSIBLE\_SHOW\_CUSTOM\_STATS | This adds the custom stats set via the set\_stats plugin to the play recap |
| **show\_per\_host\_start** boolean added in 2.9 of ansible.builtin | **Choices:*** **no** β
* yes
| ini entries: [defaults]show\_per\_host\_start = no env:ANSIBLE\_SHOW\_PER\_HOST\_START | This adds output that shows when a task is started to execute for each host |
| **show\_task\_path\_on\_failure** boolean added in 2.11 of ansible.builtin | **Choices:*** **no** β
* yes
| ini entries: [defaults]show\_task\_path\_on\_failure = no env:ANSIBLE\_SHOW\_TASK\_PATH\_ON\_FAILURE | When a task fails, display the path to the file containing the failed task and the line number. This information is displayed automatically for every task when running with `-vv` or greater verbosity. |
| programming_docs |
ansible Ansible.Posix Ansible.Posix
=============
Collection version 1.3.0
Plugin Index
------------
These are the plugins in the ansible.posix collection
### Callback Plugins
* [cgroup\_perf\_recap](cgroup_perf_recap_callback#ansible-collections-ansible-posix-cgroup-perf-recap-callback) β Profiles system activity of tasks and full execution using cgroups
* [debug](debug_callback#ansible-collections-ansible-posix-debug-callback) β formatted stdout/stderr display
* [json](json_callback#ansible-collections-ansible-posix-json-callback) β Ansible screen output as JSON
* [profile\_roles](profile_roles_callback#ansible-collections-ansible-posix-profile-roles-callback) β adds timing information to roles
* [profile\_tasks](profile_tasks_callback#ansible-collections-ansible-posix-profile-tasks-callback) β adds time information to tasks
* [skippy](skippy_callback#ansible-collections-ansible-posix-skippy-callback) β Ansible screen output that ignores skipped status
* [timer](timer_callback#ansible-collections-ansible-posix-timer-callback) β Adds time to play stats
### Modules
* [acl](acl_module#ansible-collections-ansible-posix-acl-module) β Set and retrieve file ACL information.
* [at](at_module#ansible-collections-ansible-posix-at-module) β Schedule the execution of a command or script file via the at command
* [authorized\_key](authorized_key_module#ansible-collections-ansible-posix-authorized-key-module) β Adds or removes an SSH authorized key
* [firewalld](firewalld_module#ansible-collections-ansible-posix-firewalld-module) β Manage arbitrary ports/services with firewalld
* [firewalld\_info](firewalld_info_module#ansible-collections-ansible-posix-firewalld-info-module) β Gather information about firewalld
* [mount](mount_module#ansible-collections-ansible-posix-mount-module) β Control active and configured mount points
* [patch](patch_module#ansible-collections-ansible-posix-patch-module) β Apply patch files using the GNU patch tool
* [seboolean](seboolean_module#ansible-collections-ansible-posix-seboolean-module) β Toggles SELinux booleans
* [selinux](selinux_module#ansible-collections-ansible-posix-selinux-module) β Change policy and state of SELinux
* [synchronize](synchronize_module#ansible-collections-ansible-posix-synchronize-module) β A wrapper around rsync to make common tasks in your playbooks quick and easy
* [sysctl](sysctl_module#ansible-collections-ansible-posix-sysctl-module) β Manage entries in sysctl.conf.
### Shell Plugins
* [csh](csh_shell#ansible-collections-ansible-posix-csh-shell) β C shell (/bin/csh)
* [fish](fish_shell#ansible-collections-ansible-posix-fish-shell) β fish shell (/bin/fish)
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible ansible.posix.profile_roles β adds timing information to roles ansible.posix.profile\_roles β adds timing information to roles
===============================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.profile_roles`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
Synopsis
--------
* This callback module provides profiling for ansible roles.
Requirements
------------
The below requirements are needed on the local controller node that executes this callback.
* whitelisting in configuration
ansible ansible.posix.firewalld β Manage arbitrary ports/services with firewalld ansible.posix.firewalld β Manage arbitrary ports/services with firewalld
========================================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.firewalld`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* This module allows for addition or deletion of services and ports (either TCP or UDP) in either running or permanent firewalld rules.
Requirements
------------
The below requirements are needed on the host that executes this module.
* firewalld >= 0.2.11
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **icmp\_block** string | | The ICMP block you would like to add/remove to/from a zone in firewalld. |
| **icmp\_block\_inversion** string | | Enable/Disable inversion of ICMP blocks for a zone in firewalld. |
| **immediate** boolean | **Choices:*** **no** β
* yes
| Should this configuration be applied immediately, if set as permanent. |
| **interface** string | | The interface you would like to add/remove to/from a zone in firewalld. |
| **masquerade** string | | The masquerade setting you would like to enable/disable to/from zones within firewalld. |
| **offline** boolean | **Choices:*** no
* yes
| Whether to run this module even when firewalld is offline. |
| **permanent** boolean | **Choices:*** no
* yes
| Should this configuration be in the running firewalld configuration or persist across reboots. As of Ansible 2.3, permanent operations can operate on firewalld configs when it is not running (requires firewalld >= 0.3.9). Note that if this is `no`, immediate is assumed `yes`. |
| **port** string | | Name of a port or port range to add/remove to/from firewalld. Must be in the form PORT/PROTOCOL or PORT-PORT/PROTOCOL for port ranges. |
| **port\_forward** list / elements=dictionary | | Port and protocol to forward using firewalld. |
| | **port** string / required | | Source port to forward from |
| | **proto** string / required | **Choices:*** udp
* tcp
| protocol to forward |
| | **toaddr** string | | Optional address to forward to |
| | **toport** string / required | | destination port |
| **rich\_rule** string | | Rich rule to add/remove to/from firewalld. See [Syntax for firewalld rich language rules](https://firewalld.org/documentation/man-pages/firewalld.richlanguage.html). |
| **service** string | | Name of a service to add/remove to/from firewalld. The service must be listed in output of firewall-cmd --get-services. |
| **source** string | | The source/network you would like to add/remove to/from firewalld. |
| **state** string / required | **Choices:*** absent
* disabled
* enabled
* present
| Enable or disable a setting. For ports: Should this port accept (enabled) or reject (disabled) connections. The states `present` and `absent` can only be used in zone level operations (i.e. when no other parameters but zone and state are set). |
| **target** string added in 1.2.0 of ansible.posix | **Choices:*** default
* ACCEPT
* DROP
* %%REJECT%%
| firewalld Zone target If state is set to `absent`, this will reset the target to default |
| **timeout** integer | **Default:**0 | The amount of time in seconds the rule should be in effect for when non-permanent. |
| **zone** string | | The firewalld zone to add/remove to/from. Note that the default zone can be configured per system but `public` is default from upstream. Available choices can be extended based on per-system configs, listed here are "out of the box" defaults. Possible values include `block`, `dmz`, `drop`, `external`, `home`, `internal`, `public`, `trusted`, `work`. |
Notes
-----
Note
* Not tested on any Debian based system.
* Requires the python2 bindings of firewalld, which may not be installed by default.
* For distributions where the python2 firewalld bindings are unavailable (e.g Fedora 28 and later) you will have to set the ansible\_python\_interpreter for these hosts to the python3 interpreter path and install the python3 bindings.
* Zone transactions (creating, deleting) can be performed by using only the zone and state parameters βpresentβ or βabsentβ. Note that zone transactions must explicitly be permanent. This is a limitation in firewalld. This also means that you will have to reload firewalld after adding a zone that you wish to perform immediate actions on. The module will not take care of this for you implicitly because that would undo any previously performed immediate actions which were not permanent. Therefore, if you require immediate access to a newly created zone it is recommended you reload firewalld immediately after the zone creation returns with a changed state and before you perform any other immediate, non-permanent actions on that zone.
Examples
--------
```
- name: permit traffic in default zone for https service
ansible.posix.firewalld:
service: https
permanent: yes
state: enabled
- name: do not permit traffic in default zone on port 8081/tcp
ansible.posix.firewalld:
port: 8081/tcp
permanent: yes
state: disabled
- ansible.posix.firewalld:
port: 161-162/udp
permanent: yes
state: enabled
- ansible.posix.firewalld:
zone: dmz
service: http
permanent: yes
state: enabled
- ansible.posix.firewalld:
rich_rule: rule service name="ftp" audit limit value="1/m" accept
permanent: yes
state: enabled
- ansible.posix.firewalld:
source: 192.0.2.0/24
zone: internal
state: enabled
- ansible.posix.firewalld:
zone: trusted
interface: eth2
permanent: yes
state: enabled
- ansible.posix.firewalld:
masquerade: yes
state: enabled
permanent: yes
zone: dmz
- ansible.posix.firewalld:
zone: custom
state: present
permanent: yes
- ansible.posix.firewalld:
zone: drop
state: enabled
permanent: yes
icmp_block_inversion: yes
- ansible.posix.firewalld:
zone: drop
state: enabled
permanent: yes
icmp_block: echo-request
- ansible.posix.firewalld:
zone: internal
state: present
permanent: yes
target: ACCEPT
- name: Redirect port 443 to 8443 with Rich Rule
ansible.posix.firewalld:
rich_rule: rule family=ipv4 forward-port port=443 protocol=tcp to-port=8443
zone: public
permanent: yes
immediate: yes
state: enabled
```
### Authors
* Adam Miller (@maxamillion)
ansible ansible.posix.fish β fish shell (/bin/fish) ansible.posix.fish β fish shell (/bin/fish)
===========================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.fish`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
Synopsis
--------
* This is here because some people are restricted to fish.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **admin\_users** list / elements=string | **Default:**["root", "toor"] | ini entries: [defaults]admin\_users = ['root', 'toor'] env:ANSIBLE\_ADMIN\_USERS var: ansible\_admin\_users | list of users to be expected to have admin privileges. This is used by the controller to determine how to share temporary files between the remote user and the become user. |
| **async\_dir** string | **Default:**"~/.ansible\_async" | ini entries: [defaults]async\_dir = ~/.ansible\_async env:ANSIBLE\_ASYNC\_DIR var: ansible\_async\_dir | Directory in which ansible will keep async job information |
| **common\_remote\_group** string added in 2.10 of ansible.builtin | | ini entries: [defaults]common\_remote\_group = None env:ANSIBLE\_COMMON\_REMOTE\_GROUP var: ansible\_common\_remote\_group | Checked when Ansible needs to execute a module as a different user. If setfacl and chown both fail and do not let the different user access the module's files, they will be chgrp'd to this group. In order for this to work, the remote\_user and become\_user must share a common group and this setting must be set to that group. |
| **environment** list / elements=string | **Default:**[{}] | | List of dictionaries of environment variables and their values to use when executing commands. |
| **remote\_tmp** string | **Default:**"~/.ansible/tmp" | ini entries: [defaults]remote\_tmp = ~/.ansible/tmp env:ANSIBLE\_REMOTE\_TEMP env:ANSIBLE\_REMOTE\_TMP var: ansible\_remote\_tmp | Temporary directory to use on targets when executing tasks. |
| **system\_tmpdirs** list / elements=string | **Default:**["/var/tmp", "/tmp"] | ini entries: [defaults]system\_tmpdirs = ['/var/tmp', '/tmp'] env:ANSIBLE\_SYSTEM\_TMPDIRS var: ansible\_system\_tmpdirs | List of valid system temporary directories on the managed machine for Ansible to choose when it cannot use ``remote\_tmp``, normally due to permission issues. These must be world readable, writable, and executable. This list should only contain directories which the system administrator has pre-created with the proper ownership and permissions otherwise security issues can arise. |
| **world\_readable\_temp** boolean added in 2.10 of ansible.builtin | **Choices:*** **no** β
* yes
| ini entries: [defaults]allow\_world\_readable\_tmpfiles = no env:ANSIBLE\_SHELL\_ALLOW\_WORLD\_READABLE\_TEMP var: ansible\_shell\_allow\_world\_readable\_temp | This makes the temporary files created on the machine world-readable and will issue a warning instead of failing the task. It is useful when becoming an unprivileged user. |
ansible ansible.posix.mount β Control active and configured mount points ansible.posix.mount β Control active and configured mount points
================================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.mount`.
New in version 1.0.0: of ansible.posix
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* This module controls active and configured mount points in `/etc/fstab`.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **backup** boolean | **Choices:*** **no** β
* yes
| Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly. |
| **boot** boolean | **Choices:*** no
* **yes** β
| Determines if the filesystem should be mounted on boot. Only applies to Solaris and Linux systems. For Solaris systems, `true` will set `yes` as the value of mount at boot in */etc/vfstab*. For Linux, FreeBSD, NetBSD and OpenBSD systems, `false` will add `noauto` to mount options in */etc/fstab*. To avoid mount option conflicts, if `noauto` specified in `opts`, mount module will ignore `boot`. |
| **dump** string | **Default:**0 | Dump (see fstab(5)). Note that if set to `null` and *state* set to `present`, it will cease to work and duplicate entries will be made with subsequent runs. Has no effect on Solaris systems. |
| **fstab** string | | File to use instead of `/etc/fstab`. You should not use this option unless you really know what you are doing. This might be useful if you need to configure mountpoints in a chroot environment. OpenBSD does not allow specifying alternate fstab files with mount so do not use this on OpenBSD with any state that operates on the live filesystem. This parameter defaults to /etc/fstab or /etc/vfstab on Solaris. |
| **fstype** string | | Filesystem type. Required when *state* is `present` or `mounted`. |
| **opts** string | | Mount options (see fstab(5), or vfstab(4) on Solaris). |
| **passno** string | **Default:**0 | Passno (see fstab(5)). Note that if set to `null` and *state* set to `present`, it will cease to work and duplicate entries will be made with subsequent runs. Deprecated on Solaris systems. |
| **path** path / required | | Path to the mount point (e.g. `/mnt/files`). Before Ansible 2.3 this option was only usable as *dest*, *destfile* and *name*.
aliases: name |
| **src** path | | Device (or NFS volume, or something else) to be mounted on *path*. Required when *state* set to `present` or `mounted`. |
| **state** string / required | **Choices:*** absent
* mounted
* present
* unmounted
* remounted
| If `mounted`, the device will be actively mounted and appropriately configured in *fstab*. If the mount point is not present, the mount point will be created. If `unmounted`, the device will be unmounted without changing *fstab*.
`present` only specifies that the device is to be configured in *fstab* and does not trigger or require a mount.
`absent` specifies that the device mount's entry will be removed from *fstab* and will also unmount the device and remove the mount point.
`remounted` specifies that the device will be remounted for when you want to force a refresh on the mount itself (added in 2.9). This will always return changed=true. If *opts* is set, the options will be applied to the remount, but will not change *fstab*. Additionally, if *opts* is set, and the remount command fails, the module will error to prevent unexpected mount changes. Try using `mounted` instead to work around this issue. |
Notes
-----
Note
* As of Ansible 2.3, the *name* option has been changed to *path* as default, but *name* still works as well.
* Using `remounted` with *opts* set may create unexpected results based on the existing options already defined on mount, so care should be taken to ensure that conflicting options are not present before hand.
Examples
--------
```
# Before 2.3, option 'name' was used instead of 'path'
- name: Mount DVD read-only
ansible.posix.mount:
path: /mnt/dvd
src: /dev/sr0
fstype: iso9660
opts: ro,noauto
state: present
- name: Mount up device by label
ansible.posix.mount:
path: /srv/disk
src: LABEL=SOME_LABEL
fstype: ext4
state: present
- name: Mount up device by UUID
ansible.posix.mount:
path: /home
src: UUID=b3e48f45-f933-4c8e-a700-22a159ec9077
fstype: xfs
opts: noatime
state: present
- name: Unmount a mounted volume
ansible.posix.mount:
path: /tmp/mnt-pnt
state: unmounted
- name: Remount a mounted volume
ansible.posix.mount:
path: /tmp/mnt-pnt
state: remounted
# The following will not save changes to fstab, and only be temporary until
# a reboot, or until calling "state: unmounted" followed by "state: mounted"
# on the same "path"
- name: Remount a mounted volume and append exec to the existing options
ansible.posix.mount:
path: /tmp
state: remounted
opts: exec
- name: Mount and bind a volume
ansible.posix.mount:
path: /system/new_volume/boot
src: /boot
opts: bind
state: mounted
fstype: none
- name: Mount an NFS volume
ansible.posix.mount:
src: 192.168.1.100:/nfs/ssd/shared_data
path: /mnt/shared_data
opts: rw,sync,hard,intr
state: mounted
fstype: nfs
- name: Mount NFS volumes with noauto according to boot option
ansible.posix.mount:
src: 192.168.1.100:/nfs/ssd/shared_data
path: /mnt/shared_data
opts: rw,sync,hard,intr
boot: no
state: mounted
fstype: nfs
```
### Authors
* Ansible Core Team
* Seth Vidal (@skvidal)
| programming_docs |
ansible ansible.posix.firewalld_info β Gather information about firewalld ansible.posix.firewalld\_info β Gather information about firewalld
==================================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.firewalld_info`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module gathers information about firewalld rules.
Requirements
------------
The below requirements are needed on the host that executes this module.
* firewalld >= 0.2.11
* python-firewall
* python-dbus
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **active\_zones** boolean | **Choices:*** **no** β
* yes
| Gather information about active zones. |
| **zones** list / elements=string | | Gather information about specific zones. If only works if `active_zones` is set to `false`. |
Examples
--------
```
- name: Gather information about active zones
ansible.posix.firewalld_info:
active_zones: yes
- name: Gather information about specific zones
ansible.posix.firewalld_info:
zones:
- public
- external
- internal
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **active\_zones** boolean | success | Gather active zones only if turn it `true`. |
| **collected\_zones** list / elements=string | success | A list of collected zones. **Sample:** ['external', 'internal'] |
| **firewalld\_info** complex | success | Returns various information about firewalld configuration. |
| | **default\_zones** string | success | The zone name of default zone. **Sample:** public |
| | **version** string | success | The version information of firewalld. **Sample:** 0.8.2 |
| | **zones** complex | success | A dict of zones to gather information. |
| | | **zone** complex | success | The zone name registered in firewalld. **Sample:** external |
| | | | **forward** boolean | success | The network interface forwarding. This parameter supports on python-firewall 0.9.0(or later) and is not collected in earlier versions. |
| | | | **forward\_ports** list / elements=string | success | A list of forwarding port pair with protocol. **Sample:** ['icmp', 'ipv6-icmp'] |
| | | | **icmp\_block\_inversion** boolean | success | The ICMP block inversion to block all ICMP requests. |
| | | | **icmp\_blocks** list / elements=string | success | A list of blocking icmp protocol. **Sample:** ['echo-request'] |
| | | | **interfaces** list / elements=string | success | A list of network interfaces. **Sample:** ['eth0', 'eth1'] |
| | | | **masquerade** boolean | success | The network interface masquerading. |
| | | | **ports** list / elements=string | success | A list of network port with protocol. **Sample:** [['22', 'tcp'], ['80', 'tcp']] |
| | | | **protocols** list / elements=string | success | A list of network protocol. **Sample:** ['icmp', 'ipv6-icmp'] |
| | | | **rich\_rules** list / elements=string | success | A list of rich language rule. **Sample:** ['rule protocol value="icmp" reject', 'rule priority="32767" reject'] |
| | | | **services** list / elements=string | success | A list of network services. **Sample:** ['dhcp', 'dns', 'ssh'] |
| | | | **source\_ports** list / elements=string | success | A list of network source port with protocol. **Sample:** [['30000', 'tcp'], ['30001', 'tcp']] |
| | | | **sources** list / elements=string | success | A list of source network address. **Sample:** ['172.16.30.0/24', '172.16.31.0/24'] |
| | | | **target** string | success | A list of services in the zone. **Sample:** ACCEPT |
| **undefined\_zones** list / elements=string | success | A list of undefined zones in `zones` option.
`undefined_zones` will be ignored for gathering process. **Sample:** ['foo', 'bar'] |
### Authors
* Hideki Saito (@saito-hideki)
ansible ansible.posix.authorized_key β Adds or removes an SSH authorized key ansible.posix.authorized\_key β Adds or removes an SSH authorized key
=====================================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.authorized_key`.
New in version 1.0.0: of ansible.posix
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Adds or removes SSH authorized keys for particular user accounts.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **comment** string | | Change the comment on the public key. Rewriting the comment is useful in cases such as fetching it from GitHub or GitLab. If no comment is specified, the existing comment will be kept. |
| **exclusive** boolean | **Choices:*** **no** β
* yes
| Whether to remove all other non-specified keys from the authorized\_keys file. Multiple keys can be specified in a single `key` string value by separating them by newlines. This option is not loop aware, so if you use `with_` , it will be exclusive per iteration of the loop. If you want multiple keys in the file you need to pass them all to `key` in a single batch as mentioned above. |
| **follow** boolean | **Choices:*** **no** β
* yes
| Follow path symlink instead of replacing it. |
| **key** string / required | | The SSH public key(s), as a string or (since Ansible 1.9) url (https://github.com/username.keys). |
| **key\_options** string | | A string of ssh key options to be prepended to the key in the authorized\_keys file. |
| **manage\_dir** boolean | **Choices:*** no
* **yes** β
| Whether this module should manage the directory of the authorized key file. If set to `yes`, the module will create the directory, as well as set the owner and permissions of an existing directory. Be sure to set `manage_dir=no` if you are using an alternate directory for authorized\_keys, as set with `path`, since you could lock yourself out of SSH access. See the example below. |
| **path** path | | Alternate path to the authorized\_keys file. When unset, this value defaults to *~/.ssh/authorized\_keys*. |
| **state** string | **Choices:*** absent
* **present** β
| Whether the given key (with the given key\_options) should or should not be in the file. |
| **user** string / required | | The username on the remote host whose authorized\_keys file will be modified. |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| This only applies if using a https url as the source of the keys. If set to `no`, the SSL certificates will not be validated. This should only set to `no` used on personally controlled sites using self-signed certificates as it avoids verifying the source site. Prior to 2.1 the code worked as if this was set to `yes`. |
Examples
--------
```
- name: Set authorized key taken from file
ansible.posix.authorized_key:
user: charlie
state: present
key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
- name: Set authorized keys taken from url
ansible.posix.authorized_key:
user: charlie
state: present
key: https://github.com/charlie.keys
- name: Set authorized key in alternate location
ansible.posix.authorized_key:
user: charlie
state: present
key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
path: /etc/ssh/authorized_keys/charlie
manage_dir: False
- name: Set up multiple authorized keys
ansible.posix.authorized_key:
user: deploy
state: present
key: '{{ item }}'
with_file:
- public_keys/doe-jane
- public_keys/doe-john
- name: Set authorized key defining key options
ansible.posix.authorized_key:
user: charlie
state: present
key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
key_options: 'no-port-forwarding,from="10.0.1.1"'
- name: Set authorized key without validating the TLS/SSL certificates
ansible.posix.authorized_key:
user: charlie
state: present
key: https://github.com/user.keys
validate_certs: False
- name: Set authorized key, removing all the authorized keys already set
ansible.posix.authorized_key:
user: root
key: "{{ lookup('file', 'public_keys/doe-jane') }}"
state: present
exclusive: True
- name: Set authorized key for user ubuntu copying it from current user
ansible.posix.authorized_key:
user: ubuntu
state: present
key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}"
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **exclusive** boolean | success | If the key has been forced to be exclusive or not. |
| **key** string | success | The key that the module was running against. **Sample:** https://github.com/user.keys |
| **key\_option** string | success | Key options related to the key. |
| **keyfile** string | success | Path for authorized key file. **Sample:** /home/user/.ssh/authorized\_keys |
| **manage\_dir** boolean | success | Whether this module managed the directory of the authorized key file. **Sample:** True |
| **path** string | success | Alternate path to the authorized\_keys file |
| **state** string | success | Whether the given key (with the given key\_options) should or should not be in the file **Sample:** present |
| **unique** boolean | success | Whether the key is unique |
| **user** string | success | The username on the remote host whose authorized\_keys file will be modified **Sample:** user |
| **validate\_certs** boolean | success | This only applies if using a https url as the source of the keys. If set to `no`, the SSL certificates will not be validated. **Sample:** True |
### Authors
* Ansible Core Team
ansible ansible.posix.cgroup_perf_recap β Profiles system activity of tasks and full execution using cgroups ansible.posix.cgroup\_perf\_recap β Profiles system activity of tasks and full execution using cgroups
======================================================================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.cgroup_perf_recap`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
Synopsis
--------
* This is an ansible callback plugin utilizes cgroups to profile system activity of ansible and individual tasks, and display a recap at the end of the playbook execution
Requirements
------------
The below requirements are needed on the local controller node that executes this callback.
* whitelist in configuration
* cgroups
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **control\_group** string / required | | ini entries: [callback\_cgroup\_perf\_recap]control\_group = None env:CGROUP\_CONTROL\_GROUP | Name of cgroups control group |
| **cpu\_poll\_interval** float | **Default:**0.25 | ini entries: [callback\_cgroup\_perf\_recap]cpu\_poll\_interval = 0.25 env:CGROUP\_CPU\_POLL\_INTERVAL | Interval between CPU polling for determining CPU usage. A lower value may produce inaccurate results, a higher value may not be short enough to collect results for short tasks. |
| **display\_recap** boolean | **Choices:*** no
* **yes** β
| ini entries: [callback\_cgroup\_perf\_recap]display\_recap = yes env:CGROUP\_DISPLAY\_RECAP | Controls whether the recap is printed at the end, useful if you will automatically process the output files |
| **file\_name\_format** string | **Default:**"%(feature)s.%(ext)s" | ini entries: [callback\_cgroup\_perf\_recap]file\_name\_format = %(feature)s.%(ext)s env:CGROUP\_FILE\_NAME\_FORMAT | Format of filename. Accepts `%(counter`s), `%(task_uuid`s), `%(feature`s), `%(ext`s). Defaults to `%(feature`s.%(ext)s) when `file_per_task` is `False` and `%(counter`s-%(task\_uuid)s-%(feature)s.%(ext)s) when `True`
|
| **file\_per\_task** boolean | **Choices:*** **no** β
* yes
| ini entries: [callback\_cgroup\_perf\_recap]file\_per\_task = no env:CGROUP\_FILE\_PER\_TASK | When set as `True` along with `write_files`, this callback will write 1 file per task instead of 1 file for the entire playbook run |
| **memory\_poll\_interval** float | **Default:**0.25 | ini entries: [callback\_cgroup\_perf\_recap]memory\_poll\_interval = 0.25 env:CGROUP\_MEMORY\_POLL\_INTERVAL | Interval between memory polling for determining memory usage. A lower value may produce inaccurate results, a higher value may not be short enough to collect results for short tasks. |
| **output\_dir** path | **Default:**"/tmp/ansible-perf-%s" | ini entries: [callback\_cgroup\_perf\_recap]output\_dir = /tmp/ansible-perf-%s env:CGROUP\_OUTPUT\_DIR | Output directory for files containing recorded performance readings. If the value contains a single %s, the start time of the playbook run will be inserted in that space. Only the deepest level directory will be created if it does not exist, parent directories will not be created. |
| **output\_format** string | **Choices:*** **csv** β
* json
| ini entries: [callback\_cgroup\_perf\_recap]output\_format = csv env:CGROUP\_OUTPUT\_FORMAT | Output format, either CSV or JSON-seq |
| **pid\_poll\_interval** float | **Default:**0.25 | ini entries: [callback\_cgroup\_perf\_recap]pid\_poll\_interval = 0.25 env:CGROUP\_PID\_POLL\_INTERVAL | Interval between PID polling for determining PID count. A lower value may produce inaccurate results, a higher value may not be short enough to collect results for short tasks. |
| **write\_files** boolean | **Choices:*** **no** β
* yes
| ini entries: [callback\_cgroup\_perf\_recap]write\_files = no env:CGROUP\_WRITE\_FILES | Dictates whether files will be written containing performance readings |
Notes
-----
Note
* Requires ansible to be run from within a cgroup, such as with `cgexec -g cpuacct,memory,pids:ansible_profile ansible-playbook ...`
* This cgroup should only be used by ansible to get accurate results
* To create the cgroup, first use a command such as `sudo cgcreate -a ec2-user:ec2-user -t ec2-user:ec2-user -g cpuacct,memory,pids:ansible_profile`
ansible ansible.posix.csh β C shell (/bin/csh) ansible.posix.csh β C shell (/bin/csh)
======================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.csh`.
* [Synopsis](#synopsis)
* [Parameters](#parameters)
Synopsis
--------
* When you have no other option than to use csh
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **admin\_users** list / elements=string | **Default:**["root", "toor"] | ini entries: [defaults]admin\_users = ['root', 'toor'] env:ANSIBLE\_ADMIN\_USERS var: ansible\_admin\_users | list of users to be expected to have admin privileges. This is used by the controller to determine how to share temporary files between the remote user and the become user. |
| **async\_dir** string | **Default:**"~/.ansible\_async" | ini entries: [defaults]async\_dir = ~/.ansible\_async env:ANSIBLE\_ASYNC\_DIR var: ansible\_async\_dir | Directory in which ansible will keep async job information |
| **common\_remote\_group** string added in 2.10 of ansible.builtin | | ini entries: [defaults]common\_remote\_group = None env:ANSIBLE\_COMMON\_REMOTE\_GROUP var: ansible\_common\_remote\_group | Checked when Ansible needs to execute a module as a different user. If setfacl and chown both fail and do not let the different user access the module's files, they will be chgrp'd to this group. In order for this to work, the remote\_user and become\_user must share a common group and this setting must be set to that group. |
| **environment** list / elements=string | **Default:**[{}] | | List of dictionaries of environment variables and their values to use when executing commands. |
| **remote\_tmp** string | **Default:**"~/.ansible/tmp" | ini entries: [defaults]remote\_tmp = ~/.ansible/tmp env:ANSIBLE\_REMOTE\_TEMP env:ANSIBLE\_REMOTE\_TMP var: ansible\_remote\_tmp | Temporary directory to use on targets when executing tasks. |
| **system\_tmpdirs** list / elements=string | **Default:**["/var/tmp", "/tmp"] | ini entries: [defaults]system\_tmpdirs = ['/var/tmp', '/tmp'] env:ANSIBLE\_SYSTEM\_TMPDIRS var: ansible\_system\_tmpdirs | List of valid system temporary directories on the managed machine for Ansible to choose when it cannot use ``remote\_tmp``, normally due to permission issues. These must be world readable, writable, and executable. This list should only contain directories which the system administrator has pre-created with the proper ownership and permissions otherwise security issues can arise. |
| **world\_readable\_temp** boolean added in 2.10 of ansible.builtin | **Choices:*** **no** β
* yes
| ini entries: [defaults]allow\_world\_readable\_tmpfiles = no env:ANSIBLE\_SHELL\_ALLOW\_WORLD\_READABLE\_TEMP var: ansible\_shell\_allow\_world\_readable\_temp | This makes the temporary files created on the machine world-readable and will issue a warning instead of failing the task. It is useful when becoming an unprivileged user. |
ansible ansible.posix.skippy β Ansible screen output that ignores skipped status ansible.posix.skippy β Ansible screen output that ignores skipped status
========================================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.skippy`.
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
The βdefaultβ callback plugin now supports this functionality
Alternative
βdefaultβ callback plugin with βdisplay\_skipped\_hosts = noβ option
Synopsis
--------
* This callback does the same as the default except it does not output skipped host/task/item status
Requirements
------------
The below requirements are needed on the local controller node that executes this callback.
* set as main display callback
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **check\_mode\_markers** boolean added in 2.9 of ansible.builtin | **Choices:*** **no** β
* yes
| ini entries: [defaults]check\_mode\_markers = no env:ANSIBLE\_CHECK\_MODE\_MARKERS | Toggle to control displaying markers when running in check mode. The markers are `DRY RUN` at the beggining and ending of playbook execution (when calling `ansible-playbook --check`) and `CHECK MODE` as a suffix at every play and task that is run in check mode. |
| **display\_failed\_stderr** boolean added in 2.7 of ansible.builtin | **Choices:*** **no** β
* yes
| ini entries: [defaults]display\_failed\_stderr = no env:ANSIBLE\_DISPLAY\_FAILED\_STDERR | Toggle to control whether failed and unreachable tasks are displayed to STDERR (vs. STDOUT) |
| **display\_ok\_hosts** boolean added in 2.7 of ansible.builtin | **Choices:*** no
* **yes** β
| ini entries: [defaults]display\_ok\_hosts = yes env:ANSIBLE\_DISPLAY\_OK\_HOSTS | Toggle to control displaying 'ok' task/host results in a task |
| **display\_skipped\_hosts** boolean | **Choices:*** no
* **yes** β
| ini entries: [defaults]display\_skipped\_hosts = yes env:DISPLAY\_SKIPPED\_HOSTS Removed in: version 2.12 of ansible.builtin Why: environment variables without "ANSIBLE\_" prefix are deprecated Alternative: the "ANSIBLE\_DISPLAY\_SKIPPED\_HOSTS" environment variable env:ANSIBLE\_DISPLAY\_SKIPPED\_HOSTS | Toggle to control displaying skipped task/host results in a task |
| **show\_custom\_stats** boolean | **Choices:*** **no** β
* yes
| ini entries: [defaults]show\_custom\_stats = no env:ANSIBLE\_SHOW\_CUSTOM\_STATS | This adds the custom stats set via the set\_stats plugin to the play recap |
| **show\_per\_host\_start** boolean added in 2.9 of ansible.builtin | **Choices:*** **no** β
* yes
| ini entries: [defaults]show\_per\_host\_start = no env:ANSIBLE\_SHOW\_PER\_HOST\_START | This adds output that shows when a task is started to execute for each host |
| **show\_task\_path\_on\_failure** boolean added in 2.11 of ansible.builtin | **Choices:*** **no** β
* yes
| ini entries: [defaults]show\_task\_path\_on\_failure = no env:ANSIBLE\_SHOW\_TASK\_PATH\_ON\_FAILURE | When a task fails, display the path to the file containing the failed task and the line number. This information is displayed automatically for every task when running with `-vv` or greater verbosity. |
Status
------
* This callback will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
| programming_docs |
ansible ansible.posix.at β Schedule the execution of a command or script file via the at command ansible.posix.at β Schedule the execution of a command or script file via the at command
========================================================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.at`.
New in version 1.0.0: of ansible.posix
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Use this module to schedule a command or script file to run once in the future.
* All jobs are executed in the βaβ queue.
Requirements
------------
The below requirements are needed on the host that executes this module.
* at
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **command** string | | A command to be executed in the future. |
| **count** integer | | The count of units in the future to execute the command or script file. |
| **script\_file** string | | An existing script file to be executed in the future. |
| **state** string | **Choices:*** absent
* **present** β
| The state dictates if the command or script file should be evaluated as present(added) or absent(deleted). |
| **unique** boolean | **Choices:*** **no** β
* yes
| If a matching job is present a new job will not be added. |
| **units** string | **Choices:*** minutes
* hours
* days
* weeks
| The type of units in the future to execute the command or script file. |
Examples
--------
```
- name: Schedule a command to execute in 20 minutes as root
ansible.posix.at:
command: ls -d / >/dev/null
count: 20
units: minutes
- name: Match a command to an existing job and delete the job
ansible.posix.at:
command: ls -d / >/dev/null
state: absent
- name: Schedule a command to execute in 20 minutes making sure it is unique in the queue
ansible.posix.at:
command: ls -d / >/dev/null
count: 20
units: minutes
unique: yes
```
### Authors
* Richard Isaacson (@risaacson)
ansible ansible.posix.synchronize β A wrapper around rsync to make common tasks in your playbooks quick and easy ansible.posix.synchronize β A wrapper around rsync to make common tasks in your playbooks quick and easy
========================================================================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.synchronize`.
New in version 1.0.0: of ansible.posix
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [See Also](#see-also)
* [Examples](#examples)
Synopsis
--------
* `synchronize` is a wrapper around rsync to make common tasks in your playbooks quick and easy.
* It is run and originates on the local host where Ansible is being run.
* Of course, you could just use the `command` action to call rsync yourself, but you also have to add a fair number of boilerplate options and host facts.
* This module is not intended to provide access to the full power of rsync, but does make the most common invocations easier to implement. You `still` may need to call rsync directly via `command` or `shell` depending on your use case.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **archive** boolean | **Choices:*** no
* **yes** β
| Mirrors the rsync archive flag, enables recursive, links, perms, times, owner, group flags and -D. |
| **checksum** boolean | **Choices:*** **no** β
* yes
| Skip based on checksum, rather than mod-time & size; Note that that "archive" option is still enabled by default - the "checksum" option will not disable it. |
| **compress** boolean | **Choices:*** no
* **yes** β
| Compress file data during the transfer. In most cases, leave this enabled unless it causes problems. |
| **copy\_links** boolean | **Choices:*** **no** β
* yes
| Copy symlinks as the item that they point to (the referent) is copied, rather than the symlink. |
| **delay\_updates** boolean added in 1.3.0 of ansible.posix | **Choices:*** no
* **yes** β
| This option puts the temporary file from each updated file into a holding directory until the end of the transfer, at which time all the files are renamed into place in rapid succession. |
| **delete** boolean | **Choices:*** **no** β
* yes
| Delete files in *dest* that do not exist (after transfer, not before) in the *src* path. This option requires *recursive=yes*. This option ignores excluded files and behaves like the rsync opt `--delete-after`. |
| **dest** string / required | | Path on the destination host that will be synchronized from the source. The path can be absolute or relative. |
| **dest\_port** integer | | Port number for ssh on the destination host. Prior to Ansible 2.0, the ansible\_ssh\_port inventory var took precedence over this value. This parameter defaults to the value of `ansible_port`, the `remote_port` config setting or the value from ssh client configuration if none of the former have been set. |
| **dirs** boolean | **Choices:*** **no** β
* yes
| Transfer directories without recursing. |
| **existing\_only** boolean | **Choices:*** **no** β
* yes
| Skip creating new files on receiver. |
| **group** boolean | **Choices:*** no
* yes
| Preserve group. This parameter defaults to the value of the archive option. |
| **link\_dest** list / elements=string | | Add a destination to hard link against during the rsync. |
| **links** boolean | **Choices:*** no
* yes
| Copy symlinks as symlinks. This parameter defaults to the value of the archive option. |
| **mode** string | **Choices:*** pull
* **push** β
| Specify the direction of the synchronization. In push mode the localhost or delegate is the source. In pull mode the remote host in context is the source. |
| **owner** boolean | **Choices:*** no
* yes
| Preserve owner (super user only). This parameter defaults to the value of the archive option. |
| **partial** boolean | **Choices:*** **no** β
* yes
| Tells rsync to keep the partial file which should make a subsequent transfer of the rest of the file much faster. |
| **perms** boolean | **Choices:*** no
* yes
| Preserve permissions. This parameter defaults to the value of the archive option. |
| **private\_key** path | | Specify the private key to use for SSH-based rsync connections (e.g. `~/.ssh/id_rsa`). |
| **recursive** boolean | **Choices:*** no
* yes
| Recurse into directories. This parameter defaults to the value of the archive option. |
| **rsync\_opts** list / elements=string | | Specify additional rsync options by passing in an array. Note that an empty string in `rsync_opts` will end up transfer the current working directory. |
| **rsync\_path** string | | Specify the rsync command to run on the remote host. See `--rsync-path` on the rsync man page. To specify the rsync command to run on the local host, you need to set this your task var `ansible_rsync_path`. |
| **rsync\_timeout** integer | **Default:**0 | Specify a `--timeout` for the rsync command in seconds. |
| **set\_remote\_user** boolean | **Choices:*** no
* **yes** β
| Put user@ for the remote paths. If you have a custom ssh config to define the remote user for a host that does not match the inventory user, you should set this parameter to `no`. |
| **src** string / required | | Path on the source host that will be synchronized to the destination. The path can be absolute or relative. |
| **ssh\_connection\_multiplexing** boolean | **Choices:*** **no** β
* yes
| SSH connection multiplexing for rsync is disabled by default to prevent misconfigured ControlSockets from resulting in failed SSH connections. This is accomplished by setting the SSH `ControlSocket` to `none`. Set this option to `yes` to allow multiplexing and reduce SSH connection overhead. Note that simply setting this option to `yes` is not enough; You must also configure SSH connection multiplexing in your SSH client config by setting values for `ControlMaster`, `ControlPersist` and `ControlPath`. |
| **times** boolean | **Choices:*** no
* yes
| Preserve modification times. This parameter defaults to the value of the archive option. |
| **use\_ssh\_args** boolean | **Choices:*** **no** β
* yes
| In Ansible 2.10 and lower, it uses the ssh\_args specified in `ansible.cfg`. In Ansible 2.11 and onwards, when set to `true`, it uses all SSH connection configurations like `ansible_ssh_args`, `ansible_ssh_common_args`, and `ansible_ssh_extra_args`. |
| **verify\_host** boolean | **Choices:*** **no** β
* yes
| Verify destination host key. |
Notes
-----
Note
* rsync must be installed on both the local and remote host.
* For the `synchronize` module, the βlocal hostβ is the host `the synchronize task originates on`, and the βdestination hostβ is the host `synchronize is connecting to`.
* The βlocal hostβ can be changed to a different host by using `delegate_to`. This enables copying between two remote hosts or entirely on one remote machine.
* The user and permissions for the synchronize `src` are those of the user running the Ansible task on the local host (or the remote\_user for a delegate\_to host when delegate\_to is used).
* The user and permissions for the synchronize `dest` are those of the `remote_user` on the destination host or the `become_user` if `become=yes` is active.
* In Ansible 2.0 a bug in the synchronize module made become occur on the βlocal hostβ. This was fixed in Ansible 2.0.1.
* Currently, synchronize is limited to elevating permissions via passwordless sudo. This is because rsync itself is connecting to the remote machine and rsync doesnβt give us a way to pass sudo credentials in.
* Currently there are only a few connection types which support synchronize (ssh, paramiko, local, and docker) because a sync strategy has been determined for those connection types. Note that the connection for these must not need a password as rsync itself is making the connection and rsync does not provide us a way to pass a password to the connection.
* Expect that dest=~/x will be ~<remote\_user>/x even if using sudo.
* Inspect the verbose output to validate the destination user/host/path are what was expected.
* To exclude files and directories from being synchronized, you may add `.rsync-filter` files to the source directory.
* rsync daemon must be up and running with correct permission when using rsync protocol in source or destination path.
* The `synchronize` module enables `βdelay-updates` by default to avoid leaving a destination in a broken in-between state if the underlying rsync process encounters an error. Those synchronizing large numbers of files that are willing to trade safety for performance should disable this option.
* link\_destination is subject to the same limitations as the underlying rsync daemon. Hard links are only preserved if the relative subtrees of the source and destination are the same. Attempts to hardlink into a directory that is a subdirectory of the source will be prevented.
See Also
--------
See also
M(copy)
The official documentation on the **copy** module.
[community.windows.win\_robocopy](../../community/windows/win_robocopy_module#ansible-collections-community-windows-win-robocopy-module)
The official documentation on the **community.windows.win\_robocopy** module.
Examples
--------
```
- name: Synchronization of src on the control machine to dest on the remote hosts
ansible.posix.synchronize:
src: some/relative/path
dest: /some/absolute/path
- name: Synchronization using rsync protocol (push)
ansible.posix.synchronize:
src: some/relative/path/
dest: rsync://somehost.com/path/
- name: Synchronization using rsync protocol (pull)
ansible.posix.synchronize:
mode: pull
src: rsync://somehost.com/path/
dest: /some/absolute/path/
- name: Synchronization using rsync protocol on delegate host (push)
ansible.posix.synchronize:
src: /some/absolute/path/
dest: rsync://somehost.com/path/
delegate_to: delegate.host
- name: Synchronization using rsync protocol on delegate host (pull)
ansible.posix.synchronize:
mode: pull
src: rsync://somehost.com/path/
dest: /some/absolute/path/
delegate_to: delegate.host
- name: Synchronization without any --archive options enabled
ansible.posix.synchronize:
src: some/relative/path
dest: /some/absolute/path
archive: no
- name: Synchronization with --archive options enabled except for --recursive
ansible.posix.synchronize:
src: some/relative/path
dest: /some/absolute/path
recursive: no
- name: Synchronization with --archive options enabled except for --times, with --checksum option enabled
ansible.posix.synchronize:
src: some/relative/path
dest: /some/absolute/path
checksum: yes
times: no
- name: Synchronization without --archive options enabled except use --links
ansible.posix.synchronize:
src: some/relative/path
dest: /some/absolute/path
archive: no
links: yes
- name: Synchronization of two paths both on the control machine
ansible.posix.synchronize:
src: some/relative/path
dest: /some/absolute/path
delegate_to: localhost
- name: Synchronization of src on the inventory host to the dest on the localhost in pull mode
ansible.posix.synchronize:
mode: pull
src: some/relative/path
dest: /some/absolute/path
- name: Synchronization of src on delegate host to dest on the current inventory host.
ansible.posix.synchronize:
src: /first/absolute/path
dest: /second/absolute/path
delegate_to: delegate.host
- name: Synchronize two directories on one remote host.
ansible.posix.synchronize:
src: /first/absolute/path
dest: /second/absolute/path
delegate_to: "{{ inventory_hostname }}"
- name: Synchronize and delete files in dest on the remote host that are not found in src of localhost.
ansible.posix.synchronize:
src: some/relative/path
dest: /some/absolute/path
delete: yes
recursive: yes
# This specific command is granted su privileges on the destination
- name: Synchronize using an alternate rsync command
ansible.posix.synchronize:
src: some/relative/path
dest: /some/absolute/path
rsync_path: su -c rsync
# Example .rsync-filter file in the source directory
# - var # exclude any path whose last part is 'var'
# - /var # exclude any path starting with 'var' starting at the source directory
# + /var/conf # include /var/conf even though it was previously excluded
- name: Synchronize passing in extra rsync options
ansible.posix.synchronize:
src: /tmp/helloworld
dest: /var/www/helloworld
rsync_opts:
- "--no-motd"
- "--exclude=.git"
# Hardlink files if they didn't change
- name: Use hardlinks when synchronizing filesystems
ansible.posix.synchronize:
src: /tmp/path_a/foo.txt
dest: /tmp/path_b/foo.txt
link_dest: /tmp/path_a/
# Specify the rsync binary to use on remote host and on local host
- hosts: groupofhosts
vars:
ansible_rsync_path: /usr/gnu/bin/rsync
tasks:
- name: copy /tmp/localpath/ to remote location /tmp/remotepath
ansible.posix.synchronize:
src: /tmp/localpath/
dest: /tmp/remotepath
rsync_path: /usr/gnu/bin/rsync
```
### Authors
* Timothy Appnel (@tima)
ansible ansible.posix.patch β Apply patch files using the GNU patch tool ansible.posix.patch β Apply patch files using the GNU patch tool
================================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.patch`.
New in version 1.0.0: of ansible.posix
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Apply patch files using the GNU patch tool.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **backup** boolean | **Choices:*** **no** β
* yes
| Passes `--backup --version-control=numbered` to patch, producing numbered backup copies. |
| **basedir** path | | Path of a base directory in which the patch file will be applied. May be omitted when `dest` option is specified, otherwise required. |
| **binary** boolean | **Choices:*** **no** β
* yes
| Setting to `yes` will disable patch's heuristic for transforming CRLF line endings into LF. Line endings of src and dest must match. If set to `no`, `patch` will replace CRLF in `src` files on POSIX. |
| **dest** path | | Path of the file on the remote machine to be patched. The names of the files to be patched are usually taken from the patch file, but if there's just one file to be patched it can specified with this option.
aliases: originalfile |
| **ignore\_whitespace** boolean | **Choices:*** **no** β
* yes
| Setting to `yes` will ignore white space changes between patch and input.. |
| **remote\_src** boolean | **Choices:*** **no** β
* yes
| If `no`, it will search for src at originating/controller machine, if `yes` it will go to the remote/target machine for the `src`. |
| **src** path / required | | Path of the patch file as accepted by the GNU patch tool. If `remote_src` is 'no', the patch source file is looked up from the module's *files* directory.
aliases: patchfile |
| **state** string | **Choices:*** absent
* **present** β
| Whether the patch should be applied or reverted. |
| **strip** integer | **Default:**0 | Number that indicates the smallest prefix containing leading slashes that will be stripped from each file name found in the patch file. For more information see the strip parameter of the GNU patch tool. |
Notes
-----
Note
* This module requires GNU *patch* utility to be installed on the remote host.
Examples
--------
```
- name: Apply patch to one file
ansible.posix.patch:
src: /tmp/index.html.patch
dest: /var/www/index.html
- name: Apply patch to multiple files under basedir
ansible.posix.patch:
src: /tmp/customize.patch
basedir: /var/www
strip: 1
- name: Revert patch to one file
ansible.posix.patch:
src: /tmp/index.html.patch
dest: /var/www/index.html
state: absent
```
### Authors
* Jakub Jirutka (@jirutka)
* Luis Alberto Perez Lazaro (@luisperlaz)
ansible ansible.posix.json β Ansible screen output as JSON ansible.posix.json β Ansible screen output as JSON
==================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.json`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
Synopsis
--------
* This callback converts all events into JSON output to stdout
Requirements
------------
The below requirements are needed on the local controller node that executes this callback.
* Set as stdout in config
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **show\_custom\_stats** boolean | **Choices:*** **no** β
* yes
| ini entries: [defaults]show\_custom\_stats = no env:ANSIBLE\_SHOW\_CUSTOM\_STATS | This adds the custom stats set via the set\_stats plugin to the play recap |
Notes
-----
Note
* When using a strategy such as free, host\_pinned, or a custom strategy, host results will be added to new task results in `.plays[].tasks[]`. As such, there will exist duplicate task objects indicated by duplicate task IDs at `.plays[].tasks[].task.id`, each with an individual host result for the task.
| programming_docs |
ansible ansible.posix.acl β Set and retrieve file ACL information. ansible.posix.acl β Set and retrieve file ACL information.
==========================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.acl`.
New in version 1.0.0: of ansible.posix
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Set and retrieve file ACL information.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **default** boolean | **Choices:*** **no** β
* yes
| If the target is a directory, setting this to `yes` will make it the default ACL for entities created inside the directory. Setting `default` to `yes` causes an error if the path is a file. |
| **entity** string | | The actual user or group that the ACL applies to when matching entity types user or group are selected. |
| **entry** string | | DEPRECATED. The ACL to set or remove. This must always be quoted in the form of `<etype>:<qualifier>:<perms>`. The qualifier may be empty for some types, but the type and perms are always required.
`-` can be used as placeholder when you do not care about permissions. This is now superseded by entity, type and permissions fields. |
| **etype** string | **Choices:*** group
* mask
* other
* user
| The entity type of the ACL to apply, see `setfacl` documentation for more info. |
| **follow** boolean | **Choices:*** no
* **yes** β
| Whether to follow symlinks on the path if a symlink is encountered. |
| **path** path / required | | The full path of the file or object.
aliases: name |
| **permissions** string | | The permissions to apply/remove can be any combination of `r`, `w`, `x`
(read, write and execute respectively), and `X` (execute permission if the file is a directory or already has execute permission for some user) |
| **recalculate\_mask** string | **Choices:*** **default** β
* mask
* no\_mask
| Select if and when to recalculate the effective right masks of the files. See `setfacl` documentation for more info. Incompatible with `state=query`. |
| **recursive** boolean | **Choices:*** **no** β
* yes
| Recursively sets the specified ACL. Incompatible with `state=query`. Alias `recurse` added in version 1.3.0.
aliases: recurse |
| **state** string | **Choices:*** absent
* present
* **query** β
| Define whether the ACL should be present or not. The `query` state gets the current ACL without changing it, for use in `register` operations. |
| **use\_nfsv4\_acls** boolean | **Choices:*** **no** β
* yes
| Use NFSv4 ACLs instead of POSIX ACLs. |
Notes
-----
Note
* The `acl` module requires that ACLs are enabled on the target filesystem and that the `setfacl` and `getfacl` binaries are installed.
* As of Ansible 2.0, this module only supports Linux distributions.
* As of Ansible 2.3, the *name* option has been changed to *path* as default, but *name* still works as well.
Examples
--------
```
- name: Grant user Joe read access to a file
ansible.posix.acl:
path: /etc/foo.conf
entity: joe
etype: user
permissions: r
state: present
- name: Removes the ACL for Joe on a specific file
ansible.posix.acl:
path: /etc/foo.conf
entity: joe
etype: user
state: absent
- name: Sets default ACL for joe on /etc/foo.d/
ansible.posix.acl:
path: /etc/foo.d/
entity: joe
etype: user
permissions: rw
default: yes
state: present
- name: Same as previous but using entry shorthand
ansible.posix.acl:
path: /etc/foo.d/
entry: default:user:joe:rw-
state: present
- name: Obtain the ACL for a specific file
ansible.posix.acl:
path: /etc/foo.conf
register: acl_info
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **acl** list / elements=string | success | Current ACL on provided path (after changes, if any) **Sample:** ['user::rwx', 'group::rwx', 'other::rwx'] |
### Authors
* Brian Coca (@bcoca)
* JΓ©rΓ©mie Astori (@astorije)
ansible ansible.posix.seboolean β Toggles SELinux booleans ansible.posix.seboolean β Toggles SELinux booleans
==================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.seboolean`.
New in version 1.0.0: of ansible.posix
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* Toggles SELinux booleans.
Requirements
------------
The below requirements are needed on the host that executes this module.
* libselinux-python
* libsemanage-python
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **ignore\_selinux\_state** boolean | **Choices:*** **no** β
* yes
| Useful for scenarios (chrooted environment) that you can't get the real SELinux state. |
| **name** string / required | | Name of the boolean to configure. |
| **persistent** boolean | **Choices:*** **no** β
* yes
| Set to `yes` if the boolean setting should survive a reboot. |
| **state** boolean / required | **Choices:*** no
* yes
| Desired boolean value |
Notes
-----
Note
* Not tested on any Debian based system.
Examples
--------
```
- name: Set httpd_can_network_connect flag on and keep it persistent across reboots
ansible.posix.seboolean:
name: httpd_can_network_connect
state: yes
persistent: yes
```
### Authors
* Stephen Fromm (@sfromm)
ansible ansible.posix.profile_tasks β adds time information to tasks ansible.posix.profile\_tasks β adds time information to tasks
=============================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.profile_tasks`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* Ansible callback plugin for timing individual tasks and overall execution time.
* Mashup of 2 excellent original works: <https://github.com/jlafon/ansible-profile>, <https://github.com/junaid18183/ansible_home/blob/master/ansible_plugins/callback_plugins/timestamp.py.old>
* Format: `<task start timestamp> (<length of previous task>` <current elapsed playbook execution time>)
* It also lists the top/bottom time consuming tasks in the summary (configurable)
* Before 2.4 only the environment variables were available for configuration.
Requirements
------------
The below requirements are needed on the local controller node that executes this callback.
* whitelisting in configuration - see examples section below for details.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **output\_limit** string | **Default:**20 | ini entries: [callback\_profile\_tasks]task\_output\_limit = 20 env:PROFILE\_TASKS\_TASK\_OUTPUT\_LIMIT | Number of tasks to display in the summary |
| **sort\_order** string | **Choices:*** **descending** β
* ascending
* none
| ini entries: [callback\_profile\_tasks]sort\_order = descending env:PROFILE\_TASKS\_SORT\_ORDER | Adjust the sorting output of summary tasks |
Examples
--------
```
example: >
To enable, add this to your ansible.cfg file in the defaults block
[defaults]
callback_whitelist = ansible.posix.profile_tasks
sample output: >
#
# TASK: [ensure messaging security group exists] ********************************
# Thursday 11 June 2017 22:50:53 +0100 (0:00:00.721) 0:00:05.322 *********
# ok: [localhost]
#
# TASK: [ensure db security group exists] ***************************************
# Thursday 11 June 2017 22:50:54 +0100 (0:00:00.558) 0:00:05.880 *********
# changed: [localhost]
#
```
ansible ansible.posix.timer β Adds time to play stats ansible.posix.timer β Adds time to play stats
=============================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.timer`.
* [Synopsis](#synopsis)
* [Requirements](#requirements)
Synopsis
--------
* This callback just adds total play duration to the play stats.
Requirements
------------
The below requirements are needed on the local controller node that executes this callback.
* whitelist in configuration
ansible ansible.posix.sysctl β Manage entries in sysctl.conf. ansible.posix.sysctl β Manage entries in sysctl.conf.
=====================================================
Note
This plugin is part of the [ansible.posix collection](https://galaxy.ansible.com/ansible/posix) (version 1.3.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.posix`.
To use it in a playbook, specify: `ansible.posix.sysctl`.
New in version 1.0.0: of ansible.posix
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
Synopsis
--------
* This module manipulates sysctl entries and optionally performs a `/sbin/sysctl -p` after changing them.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **ignoreerrors** boolean | **Choices:*** **no** β
* yes
| Use this option to ignore errors about unknown keys. |
| **name** string / required | | The dot-separated path (also known as *key*) specifying the sysctl variable.
aliases: key |
| **reload** boolean | **Choices:*** no
* **yes** β
| If `yes`, performs a */sbin/sysctl -p* if the `sysctl_file` is updated. If `no`, does not reload *sysctl* even if the `sysctl_file` is updated. |
| **state** string | **Choices:*** **present** β
* absent
| Whether the entry should be present or absent in the sysctl file. |
| **sysctl\_file** path | **Default:**"/etc/sysctl.conf" | Specifies the absolute path to `sysctl.conf`, if not `/etc/sysctl.conf`. |
| **sysctl\_set** boolean | **Choices:*** **no** β
* yes
| Verify token value with the sysctl command and set with -w if necessary |
| **value** string | | Desired value of the sysctl key.
aliases: val |
Examples
--------
```
# Set vm.swappiness to 5 in /etc/sysctl.conf
- ansible.posix.sysctl:
name: vm.swappiness
value: '5'
state: present
# Remove kernel.panic entry from /etc/sysctl.conf
- ansible.posix.sysctl:
name: kernel.panic
state: absent
sysctl_file: /etc/sysctl.conf
# Set kernel.panic to 3 in /tmp/test_sysctl.conf
- ansible.posix.sysctl:
name: kernel.panic
value: '3'
sysctl_file: /tmp/test_sysctl.conf
reload: no
# Set ip forwarding on in /proc and verify token value with the sysctl command
- ansible.posix.sysctl:
name: net.ipv4.ip_forward
value: '1'
sysctl_set: yes
# Set ip forwarding on in /proc and in the sysctl file and reload if necessary
- ansible.posix.sysctl:
name: net.ipv4.ip_forward
value: '1'
sysctl_set: yes
state: present
reload: yes
```
### Authors
* David CHANIAL (@davixx)
ansible ansible.netcommon.restconf_config β Handles create, update, read and delete of configuration data on RESTCONF enabled devices. ansible.netcommon.restconf\_config β Handles create, update, read and delete of configuration data on RESTCONF enabled devices.
===============================================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.restconf_config`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* RESTCONF is a standard mechanisms to allow web applications to configure and manage data. RESTCONF is a IETF standard and documented on RFC 8040.
* This module allows the user to configure data on RESTCONF enabled devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **content** string | | The configuration data in format as specififed in `format` option. Required unless `method` is *delete*. |
| **format** string | **Choices:*** **json** β
* xml
| The format of the configuration provided as value of `content`. Accepted values are *xml* and *json* and the given configuration format should be supported by remote RESTCONF server. |
| **method** string | **Choices:*** **post** β
* put
* patch
* delete
| The RESTCONF method to manage the configuration change on device. The value *post* is used to create a data resource or invoke an operation resource, *put* is used to replace the target data resource, *patch* is used to modify the target resource, and *delete* is used to delete the target resource. |
| **path** string / required | | URI being used to execute API calls. |
Notes
-----
Note
* This module requires the RESTCONF system service be enabled on the remote device being managed.
* This module is supported with *ansible\_connection* value of *ansible.netcommon.httpapi* and *ansible\_network\_os* value of *ansible.netcommon.restconf*.
* This module is tested against Cisco IOSXE 16.12.02 version.
Examples
--------
```
- name: create l3vpn services
ansible.netcommon.restconf_config:
path: /config/ietf-l3vpn-svc:l3vpn-svc/vpn-services
content: |
{
"vpn-service":[
{
"vpn-id": "red_vpn2",
"customer-name": "blue",
"vpn-service-topology": "ietf-l3vpn-svc:any-to-any"
},
{
"vpn-id": "blue_vpn1",
"customer-name": "red",
"vpn-service-topology": "ietf-l3vpn-svc:any-to-any"
}
]
}
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **candidate** dictionary | When the method is not delete | The configuration sent to the device. **Sample:** { "vpn-service": [ { "customer-name": "red", "vpn-id": "blue\_vpn1", "vpn-service-topology": "ietf-l3vpn-svc:any-to-any" } ] } |
| **running** dictionary | When the method is not delete | The current running configuration on the device. **Sample:** { "vpn-service": [ { "vpn-id": "red\_vpn2", "customer-name": "blue", "vpn-service-topology": "ietf-l3vpn-svc:any-to-any" }, { "vpn-id": "blue\_vpn1", "customer-name": "red", "vpn-service-topology": "ietf-l3vpn-svc:any-to-any" } ] } |
### Authors
* Ganesh Nalawade (@ganeshrn)
ansible ansible.netcommon.persistent β Use a persistent unix socket for connection ansible.netcommon.persistent β Use a persistent unix socket for connection
==========================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.persistent`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Parameters](#parameters)
Synopsis
--------
* This is a helper plugin to allow making other connections persistent.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **persistent\_command\_timeout** integer | **Default:**30 | ini entries: [persistent\_connection]command\_timeout = 30 env:ANSIBLE\_PERSISTENT\_COMMAND\_TIMEOUT var: ansible\_command\_timeout | Configures, in seconds, the amount of time to wait for a command to return from the remote device. If this timer is exceeded before the command returns, the connection plugin will raise an exception and close. |
| **persistent\_connect\_timeout** integer | **Default:**30 | ini entries: [persistent\_connection]connect\_timeout = 30 env:ANSIBLE\_PERSISTENT\_CONNECT\_TIMEOUT var: ansible\_connect\_timeout | Configures, in seconds, the amount of time to wait when trying to initially establish a persistent connection. If this value expires before the connection to the remote device is completed, the connection will fail. |
| **persistent\_log\_messages** boolean | **Choices:*** **no** β
* yes
| ini entries: [persistent\_connection]log\_messages = no env:ANSIBLE\_PERSISTENT\_LOG\_MESSAGES var: ansible\_persistent\_log\_messages | This flag will enable logging the command executed and response received from target device in the ansible log file. For this option to work 'log\_path' ansible configuration option is required to be set to a file path with write access. Be sure to fully understand the security implications of enabling this option as it could create a security vulnerability by logging sensitive information in log file. |
### Authors
* Ansible Networking Team
ansible Ansible.Netcommon Ansible.Netcommon
=================
Collection version 2.4.0
Plugin Index
------------
These are the plugins in the ansible.netcommon collection
### Become Plugins
* [enable](enable_become#ansible-collections-ansible-netcommon-enable-become) β Switch to elevated permissions on a network device
### Cache Plugins
* [memory](memory_cache#ansible-collections-ansible-netcommon-memory-cache) β RAM backed, non persistent cache.
### Connection Plugins
* [httpapi](httpapi_connection#ansible-collections-ansible-netcommon-httpapi-connection) β Use httpapi to run command on network appliances
* [libssh](libssh_connection#ansible-collections-ansible-netcommon-libssh-connection) β (Tech preview) Run tasks using libssh for ssh connection
* [napalm](napalm_connection#ansible-collections-ansible-netcommon-napalm-connection) β Provides persistent connection using NAPALM
* [netconf](netconf_connection#ansible-collections-ansible-netcommon-netconf-connection) β Provides a persistent connection using the netconf protocol
* [network\_cli](network_cli_connection#ansible-collections-ansible-netcommon-network-cli-connection) β Use network\_cli to run command on network appliances
* [persistent](persistent_connection#ansible-collections-ansible-netcommon-persistent-connection) β Use a persistent unix socket for connection
### Httpapi Plugins
* [restconf](restconf_httpapi#ansible-collections-ansible-netcommon-restconf-httpapi) β HttpApi Plugin for devices supporting Restconf API
### Modules
* [cli\_command](cli_command_module#ansible-collections-ansible-netcommon-cli-command-module) β Run a cli command on cli-based network devices
* [cli\_config](cli_config_module#ansible-collections-ansible-netcommon-cli-config-module) β Push text based configuration to network devices over network\_cli
* [cli\_parse](cli_parse_module#ansible-collections-ansible-netcommon-cli-parse-module) β Parse cli output or text using a variety of parsers
* [net\_banner](net_banner_module#ansible-collections-ansible-netcommon-net-banner-module) β (deprecated, removed after 2022-06-01) Manage multiline banners on network devices
* [net\_get](net_get_module#ansible-collections-ansible-netcommon-net-get-module) β Copy a file from a network device to Ansible Controller
* [net\_interface](net_interface_module#ansible-collections-ansible-netcommon-net-interface-module) β (deprecated, removed after 2022-06-01) Manage Interface on network devices
* [net\_l2\_interface](net_l2_interface_module#ansible-collections-ansible-netcommon-net-l2-interface-module) β (deprecated, removed after 2022-06-01) Manage Layer-2 interface on network devices
* [net\_l3\_interface](net_l3_interface_module#ansible-collections-ansible-netcommon-net-l3-interface-module) β (deprecated, removed after 2022-06-01) Manage L3 interfaces on network devices
* [net\_linkagg](net_linkagg_module#ansible-collections-ansible-netcommon-net-linkagg-module) β (deprecated, removed after 2022-06-01) Manage link aggregation groups on network devices
* [net\_lldp](net_lldp_module#ansible-collections-ansible-netcommon-net-lldp-module) β (deprecated, removed after 2022-06-01) Manage LLDP service configuration on network devices
* [net\_lldp\_interface](net_lldp_interface_module#ansible-collections-ansible-netcommon-net-lldp-interface-module) β (deprecated, removed after 2022-06-01) Manage LLDP interfaces configuration on network devices
* [net\_logging](net_logging_module#ansible-collections-ansible-netcommon-net-logging-module) β (deprecated, removed after 2022-06-01) Manage logging on network devices
* [net\_ping](net_ping_module#ansible-collections-ansible-netcommon-net-ping-module) β Tests reachability using ping from a network device
* [net\_put](net_put_module#ansible-collections-ansible-netcommon-net-put-module) β Copy a file from Ansible Controller to a network device
* [net\_static\_route](net_static_route_module#ansible-collections-ansible-netcommon-net-static-route-module) β (deprecated, removed after 2022-06-01) Manage static IP routes on network appliances (routers, switches et. al.)
* [net\_system](net_system_module#ansible-collections-ansible-netcommon-net-system-module) β (deprecated, removed after 2022-06-01) Manage the system attributes on network devices
* [net\_user](net_user_module#ansible-collections-ansible-netcommon-net-user-module) β (deprecated, removed after 2022-06-01) Manage the aggregate of local users on network device
* [net\_vlan](net_vlan_module#ansible-collections-ansible-netcommon-net-vlan-module) β (deprecated, removed after 2022-06-01) Manage VLANs on network devices
* [net\_vrf](net_vrf_module#ansible-collections-ansible-netcommon-net-vrf-module) β (deprecated, removed after 2022-06-01) Manage VRFs on network devices
* [netconf\_config](netconf_config_module#ansible-collections-ansible-netcommon-netconf-config-module) β netconf device configuration
* [netconf\_get](netconf_get_module#ansible-collections-ansible-netcommon-netconf-get-module) β Fetch configuration/state data from NETCONF enabled network devices.
* [netconf\_rpc](netconf_rpc_module#ansible-collections-ansible-netcommon-netconf-rpc-module) β Execute operations on NETCONF enabled network devices.
* [network\_resource](network_resource_module#ansible-collections-ansible-netcommon-network-resource-module) β Manage resource modules
* [restconf\_config](restconf_config_module#ansible-collections-ansible-netcommon-restconf-config-module) β Handles create, update, read and delete of configuration data on RESTCONF enabled devices.
* [restconf\_get](restconf_get_module#ansible-collections-ansible-netcommon-restconf-get-module) β Fetch configuration/state data from RESTCONF enabled devices.
* [telnet](telnet_module#ansible-collections-ansible-netcommon-telnet-module) β Executes a low-down and dirty telnet command
### Netconf Plugins
* [default](default_netconf#ansible-collections-ansible-netcommon-default-netconf) β Use default netconf plugin to run standard netconf commands as per RFC
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
| programming_docs |
ansible ansible.netcommon.net_vlan β (deprecated, removed after 2022-06-01) Manage VLANs on network devices ansible.netcommon.net\_vlan β (deprecated, removed after 2022-06-01) Manage VLANs on network devices
====================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_vlan`.
New in version 1.0.0: of ansible.netcommon
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Updated modules released with more functionality
Alternative
Use platform-specific β[netos]\_vlansβ module
Synopsis
--------
* This module provides declarative management of VLANs on network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of VLANs definitions. |
| **interfaces** string | | List of interfaces the VLAN should be configured on. |
| **name** string | | Name of the VLAN. |
| **purge** string | **Default:**"no" | Purge VLANs not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** β
* absent
* active
* suspend
| State of the VLAN configuration. |
| **vlan\_id** string | | ID of the VLAN. |
Notes
-----
Note
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: configure VLAN ID and name
ansible.netcommon.net_vlan:
vlan_id: 20
name: test-vlan
- name: remove configuration
ansible.netcommon.net_vlan:
state: absent
- name: configure VLAN state
ansible.netcommon.net_vlan:
vlan_id:
state: suspend
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['vlan 20', 'name test-vlan'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ricardo Carrillo Cruz (@rcarrillocruz)
ansible ansible.netcommon.libssh β (Tech preview) Run tasks using libssh for ssh connection ansible.netcommon.libssh β (Tech preview) Run tasks using libssh for ssh connection
===================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.libssh`.
New in version 2.10: of ansible.netcommon
* [Synopsis](#synopsis)
* [Parameters](#parameters)
Synopsis
--------
* Use the ansible-pylibssh python bindings to connect to targets
* The python bindings use libssh C library (<https://www.libssh.org/>) to connect to targets
* This plugin borrows a lot of settings from the ssh plugin as they both cover the same protocol.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **host\_key\_auto\_add** boolean | **Choices:*** no
* yes
| ini entries: [libssh\_connection]host\_key\_auto\_add = None env:ANSIBLE\_LIBSSH\_HOST\_KEY\_AUTO\_ADD | TODO: write it |
| **host\_key\_checking** boolean | **Choices:*** no
* **yes** β
| ini entries: [defaults]host\_key\_checking = yes [libssh\_connection]host\_key\_checking = yes env:ANSIBLE\_HOST\_KEY\_CHECKING env:ANSIBLE\_SSH\_HOST\_KEY\_CHECKING env:ANSIBLE\_LIBSSH\_HOST\_KEY\_CHECKING var: ansible\_host\_key\_checking var: ansible\_ssh\_host\_key\_checking var: ansible\_libssh\_host\_key\_checking | Set this to "False" if you want to avoid host key checking by the underlying tools Ansible uses to connect to the host |
| **look\_for\_keys** boolean | **Choices:*** no
* **yes** β
| ini entries: [libssh\_connection]look\_for\_keys = yes env:ANSIBLE\_LIBSSH\_LOOK\_FOR\_KEYS | TODO: write it |
| **password** string | | var: ansible\_password var: ansible\_ssh\_pass var: ansible\_ssh\_password var: ansible\_libssh\_pass var: ansible\_libssh\_password | Secret used to either login the ssh server or as a passphrase for ssh keys that require it Can be set from the CLI via the `--ask-pass` option. |
| **proxy\_command** string | **Default:**"" | ini entries: [libssh\_connection]proxy\_command = env:ANSIBLE\_LIBSSH\_PROXY\_COMMAND var: ansible\_paramiko\_proxy\_command var: ansible\_libssh\_proxy\_command | Proxy information for running the connection via a jumphost. Also this plugin will scan 'ssh\_args', 'ssh\_extra\_args' and 'ssh\_common\_args' from the 'ssh' plugin settings for proxy information if set. |
| **pty** boolean | **Choices:*** no
* **yes** β
| ini entries: [libssh\_connection]pty = yes env:ANSIBLE\_LIBSSH\_PTY | TODO: write it |
| **remote\_addr** string | **Default:**"inventory\_hostname" | var: ansible\_host var: ansible\_ssh\_host var: ansible\_libssh\_host | Address of the remote target |
| **remote\_user** string | | ini entries: [defaults]remote\_user = None [libssh\_connection]remote\_user = None env:ANSIBLE\_REMOTE\_USER env:ANSIBLE\_LIBSSH\_REMOTE\_USER var: ansible\_user var: ansible\_ssh\_user var: ansible\_libssh\_user | User to login/authenticate as Can be set from the CLI via the `--user` or `-u` options. |
| **use\_persistent\_connections** boolean | **Choices:*** **no** β
* yes
| ini entries: [defaults]use\_persistent\_connections = no env:ANSIBLE\_USE\_PERSISTENT\_CONNECTIONS | Toggles the use of persistence for connections |
### Authors
* Ansible Team
ansible ansible.netcommon.cli_config β Push text based configuration to network devices over network_cli ansible.netcommon.cli\_config β Push text based configuration to network devices over network\_cli
==================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.cli_config`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This module provides platform agnostic way of pushing text based configuration to network devices over network\_cli connection plugin.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **backup** boolean | **Choices:*** **no** β
* yes
| This argument will cause the module to create a full backup of the current running config from the remote device before any changes are made. If the `backup_options` value is not given, the backup file is written to the `backup` folder in the playbook root directory or role root directory, if playbook is part of an ansible role. If the directory does not exist, it is created. |
| **backup\_options** dictionary | | This is a dict object containing configurable options related to backup file path. The value of this option is read only when `backup` is set to *yes*, if `backup` is set to *no* this option will be silently ignored. |
| | **dir\_path** path | | This option provides the path ending with directory name in which the backup configuration file will be stored. If the directory does not exist it will be first created and the filename is either the value of `filename` or default filename as described in `filename` options description. If the path value is not given in that case a *backup* directory will be created in the current working directory and backup configuration will be copied in `filename` within *backup* directory. |
| | **filename** string | | The filename to be used to store the backup configuration. If the filename is not given it will be generated based on the hostname, current time and date in format defined by <hostname>\_config.<current-date>@<current-time> |
| **commit** boolean | **Choices:*** no
* yes
| The `commit` argument instructs the module to push the configuration to the device. This is mapped to module check mode. |
| **commit\_comment** string | | The `commit_comment` argument specifies a text string to be used when committing the configuration. If the `commit` argument is set to False, this argument is silently ignored. This argument is only valid for the platforms that support commit operation with comment. |
| **config** string | | The config to be pushed to the network device. This argument is mutually exclusive with `rollback` and either one of the option should be given as input. To ensure idempotency and correct diff the configuration lines should be similar to how they appear if present in the running configuration on device including the indentation. |
| **defaults** boolean | **Choices:*** **no** β
* yes
| The *defaults* argument will influence how the running-config is collected from the device. When the value is set to true, the command used to collect the running-config is append with the all keyword. When the value is set to false, the command is issued without the all keyword. |
| **diff\_ignore\_lines** list / elements=string | | Use this argument to specify one or more lines that should be ignored during the diff. This is used for lines in the configuration that are automatically updated by the system. This argument takes a list of regular expressions or exact line matches. Note that this parameter will be ignored if the platform has onbox diff support. |
| **diff\_match** string | **Choices:*** line
* strict
* exact
* none
| Instructs the module on the way to perform the matching of the set of commands against the current device config. If `diff_match` is set to *line*, commands are matched line by line. If `diff_match` is set to *strict*, command lines are matched with respect to position. If `diff_match` is set to *exact*, command lines must be an equal match. Finally, if `diff_match` is set to *none*, the module will not attempt to compare the source configuration with the running configuration on the remote device. Note that this parameter will be ignored if the platform has onbox diff support. |
| **diff\_replace** string | **Choices:*** line
* block
* config
| Instructs the module on the way to perform the configuration on the device. If the `diff_replace` argument is set to *line* then the modified lines are pushed to the device in configuration mode. If the argument is set to *block* then the entire command block is pushed to the device in configuration mode if any line is not correct. Note that this parameter will be ignored if the platform has onbox diff support. |
| **multiline\_delimiter** string | | This argument is used when pushing a multiline configuration element to the device. It specifies the character to use as the delimiting character. This only applies to the configuration action. |
| **replace** string | | If the `replace` argument is set to `yes`, it will replace the entire running-config of the device with the `config` argument value. For devices that support replacing running configuration from file on device like NXOS/JUNOS, the `replace` argument takes path to the file on the device that will be used for replacing the entire running-config. The value of `config` option should be *None* for such devices. Nexus 9K devices only support replace. Use *net\_put* or *nxos\_file\_copy* in case of NXOS module to copy the flat file to remote device and then use set the fullpath to this argument. |
| **rollback** integer | | The `rollback` argument instructs the module to rollback the current configuration to the identifier specified in the argument. If the specified rollback identifier does not exist on the remote device, the module will fail. To rollback to the most recent commit, set the `rollback` argument to 0. This option is mutually exclusive with `config`. |
Notes
-----
Note
* The commands will be returned only for platforms that do not support onbox diff. The `--diff` option with the playbook will return the difference in configuration for devices that has support for onbox diff
* To ensure idempotency and correct diff the configuration lines in the relevant module options should be similar to how they appear if present in the running configuration on device including the indentation.
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: configure device with config
ansible.netcommon.cli_config:
config: "{{ lookup('template', 'basic/config.j2') }}"
- name: multiline config
ansible.netcommon.cli_config:
config: |
hostname foo
feature nxapi
- name: configure device with config with defaults enabled
ansible.netcommon.cli_config:
config: "{{ lookup('template', 'basic/config.j2') }}"
defaults: yes
- name: Use diff_match
ansible.netcommon.cli_config:
config: "{{ lookup('file', 'interface_config') }}"
diff_match: none
- name: nxos replace config
ansible.netcommon.cli_config:
replace: bootflash:nxoscfg
- name: junos replace config
ansible.netcommon.cli_config:
replace: /var/home/ansible/junos01.cfg
- name: commit with comment
ansible.netcommon.cli_config:
config: set system host-name foo
commit_comment: this is a test
- name: configurable backup path
ansible.netcommon.cli_config:
config: "{{ lookup('template', 'basic/config.j2') }}"
backup: yes
backup_options:
filename: backup.cfg
dir_path: /home/user
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **backup\_path** string | when backup is yes | The full path to the backup file **Sample:** /playbooks/ansible/backup/hostname\_config.2016-07-16@22:28:34 |
| **commands** list / elements=string | When *supports\_generated\_diff=True* and *supports\_onbox\_diff=False* in the platform's cliconf plugin | The set of commands that will be pushed to the remote device **Sample:** ['interface Loopback999', 'no shutdown'] |
| **diff** string | When *supports\_onbox\_diff=True* in the platform's cliconf plugin | The diff generated on the device when the commands were applied **Sample:** --- system:/running-config +++ session:/ansible\_1599745461-session-config @@ -4,7 +4,7 @@ ! transceiver qsfp default-mode 4x10G ! -hostname veos +hostname veos3 ! spanning-tree mode mstp |
### Authors
* Trishna Guha (@trishnaguha)
ansible ansible.netcommon.net_linkagg β (deprecated, removed after 2022-06-01) Manage link aggregation groups on network devices ansible.netcommon.net\_linkagg β (deprecated, removed after 2022-06-01) Manage link aggregation groups on network devices
=========================================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_linkagg`.
New in version 1.0.0: of ansible.netcommon
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Updated modules released with more functionality
Alternative
Use platform-specific β[netos]\_lag\_interfacesβ module
Synopsis
--------
* This module provides declarative management of link aggregation groups on network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of link aggregation definitions. |
| **members** string / required | | List of members interfaces of the link aggregation group. The value can be single interface or list of interfaces. |
| **min\_links** string | | Minimum members that should be up before bringing up the link aggregation group. |
| **mode** string | **Choices:*** True
* active
* passive
**Default:**"yes" | Mode of the link aggregation group. A value of `on` will enable LACP. `active` configures the link to actively information about the state of the link, or it can be configured in `passive` mode ie. send link state information only when received them from another link. |
| **name** string / required | | Name of the link aggregation group. |
| **purge** string | **Default:**"no" | Purge link aggregation groups not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** β
* absent
* up
* down
| State of the link aggregation group. |
Notes
-----
Note
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: configure link aggregation group
ansible.netcommon.net_linkagg:
name: bond0
members:
- eth0
- eth1
- name: remove configuration
ansible.netcommon.net_linkagg:
name: bond0
state: absent
- name: Create aggregate of linkagg definitions
ansible.netcommon.net_linkagg:
aggregate:
- {name: bond0, members: [eth1]}
- {name: bond1, members: [eth2]}
- name: Remove aggregate of linkagg definitions
ansible.netcommon.net_linkagg:
aggregate:
- name: bond0
- name: bond1
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['set interfaces bonding bond0', "set interfaces ethernet eth0 bond-group 'bond0'", "set interfaces ethernet eth1 bond-group 'bond0'"] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ricardo Carrillo Cruz (@rcarrillocruz)
| programming_docs |
ansible ansible.netcommon.restconf β HttpApi Plugin for devices supporting Restconf API ansible.netcommon.restconf β HttpApi Plugin for devices supporting Restconf API
===============================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.restconf`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Parameters](#parameters)
Synopsis
--------
* This HttpApi plugin provides methods to connect to Restconf API endpoints.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **root\_path** string | **Default:**"/restconf" | var: ansible\_httpapi\_restconf\_root | Specifies the location of the Restconf root. |
### Authors
* Ansible Networking Team
ansible ansible.netcommon.cli_command β Run a cli command on cli-based network devices ansible.netcommon.cli\_command β Run a cli command on cli-based network devices
===============================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.cli_command`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Sends a command to a network device and returns the result read from the device.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **answer** list / elements=string | | The answer to reply with if *prompt* is matched. The value can be a single answer or a list of answer for multiple prompts. In case the command execution results in multiple prompts the sequence of the prompt and excepted answer should be in same order. |
| **check\_all** boolean | **Choices:*** **no** β
* yes
| By default if any one of the prompts mentioned in `prompt` option is matched it won't check for other prompts. This boolean flag, that when set to *True* will check for all the prompts mentioned in `prompt` option in the given order. If the option is set to *True* all the prompts should be received from remote host if not it will result in timeout. |
| **command** string / required | | The command to send to the remote network device. The resulting output from the command is returned, unless *sendonly* is set. |
| **newline** boolean | **Choices:*** no
* **yes** β
| The boolean value, that when set to false will send *answer* to the device without a trailing newline. |
| **prompt** list / elements=string | | A single regex pattern or a sequence of patterns to evaluate the expected prompt from *command*. |
| **sendonly** boolean | **Choices:*** **no** β
* yes
| The boolean value, that when set to true will send *command* to the device but not wait for a result. |
Notes
-----
Note
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: run show version on remote devices
ansible.netcommon.cli_command:
command: show version
- name: run command with json formatted output
ansible.netcommon.cli_command:
command: show version | json
- name: run command expecting user confirmation
ansible.netcommon.cli_command:
command: commit replace
prompt: This commit will replace or remove the entire running configuration
answer: yes
- name: run command expecting user confirmation
ansible.netcommon.cli_command:
command: show interface summary
prompt: Press any key to continue
answer: y
newline: false
- name: run config mode command and handle prompt/answer
ansible.netcommon.cli_command:
command: '{{ item }}'
prompt:
- Exit with uncommitted changes
answer: y
loop:
- configure
- set system syslog file test any any
- exit
- name: multiple prompt, multiple answer (mandatory check for all prompts)
ansible.netcommon.cli_command:
command: copy sftp sftp://user@host//user/test.img
check_all: true
prompt:
- Confirm download operation
- Password
- Do you want to change that to the standby image
answer:
- y
- <password>
- y
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **json** dictionary | when the device response is valid JSON | A dictionary representing a JSON-formatted response **Sample:** { "architecture": "i386", "bootupTimestamp": 1532649700.56, "modelName": "vEOS", "version": "4.15.9M" [...] } |
| **stdout** string | when sendonly is false | The response from the command **Sample:** Version: VyOS 1.1.7[...] |
### Authors
* Nathaniel Case (@Qalthos)
ansible ansible.netcommon.net_ping β Tests reachability using ping from a network device ansible.netcommon.net\_ping β Tests reachability using ping from a network device
=================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_ping`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Tests reachability using ping from network device to a remote destination.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **count** string | **Default:**5 | Number of packets to send. |
| **dest** string / required | | The IP Address or hostname (resolvable by switch) of the remote node. |
| **source** string | | The source IP Address. |
| **state** string | **Choices:*** absent
* **present** β
| Determines if the expected result is success or fail. |
| **vrf** string | **Default:**"default" | The VRF to use for forwarding. |
Notes
-----
Note
* For targets running Python, use the [ansible.builtin.shell](../builtin/shell_module#ansible-collections-ansible-builtin-shell-module) module along with ping command instead.
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: Test reachability to 10.10.10.10 using default vrf
ansible.netcommon.net_ping:
dest: 10.10.10.10
- name: Test reachability to 10.20.20.20 using prod vrf
ansible.netcommon.net_ping:
dest: 10.20.20.20
vrf: prod
- name: Test unreachability to 10.30.30.30 using default vrf
ansible.netcommon.net_ping:
dest: 10.30.30.30
state: absent
- name: Test reachability to 10.40.40.40 using prod vrf and setting count and source
ansible.netcommon.net_ping:
dest: 10.40.40.40
source: loopback0
vrf: prod
count: 20
- Note:
- For targets running Python, use the M(ansible.builtin.shell) module along with ping command instead.
- Example:
name: ping
shell: ping -c 1 <remote-ip>
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | Show the command sent. **Sample:** ['ping vrf prod 10.40.40.40 count 20 source loopback0'] |
| **packet\_loss** string | always | Percentage of packets lost. **Sample:** 0% |
| **packets\_rx** integer | always | Packets successfully received. **Sample:** 20 |
| **packets\_tx** integer | always | Packets successfully transmitted. **Sample:** 20 |
| **rtt** dictionary | always | Show RTT stats. **Sample:** {'avg': 2, 'max': 8, 'min': 1} |
### Authors
* Jacob McGill (@jmcgill298)
ansible ansible.netcommon.netconf_rpc β Execute operations on NETCONF enabled network devices. ansible.netcommon.netconf\_rpc β Execute operations on NETCONF enabled network devices.
=======================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.netconf_rpc`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* NETCONF is a network management protocol developed and standardized by the IETF. It is documented in RFC 6241.
* This module allows the user to execute NETCONF RPC requests as defined by IETF RFC standards as well as proprietary requests.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ncclient (>=v0.5.2)
* jxmlease
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **content** string | | This argument specifies the optional request content (all RPC attributes). The *content* value can either be provided as XML formatted string or as dictionary. |
| **display** string | **Choices:*** json
* pretty
* xml
| Encoding scheme to use when serializing output from the device. The option *json* will serialize the output as JSON data. If the option value is *json* it requires jxmlease to be installed on control node. The option *pretty* is similar to received XML response but is using human readable format (spaces, new lines). The option value *xml* is similar to received XML response but removes all XML namespaces. |
| **rpc** string / required | | This argument specifies the request (name of the operation) to be executed on the remote NETCONF enabled device. |
| **xmlns** string | | NETCONF operations not defined in rfc6241 typically require the appropriate XML namespace to be set. In the case the *request* option is not already provided in XML format, the namespace can be defined by the *xmlns* option. |
Notes
-----
Note
* This module requires the NETCONF system service be enabled on the remote device being managed.
* This module supports the use of connection=netconf
* To execute `get-config`, `get` or `edit-config` requests it is recommended to use the Ansible *netconf\_get* and *netconf\_config* modules.
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: lock candidate
ansible.netcommon.netconf_rpc:
rpc: lock
content:
target:
candidate:
- name: unlock candidate
ansible.netcommon.netconf_rpc:
rpc: unlock
xmlns: urn:ietf:params:xml:ns:netconf:base:1.0
content: "{'target': {'candidate': None}}"
- name: discard changes
ansible.netcommon.netconf_rpc:
rpc: discard-changes
- name: get-schema
ansible.netcommon.netconf_rpc:
rpc: get-schema
xmlns: urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring
content:
identifier: ietf-netconf
version: '2011-06-01'
- name: copy running to startup
ansible.netcommon.netconf_rpc:
rpc: copy-config
content:
source:
running:
target:
startup:
- name: get schema list with JSON output
ansible.netcommon.netconf_rpc:
rpc: get
content: |
<filter>
<netconf-state xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">
<schemas/>
</netconf-state>
</filter>
display: json
- name: get schema using XML request
ansible.netcommon.netconf_rpc:
rpc: get-schema
xmlns: urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring
content: |
<identifier>ietf-netconf-monitoring</identifier>
<version>2010-10-04</version>
display: json
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **output** complex | when the display format is selected as JSON it is returned as dict type, if the display format is xml or pretty pretty it is returned as a string apart from low-level errors (such as action plugin). | Based on the value of display option will return either the set of transformed XML to JSON format from the RPC response with type dict or pretty XML string response (human-readable) or response with namespace removed from XML string. |
| | **formatted\_output** string | success | Contains formatted response received from remote host as per the value in display format. |
| **stdout** string | always apart from low-level errors (such as action plugin) | The raw XML string containing configuration or state data received from the underlying ncclient library. **Sample:** ... |
| **stdout\_lines** list / elements=string | always apart from low-level errors (such as action plugin) | The value of stdout split into a list **Sample:** ['...', '...'] |
### Authors
* Ganesh Nalawade (@ganeshrn)
* Sven Wisotzky (@wisotzky)
ansible ansible.netcommon.net_l2_interface β (deprecated, removed after 2022-06-01) Manage Layer-2 interface on network devices ansible.netcommon.net\_l2\_interface β (deprecated, removed after 2022-06-01) Manage Layer-2 interface on network devices
=========================================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_l2_interface`.
New in version 1.0.0: of ansible.netcommon
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Updated modules released with more functionality
Alternative
Use platform-specific β[netos]\_l2\_interfacesβ module
Synopsis
--------
* This module provides declarative management of Layer-2 interface on network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **access\_vlan** string | | Configure given VLAN in access port. |
| **aggregate** string | | List of Layer-2 interface definitions. |
| **mode** string | **Choices:*** **access** β
* trunk
| Mode in which interface needs to be configured. |
| **name** string | | Name of the interface excluding any logical unit number. |
| **native\_vlan** string | | Native VLAN to be configured in trunk port. |
| **state** string | **Choices:*** **present** β
* absent
| State of the Layer-2 Interface configuration. |
| **trunk\_allowed\_vlans** string | | List of allowed VLAN's in a given trunk port. |
| **trunk\_vlans** string | | List of VLANs to be configured in trunk port. |
Notes
-----
Note
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: configure Layer-2 interface
ansible.netcommon.net_l2_interface:
name: gigabitethernet0/0/1
mode: access
access_vlan: 30
- name: remove Layer-2 interface configuration
ansible.netcommon.net_l2_interface:
name: gigabitethernet0/0/1
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['interface gigabitethernet0/0/1', 'switchport mode access', 'switchport access vlan 30'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ganesh Nalawade (@ganeshrn)
ansible ansible.netcommon.net_system β (deprecated, removed after 2022-06-01) Manage the system attributes on network devices ansible.netcommon.net\_system β (deprecated, removed after 2022-06-01) Manage the system attributes on network devices
======================================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_system`.
New in version 1.0.0: of ansible.netcommon
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Updated modules released with more functionality
Alternative
Use platform-specific β[netos]\_systemβ module
Synopsis
--------
* This module provides declarative management of node system attributes on network devices. It provides an option to configure host system parameters or remove those parameters from the device active configuration.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **domain\_name** string | | Configure the IP domain name on the remote device to the provided value. Value should be in the dotted name form and will be appended to the `hostname` to create a fully-qualified domain name. |
| **domain\_search** string | | Provides the list of domain suffixes to append to the hostname for the purpose of doing name resolution. This argument accepts a name or list of names and will be reconciled with the current active configuration on the running node. |
| **hostname** string | | Configure the device hostname parameter. This option takes an ASCII string value. |
| **lookup\_source** string | | Provides one or more source interfaces to use for performing DNS lookups. The interface provided in `lookup_source` must be a valid interface configured on the device. |
| **name\_servers** string | | List of DNS name servers by IP address to use to perform name resolution lookups. This argument accepts either a list of DNS servers See examples. |
| **state** string | **Choices:*** **present** β
* absent
| State of the configuration values in the device's current active configuration. When set to *present*, the values should be configured in the device active configuration and when set to *absent* the values should not be in the device active configuration |
Notes
-----
Note
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: configure hostname and domain name
ansible.netcommon.net_system:
hostname: ios01
domain_name: test.example.com
domain_search:
- ansible.com
- redhat.com
- cisco.com
- name: domain search on single domain
ansible.netcommon.net_system:
domain_search: ansible.com
- name: remove configuration
ansible.netcommon.net_system:
state: absent
- name: configure DNS lookup sources
ansible.netcommon.net_system:
lookup_source: MgmtEth0/0/CPU0/0
- name: configure name servers
ansible.netcommon.net_system:
name_servers:
- 8.8.8.8
- 8.8.4.4
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['hostname ios01', 'ip domain name test.example.com'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ricardo Carrillo Cruz (@rcarrillocruz)
| programming_docs |
ansible ansible.netcommon.napalm β Provides persistent connection using NAPALM ansible.netcommon.napalm β Provides persistent connection using NAPALM
======================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.napalm`.
New in version 1.0.0: of ansible.netcommon
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
I am pretty sure no one has ever tried to use these modules
Alternative
None. If anyone actually wants to use this plugin, open an issue and weβll rescind the deprecation
Synopsis
--------
* This connection plugin provides connectivity to network devices using the NAPALM network device abstraction library. This library requires certain features to be enabled on network devices depending on the destination device operating system. The connection plugin requires `napalm` to be installed locally on the Ansible controller.
Requirements
------------
The below requirements are needed on the local controller node that executes this connection.
* napalm
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **host** string | **Default:**"inventory\_hostname" | var: ansible\_host | Specifies the remote device FQDN or IP address to establish the SSH connection to. |
| **host\_key\_auto\_add** boolean | **Choices:*** **no** β
* yes
| ini entries: [paramiko\_connection]host\_key\_auto\_add = no env:ANSIBLE\_HOST\_KEY\_AUTO\_ADD | By default, Ansible will prompt the user before adding SSH keys to the known hosts file. By enabling this option, unknown host keys will automatically be added to the known hosts file. Be sure to fully understand the security implications of enabling this option on production systems as it could create a security vulnerability. |
| **network\_os** string | | var: ansible\_network\_os | Configures the device platform network operating system. This value is used to load a napalm device abstraction. |
| **password** string | | var: ansible\_password var: ansible\_ssh\_pass var: ansible\_ssh\_password | Configures the user password used to authenticate to the remote device when first establishing the SSH connection. |
| **persistent\_command\_timeout** integer | **Default:**30 | ini entries: [persistent\_connection]command\_timeout = 30 env:ANSIBLE\_PERSISTENT\_COMMAND\_TIMEOUT var: ansible\_command\_timeout | Configures, in seconds, the amount of time to wait for a command to return from the remote device. If this timer is exceeded before the command returns, the connection plugin will raise an exception and close. |
| **persistent\_connect\_timeout** integer | **Default:**30 | ini entries: [persistent\_connection]connect\_timeout = 30 env:ANSIBLE\_PERSISTENT\_CONNECT\_TIMEOUT var: ansible\_connect\_timeout | Configures, in seconds, the amount of time to wait when trying to initially establish a persistent connection. If this value expires before the connection to the remote device is completed, the connection will fail. |
| **persistent\_log\_messages** boolean | **Choices:*** **no** β
* yes
| ini entries: [persistent\_connection]log\_messages = no env:ANSIBLE\_PERSISTENT\_LOG\_MESSAGES var: ansible\_persistent\_log\_messages | This flag will enable logging the command executed and response received from target device in the ansible log file. For this option to work 'log\_path' ansible configuration option is required to be set to a file path with write access. Be sure to fully understand the security implications of enabling this option as it could create a security vulnerability by logging sensitive information in log file. |
| **port** integer | **Default:**22 | ini entries: [defaults]remote\_port = 22 env:ANSIBLE\_REMOTE\_PORT var: ansible\_port | Specifies the port on the remote device that listens for connections when establishing the SSH connection. |
| **private\_key\_file** string | | ini entries: [defaults]private\_key\_file = None env:ANSIBLE\_PRIVATE\_KEY\_FILE var: ansible\_private\_key\_file | The private SSH key or certificate file used to authenticate to the remote device when first establishing the SSH connection. |
| **remote\_user** string | | ini entries: [defaults]remote\_user = None env:ANSIBLE\_REMOTE\_USER var: ansible\_user | The username used to authenticate to the remote device when the SSH connection is first established. If the remote\_user is not specified, the connection will use the username of the logged in user. Can be configured from the CLI via the `--user` or `-u` options. |
| **timeout** integer | **Default:**120 | | Sets the connection time, in seconds, for communicating with the remote device. This timeout is used as the default timeout value for commands when issuing a command to the network CLI. If the command does not return in timeout seconds, an error is generated. |
Status
------
* This connection will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ansible Networking Team
ansible ansible.netcommon.net_get β Copy a file from a network device to Ansible Controller ansible.netcommon.net\_get β Copy a file from a network device to Ansible Controller
====================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_get`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* This module provides functionality to copy file from network device to ansible controller.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Requirements
------------
The below requirements are needed on the host that executes this module.
* scp if using protocol=scp with paramiko
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **dest** string | **Default:**["Same filename as specified in I(src). The path will be playbook root or role root directory if playbook is part of a role."] | Specifies the destination file. The path to the destination file can either be the full path on the Ansible control host or a relative path from the playbook or role root directory. |
| **protocol** string | **Choices:*** **scp** β
* sftp
| Protocol used to transfer file. |
| **src** string / required | | Specifies the source file. The path to the source file can either be the full path on the network device or a relative path as per path supported by destination network device. |
Notes
-----
Note
* Some devices need specific configurations to be enabled before scp can work These configuration should be pre-configured before using this module e.g ios - `ip scp server enable`.
* User privilege to do scp on network device should be pre-configured e.g. ios - need user privilege 15 by default for allowing scp.
* Default destination of source file.
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: copy file from the network device to Ansible controller
ansible.netcommon.net_get:
src: running_cfg_ios1.txt
- name: copy file from ios to common location at /tmp
ansible.netcommon.net_get:
src: running_cfg_sw1.txt
dest: /tmp/ios1.txt
```
### Authors
* Deepak Agrawal (@dagrawal)
ansible ansible.netcommon.net_banner β (deprecated, removed after 2022-06-01) Manage multiline banners on network devices ansible.netcommon.net\_banner β (deprecated, removed after 2022-06-01) Manage multiline banners on network devices
==================================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_banner`.
New in version 1.0.0: of ansible.netcommon
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Updated modules released with more functionality
Alternative
Use platform-specific β[netos]\_bannerβ module
Synopsis
--------
* This will configure both login and motd banners on network devices. It allows playbooks to add or remove banner text from the active running configuration.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **banner** string / required | **Choices:*** login
* motd
| Specifies which banner that should be configured on the remote device. |
| **state** string | **Choices:*** **present** β
* absent
| Specifies whether or not the configuration is present in the current devices active running configuration. |
| **text** string | | The banner text that should be present in the remote device running configuration. This argument accepts a multiline string, with no empty lines. Requires *state=present*. |
Notes
-----
Note
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: configure the login banner
ansible.netcommon.net_banner:
banner: login
text: |
this is my login banner
that contains a multiline
string
state: present
- name: remove the motd banner
ansible.netcommon.net_banner:
banner: motd
state: absent
- name: Configure banner from file
ansible.netcommon.net_banner:
banner: motd
text: "{{ lookup('file', './config_partial/raw_banner.cfg') }}"
state: present
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['banner login', 'this is my login banner', 'that contains a multiline', 'string'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ricardo Carrillo Cruz (@rcarrillocruz)
ansible ansible.netcommon.net_vrf β (deprecated, removed after 2022-06-01) Manage VRFs on network devices ansible.netcommon.net\_vrf β (deprecated, removed after 2022-06-01) Manage VRFs on network devices
==================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_vrf`.
New in version 1.0.0: of ansible.netcommon
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Updated modules released with more functionality
Alternative
Use platform-specific β[netos]\_vrfβ module
Synopsis
--------
* This module provides declarative management of VRFs on network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of VRFs definitions |
| **interfaces** string | | List of interfaces the VRF should be configured on. |
| **name** string | | Name of the VRF. |
| **purge** string | **Default:**"no" | Purge VRFs not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** β
* absent
| State of the VRF configuration. |
Notes
-----
Note
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: Create VRF named MANAGEMENT
ansible.netcommon.net_vrf:
name: MANAGEMENT
- name: remove VRF named MANAGEMENT
ansible.netcommon.net_vrf:
name: MANAGEMENT
state: absent
- name: Create aggregate of VRFs with purge
ansible.netcommon.net_vrf:
aggregate:
- name: test4
rd: 1:204
- name: test5
rd: 1:205
state: present
purge: yes
- name: Delete aggregate of VRFs
ansible.netcommon.net_vrf:
aggregate:
- name: test2
- name: test3
- name: test4
- name: test5
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['vrf definition MANAGEMENT'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ricardo Carrillo Cruz (@rcarrillocruz)
ansible ansible.netcommon.net_static_route β (deprecated, removed after 2022-06-01) Manage static IP routes on network appliances (routers, switches et. al.) ansible.netcommon.net\_static\_route β (deprecated, removed after 2022-06-01) Manage static IP routes on network appliances (routers, switches et. al.)
=======================================================================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_static_route`.
New in version 1.0.0: of ansible.netcommon
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Updated modules released with more functionality
Alternative
Use platform-specific β[netos]\_static\_routeβ module
Synopsis
--------
* This module provides declarative management of static IP routes on network appliances (routers, switches et. al.).
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **admin\_distance** string | | Admin distance of the static route. |
| **aggregate** string | | List of static route definitions |
| **mask** string / required | | Network prefix mask of the static route. |
| **next\_hop** string / required | | Next hop IP of the static route. |
| **prefix** string / required | | Network prefix of the static route. |
| **purge** string | **Default:**"no" | Purge static routes not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** β
* absent
| State of the static route configuration. |
Notes
-----
Note
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: configure static route
ansible.netcommon.net_static_route:
prefix: 192.168.2.0
mask: 255.255.255.0
next_hop: 10.0.0.1
- name: remove configuration
ansible.netcommon.net_static_route:
prefix: 192.168.2.0
mask: 255.255.255.0
next_hop: 10.0.0.1
state: absent
- name: configure aggregates of static routes
ansible.netcommon.net_static_route:
aggregate:
- {prefix: 192.168.2.0, mask: 255.255.255.0, next_hop: 10.0.0.1}
- {prefix: 192.168.3.0, mask: 255.255.255.0, next_hop: 10.0.2.1}
- name: Remove static route collections
ansible.netcommon.net_static_route:
aggregate:
- {prefix: 172.24.1.0/24, next_hop: 192.168.42.64}
- {prefix: 172.24.3.0/24, next_hop: 192.168.42.64}
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['ip route 192.168.2.0/24 10.0.0.1'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ricardo Carrillo Cruz (@rcarrillocruz)
ansible ansible.netcommon.netconf_get β Fetch configuration/state data from NETCONF enabled network devices. ansible.netcommon.netconf\_get β Fetch configuration/state data from NETCONF enabled network devices.
=====================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.netconf_get`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* NETCONF is a network management protocol developed and standardized by the IETF. It is documented in RFC 6241.
* This module allows the user to fetch configuration and state data from NETCONF enabled network devices.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ncclient (>=v0.5.2)
* jxmlease (for display=json)
* xmltodict (for display=native)
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **display** string | **Choices:*** json
* pretty
* xml
* native
| Encoding scheme to use when serializing output from the device. The option *json* will serialize the output as JSON data. If the option value is *json* it requires jxmlease to be installed on control node. The option *pretty* is similar to received XML response but is using human readable format (spaces, new lines). The option value *xml* is similar to received XML response but removes all XML namespaces. |
| **filter** raw | | This argument specifies the string which acts as a filter to restrict the portions of the data to be are retrieved from the remote device. If this option is not specified entire configuration or state data is returned in result depending on the value of `source` option. The `filter` value can be either XML string or XPath or JSON string or native python dictionary, if the filter is in XPath format the NETCONF server running on remote host should support xpath capability else it will result in an error. If the filter is in JSON format the xmltodict library should be installed on the control node for JSON to XML conversion. |
| **lock** string | **Choices:*** **never** β
* always
* if-supported
| Instructs the module to explicitly lock the datastore specified as `source`. If no *source* is defined, the *running* datastore will be locked. By setting the option value *always* is will explicitly lock the datastore mentioned in `source` option. By setting the option value *never* it will not lock the `source` datastore. The value *if-supported* allows better interworking with NETCONF servers, which do not support the (un)lock operation for all supported datastores. |
| **source** string | **Choices:*** running
* candidate
* startup
| This argument specifies the datastore from which configuration data should be fetched. Valid values are *running*, *candidate* and *startup*. If the `source` value is not set both configuration and state information are returned in response from running datastore. |
Notes
-----
Note
* This module requires the NETCONF system service be enabled on the remote device being managed.
* This module supports the use of connection=netconf
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: Get running configuration and state data
ansible.netcommon.netconf_get:
- name: Get configuration and state data from startup datastore
ansible.netcommon.netconf_get:
source: startup
- name: Get system configuration data from running datastore state (junos)
ansible.netcommon.netconf_get:
source: running
filter: <configuration><system></system></configuration>
- name: Get configuration and state data in JSON format
ansible.netcommon.netconf_get:
display: json
- name: get schema list using subtree w/ namespaces
ansible.netcommon.netconf_get:
display: json
filter: <netconf-state xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><schemas><schema/></schemas></netconf-state>
lock: never
- name: get schema list using xpath
ansible.netcommon.netconf_get:
display: xml
filter: /netconf-state/schemas/schema
- name: get interface configuration with filter (iosxr)
ansible.netcommon.netconf_get:
display: pretty
filter: <interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"></interface-configurations>
lock: if-supported
- name: Get system configuration data from running datastore state (junos)
ansible.netcommon.netconf_get:
source: running
filter: <configuration><system></system></configuration>
lock: if-supported
- name: Get complete configuration data from running datastore (SROS)
ansible.netcommon.netconf_get:
source: running
filter: <configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf"/>
- name: Get complete state data (SROS)
ansible.netcommon.netconf_get:
filter: <state xmlns="urn:nokia.com:sros:ns:yang:sr:state"/>
- name: "get configuration with json filter string and native output (using xmltodict)"
netconf_get:
filter: |
{
"interface-configurations": {
"@xmlns": "http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg",
"interface-configuration": null
}
}
display: native
- name: Define the Cisco IOSXR interface filter
set_fact:
filter:
interface-configurations:
"@xmlns": "http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"
interface-configuration: null
- name: "get configuration with native filter type using set_facts"
ansible.netcommon.netconf_get:
filter: "{{ filter }}"
display: native
register: result
- name: "get configuration with direct native filter type"
ansible.netcommon.netconf_get:
filter: {
"interface-configurations": {
"@xmlns": "http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg",
"interface-configuration": null
}
}
display: native
register: result
# Make a round-trip interface description change, diff the before and after
# this demonstrates the use of the native display format and several utilities
# from the ansible.utils collection
- name: Define the openconfig interface filter
set_fact:
filter:
interfaces:
"@xmlns": "http://openconfig.net/yang/interfaces"
interface:
name: Ethernet2
- name: Get the pre-change config using the filter
ansible.netcommon.netconf_get:
source: running
filter: "{{ filter }}"
display: native
register: pre
- name: Update the description
ansible.utils.update_fact:
updates:
- path: pre.output.data.interfaces.interface.config.description
value: "Configured by ansible {{ 100 | random }}"
register: updated
- name: Apply the new configuration
ansible.netcommon.netconf_config:
content:
config:
interfaces: "{{ updated.pre.output.data.interfaces }}"
- name: Get the post-change config using the filter
ansible.netcommon.netconf_get:
source: running
filter: "{{ filter }}"
display: native
register: post
- name: Show the differences between the pre and post configurations
ansible.utils.fact_diff:
before: "{{ pre.output.data|ansible.utils.to_paths }}"
after: "{{ post.output.data|ansible.utils.to_paths }}"
# TASK [Show the differences between the pre and post configurations] ********
# --- before
# +++ after
# @@ -1,11 +1,11 @@
# {
# - "@time-modified": "2020-10-23T12:27:17.462332477Z",
# + "@time-modified": "2020-10-23T12:27:21.744541708Z",
# "@xmlns": "urn:ietf:params:xml:ns:netconf:base:1.0",
# "interfaces.interface.aggregation.config['fallback-timeout']['#text']": "90",
# "interfaces.interface.aggregation.config['fallback-timeout']['@xmlns']": "http://arista.com/yang/openconfig/interfaces/augments",
# "interfaces.interface.aggregation.config['min-links']": "0",
# "interfaces.interface.aggregation['@xmlns']": "http://openconfig.net/yang/interfaces/aggregate",
# - "interfaces.interface.config.description": "Configured by ansible 56",
# + "interfaces.interface.config.description": "Configured by ansible 67",
# "interfaces.interface.config.enabled": "true",
# "interfaces.interface.config.mtu": "0",
# "interfaces.interface.config.name": "Ethernet2",
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **output** complex | If the display format is selected as *json* it is returned as dict type and the conversion is done using jxmlease python library. If the display format is selected as *native* it is returned as dict type and the conversion is done using xmltodict python library. If the display format is xml or pretty it is returned as a string apart from low-level errors (such as action plugin). | Based on the value of display option will return either the set of transformed XML to JSON format from the RPC response with type dict or pretty XML string response (human-readable) or response with namespace removed from XML string. |
| | **formatted\_output** string | success | Contains formatted response received from remote host as per the value in display format. |
| **stdout** string | always apart from low-level errors (such as action plugin) | The raw XML string containing configuration or state data received from the underlying ncclient library. **Sample:** ... |
| **stdout\_lines** list / elements=string | always apart from low-level errors (such as action plugin) | The value of stdout split into a list **Sample:** ['...', '...'] |
### Authors
* Ganesh Nalawade (@ganeshrn)
* Sven Wisotzky (@wisotzky)
| programming_docs |
ansible ansible.netcommon.network_resource β Manage resource modules ansible.netcommon.network\_resource β Manage resource modules
=============================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.network_resource`.
New in version 2.4.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Get list of available resource modules for given os name
* Retrieve given resource module configuration facts
* Push given resource module configuration
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **config** raw | | The resource module configuration. For details on the type and structure of this option refer the individual resource module platform documentation. |
| **name** string | | The name of the resource module to manage. The resource module should be supported for given *os\_name*, if not supported it will result in error. |
| **os\_name** string | | The name of the os to manage the resource modules. The name should be fully qualified collection name format, that is *<namespace>.<collection-name>.<plugin-name>*. If value of this option is not set the os value will be read from *ansible\_network\_os* variable. If value of both *os\_name* and *ansible\_network\_os* is not set it will result in error. |
| **running\_config** string | | This option is used only with state *parsed*. The value of this option should be the output received from the host device by executing the cli command to get the resource configuration on host. The state *parsed* reads the configuration from `running_config` option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the *parsed* key within the result. |
| **state** string | | The state the configuration should be left in. For supported values refer the individual resource module platform documentation. |
Notes
-----
Note
* Refer the individual module documentation for the valid inputs of *state* and *config* modules.
Examples
--------
```
- name: get list of resource modules for given network_os
ansible.netcommon.network_resource:
register: result
- name: fetch acl config for
ansible.netcommon.network_resource:
os_name: cisco.ios.ios
name: acls
state: gathered
- name: manage acl config for cisco.ios.ios network os.
ansible.netcommon.network_resource:
name: acls
config:
- afi: ipv4
acls:
- name: test_acl
acl_type: extended
aces:
- grant: deny
protocol_options:
tcp:
fin: true
source:
address: 192.0.2.0
wildcard_bits: 0.0.0.255
destination:
address: 192.0.3.0
wildcard_bits: 0.0.0.255
port_protocol:
eq: www
option:
traceroute: true
ttl:
eq: 10
state: merged
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **after** list / elements=string | when changed and when *state* and/or *config* option is set | The configuration as structured data after module completion. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **before** list / elements=string | When *state* and/or *config* option is set | The configuration as structured data prior to module invocation. **Sample:** The configuration returned will always be in the same format of the parameters above. |
| **commands** list / elements=string | When *state* and/or *config* option is set | The set of commands pushed to the remote device **Sample:** ['ip access-list extended 110'] |
| **modules** list / elements=string | When only *os\_name* or *ansible\_network\_os* is set | List of resource modules supported for given OS. **Sample:** ['acl\_interfaces', 'acls', 'bgp\_global'] |
### Authors
* Ganesh B. Nalawade (@ganeshrn)
ansible ansible.netcommon.network_cli β Use network_cli to run command on network appliances ansible.netcommon.network\_cli β Use network\_cli to run command on network appliances
======================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.network_cli`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
Synopsis
--------
* This connection plugin provides a connection to remote devices over the SSH and implements a CLI shell. This connection plugin is typically used by network devices for sending and receiving CLi commands to network devices.
Requirements
------------
The below requirements are needed on the local controller node that executes this connection.
* ansible-pylibssh if using *ssh\_type=libssh*
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **become** boolean | **Choices:*** **no** β
* yes
| ini entries: [privilege\_escalation]become = no env:ANSIBLE\_BECOME var: ansible\_become | The become option will instruct the CLI session to attempt privilege escalation on platforms that support it. Normally this means transitioning from user mode to `enable` mode in the CLI session. If become is set to True and the remote device does not support privilege escalation or the privilege has already been elevated, then this option is silently ignored. Can be configured from the CLI via the `--become` or `-b` options. |
| **become\_method** string | **Default:**"sudo" | ini entries: [privilege\_escalation]become\_method = sudo env:ANSIBLE\_BECOME\_METHOD var: ansible\_become\_method | This option allows the become method to be specified in for handling privilege escalation. Typically the become\_method value is set to `enable` but could be defined as other values. |
| **host** string | **Default:**"inventory\_hostname" | var: ansible\_host | Specifies the remote device FQDN or IP address to establish the SSH connection to. |
| **host\_key\_auto\_add** boolean | **Choices:*** **no** β
* yes
| ini entries: [paramiko\_connection]host\_key\_auto\_add = no env:ANSIBLE\_HOST\_KEY\_AUTO\_ADD | By default, Ansible will prompt the user before adding SSH keys to the known hosts file. Since persistent connections such as network\_cli run in background processes, the user will never be prompted. By enabling this option, unknown host keys will automatically be added to the known hosts file. Be sure to fully understand the security implications of enabling this option on production systems as it could create a security vulnerability. |
| **host\_key\_checking** boolean | **Choices:*** no
* **yes** β
| ini entries: [defaults]host\_key\_checking = yes [persistent\_connection]host\_key\_checking = yes env:ANSIBLE\_HOST\_KEY\_CHECKING env:ANSIBLE\_SSH\_HOST\_KEY\_CHECKING var: ansible\_host\_key\_checking var: ansible\_ssh\_host\_key\_checking | Set this to "False" if you want to avoid host key checking by the underlying tools Ansible uses to connect to the host |
| **import\_modules** boolean | **Choices:*** **no** β
* yes
| ini entries: [ansible\_network]import\_modules = no env:ANSIBLE\_NETWORK\_IMPORT\_MODULES var: ansible\_network\_import\_modules | Reduce CPU usage and network module execution time by enabling direct execution. Instead of the module being packaged and executed by the shell, it will be directly executed by the Ansible control node using the same python interpreter as the Ansible process. Note- Incompatible with `asynchronous mode`. Note- Python 3 and Ansible 2.9.16 or greater required. Note- With Ansible 2.9.x fully qualified modules names are required in tasks. |
| **network\_cli\_retries** integer | **Default:**3 | ini entries: [persistent\_connection]network\_cli\_retries = 3 env:ANSIBLE\_NETWORK\_CLI\_RETRIES var: ansible\_network\_cli\_retries | Number of attempts to connect to remote host. The delay time between the retires increases after every attempt by power of 2 in seconds till either the maximum attempts are exhausted or any of the `persistent_command_timeout` or `persistent_connect_timeout` timers are triggered. |
| **network\_os** string | | var: ansible\_network\_os | Configures the device platform network operating system. This value is used to load the correct terminal and cliconf plugins to communicate with the remote device. |
| **password** string | | var: ansible\_password var: ansible\_ssh\_pass var: ansible\_ssh\_password | Configures the user password used to authenticate to the remote device when first establishing the SSH connection. |
| **persistent\_buffer\_read\_timeout** float | **Default:**0.1 | ini entries: [persistent\_connection]buffer\_read\_timeout = 0.1 env:ANSIBLE\_PERSISTENT\_BUFFER\_READ\_TIMEOUT var: ansible\_buffer\_read\_timeout | Configures, in seconds, the amount of time to wait for the data to be read from Paramiko channel after the command prompt is matched. This timeout value ensures that command prompt matched is correct and there is no more data left to be received from remote host. |
| **persistent\_command\_timeout** integer | **Default:**30 | ini entries: [persistent\_connection]command\_timeout = 30 env:ANSIBLE\_PERSISTENT\_COMMAND\_TIMEOUT var: ansible\_command\_timeout | Configures, in seconds, the amount of time to wait for a command to return from the remote device. If this timer is exceeded before the command returns, the connection plugin will raise an exception and close. |
| **persistent\_connect\_timeout** integer | **Default:**30 | ini entries: [persistent\_connection]connect\_timeout = 30 env:ANSIBLE\_PERSISTENT\_CONNECT\_TIMEOUT var: ansible\_connect\_timeout | Configures, in seconds, the amount of time to wait when trying to initially establish a persistent connection. If this value expires before the connection to the remote device is completed, the connection will fail. |
| **persistent\_log\_messages** boolean | **Choices:*** **no** β
* yes
| ini entries: [persistent\_connection]log\_messages = no env:ANSIBLE\_PERSISTENT\_LOG\_MESSAGES var: ansible\_persistent\_log\_messages | This flag will enable logging the command executed and response received from target device in the ansible log file. For this option to work 'log\_path' ansible configuration option is required to be set to a file path with write access. Be sure to fully understand the security implications of enabling this option as it could create a security vulnerability by logging sensitive information in log file. |
| **port** integer | **Default:**22 | ini entries: [defaults]remote\_port = 22 env:ANSIBLE\_REMOTE\_PORT var: ansible\_port | Specifies the port on the remote device that listens for connections when establishing the SSH connection. |
| **private\_key\_file** string | | ini entries: [defaults]private\_key\_file = None env:ANSIBLE\_PRIVATE\_KEY\_FILE var: ansible\_private\_key\_file | The private SSH key or certificate file used to authenticate to the remote device when first establishing the SSH connection. |
| **remote\_user** string | | ini entries: [defaults]remote\_user = None env:ANSIBLE\_REMOTE\_USER var: ansible\_user | The username used to authenticate to the remote device when the SSH connection is first established. If the remote\_user is not specified, the connection will use the username of the logged in user. Can be configured from the CLI via the `--user` or `-u` options. |
| **single\_user\_mode** boolean added in 2.0.0 of ansible.netcommon | **Choices:*** **no** β
* yes
| env:ANSIBLE\_NETWORK\_SINGLE\_USER\_MODE var: ansible\_network\_single\_user\_mode | This option enables caching of data fetched from the target for re-use. The cache is invalidated when the target device enters configuration mode. Applicable only for platforms where this has been implemented. |
| **ssh\_type** string | **Default:**"paramiko" | ini entries: [persistent\_connection]ssh\_type = paramiko env:ANSIBLE\_NETWORK\_CLI\_SSH\_TYPE var: ansible\_network\_cli\_ssh\_type | The type of the transport used by `network_cli` connection plugin to connection to remote host. Valid value is either *paramiko* or *libssh*
In order to use *libssh*, the ansible-pylibssh package needs to be installed |
| **terminal\_inital\_prompt\_newline** boolean | **Choices:*** no
* **yes** β
| var: ansible\_terminal\_initial\_prompt\_newline | This boolean flag, that when set to *True* will send newline in the response if any of values in *terminal\_initial\_prompt* is matched. |
| **terminal\_initial\_answer** list / elements=string | | var: ansible\_terminal\_initial\_answer | The answer to reply with if the `terminal_initial_prompt` is matched. The value can be a single answer or a list of answers for multiple terminal\_initial\_prompt. In case the login menu has multiple prompts the sequence of the prompt and excepted answer should be in same order and the value of *terminal\_prompt\_checkall* should be set to *True* if all the values in `terminal_initial_prompt` are expected to be matched and set to *False* if any one login prompt is to be matched. |
| **terminal\_initial\_prompt** list / elements=string | | var: ansible\_terminal\_initial\_prompt | A single regex pattern or a sequence of patterns to evaluate the expected prompt at the time of initial login to the remote host. |
| **terminal\_initial\_prompt\_checkall** boolean | **Choices:*** **no** β
* yes
| var: ansible\_terminal\_initial\_prompt\_checkall | By default the value is set to *False* and any one of the prompts mentioned in `terminal_initial_prompt` option is matched it won't check for other prompts. When set to *True* it will check for all the prompts mentioned in `terminal_initial_prompt` option in the given order and all the prompts should be received from remote host if not it will result in timeout. |
| **terminal\_stderr\_re** list / elements=dictionary | | var: ansible\_terminal\_stderr\_re | This option provides the regex pattern and optional flags to match the error string from the received response chunk. This option accepts `pattern` and `flags` keys. The value of `pattern` is a python regex pattern to match the response and the value of `flags` is the value accepted by *flags* argument of *re.compile* python method to control the way regex is matched with the response, for example *'re.I'*. |
| **terminal\_stdout\_re** list / elements=dictionary | | var: ansible\_terminal\_stdout\_re | A single regex pattern or a sequence of patterns along with optional flags to match the command prompt from the received response chunk. This option accepts `pattern` and `flags` keys. The value of `pattern` is a python regex pattern to match the response and the value of `flags` is the value accepted by *flags* argument of *re.compile* python method to control the way regex is matched with the response, for example *'re.I'*. |
### Authors
* Ansible Networking Team
ansible ansible.netcommon.net_lldp β (deprecated, removed after 2022-06-01) Manage LLDP service configuration on network devices ansible.netcommon.net\_lldp β (deprecated, removed after 2022-06-01) Manage LLDP service configuration on network devices
=========================================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_lldp`.
New in version 1.0.0: of ansible.netcommon
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Updated modules released with more functionality
Alternative
Use platform-specific β[netos]\_lldp\_globalβ module
Synopsis
--------
* This module provides declarative management of LLDP service configuration on network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **state** string | **Choices:*** **present** β
* absent
| State of the LLDP service configuration. |
Notes
-----
Note
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: Enable LLDP service
ansible.netcommon.net_lldp:
state: present
- name: Disable LLDP service
ansible.netcommon.net_lldp:
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['set service lldp'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ricardo Carrillo Cruz (@rcarrillocruz)
ansible ansible.netcommon.memory β RAM backed, non persistent cache. ansible.netcommon.memory β RAM backed, non persistent cache.
============================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.memory`.
New in version 2.0.0: of ansible.netcommon
Synopsis
--------
* RAM backed cache that is not persistent.
* Tailored for networking use case.
### Authors
* Ansible Networking Team
| programming_docs |
ansible ansible.netcommon.net_user β (deprecated, removed after 2022-06-01) Manage the aggregate of local users on network device ansible.netcommon.net\_user β (deprecated, removed after 2022-06-01) Manage the aggregate of local users on network device
==========================================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_user`.
New in version 1.0.0: of ansible.netcommon
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Updated modules released with more functionality
Alternative
Use platform-specific β[netos]\_userβ module
Synopsis
--------
* This module provides declarative management of the local usernames configured on network devices. It allows playbooks to manage either individual usernames or the aggregate of usernames in the current running config. It also supports purging usernames from the configuration that are not explicitly defined.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | The set of username objects to be configured on the remote network device. The list entries can either be the username or a hash of username and properties. This argument is mutually exclusive with the `name` argument. |
| **configured\_password** string | | The password to be configured on the remote network device. The password needs to be provided in clear and it will be encrypted on the device. Please note that this option is not same as `provider password`. |
| **name** string | | The username to be configured on the remote network device. This argument accepts a string value and is mutually exclusive with the `aggregate` argument. Please note that this option is not same as `provider username`. |
| **nopassword** boolean | **Choices:*** no
* yes
| Defines the username without assigning a password. This will allow the user to login to the system without being authenticated by a password. |
| **privilege** string | | The `privilege` argument configures the privilege level of the user when logged into the system. This argument accepts integer values in the range of 1 to 15. |
| **purge** boolean | **Choices:*** **no** β
* yes
| Instructs the module to consider the resource definition absolute. It will remove any previously configured usernames on the device with the exception of the `admin` user (the current defined set of users). |
| **role** string | | Configures the role for the username in the device running configuration. The argument accepts a string value defining the role name. This argument does not check if the role has been configured on the device. |
| **sshkey** string | | Specifies the SSH public key to configure for the given username. This argument accepts a valid SSH key value. |
| **state** string | **Choices:*** **present** β
* absent
| Configures the state of the username definition as it relates to the device operational configuration. When set to *present*, the username(s) should be configured in the device active configuration and when set to *absent* the username(s) should not be in the device active configuration |
| **update\_password** string | **Choices:*** on\_create
* **always** β
| Since passwords are encrypted in the device running config, this argument will instruct the module when to change the password. When set to `always`, the password will always be updated in the device and when set to `on_create` the password will be updated only if the username is created. |
Notes
-----
Note
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: create a new user
ansible.netcommon.net_user:
name: ansible
sshkey: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
state: present
- name: remove all users except admin
ansible.netcommon.net_user:
purge: yes
- name: set multiple users to privilege level 15
ansible.netcommon.net_user:
aggregate:
- {name: netop}
- {name: netend}
privilege: 15
state: present
- name: Change Password for User netop
ansible.netcommon.net_user:
name: netop
configured_password: '{{ new_password }}'
update_password: always
state: present
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always | The list of configuration mode commands to send to the device **Sample:** ['username ansible secret password', 'username admin secret admin'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Trishna Guha (@trishnaguha)
ansible ansible.netcommon.restconf_get β Fetch configuration/state data from RESTCONF enabled devices. ansible.netcommon.restconf\_get β Fetch configuration/state data from RESTCONF enabled devices.
===============================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.restconf_get`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* RESTCONF is a standard mechanisms to allow web applications to access the configuration data and state data developed and standardized by the IETF. It is documented in RFC 8040.
* This module allows the user to fetch configuration and state data from RESTCONF enabled devices.
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **content** string | **Choices:*** config
* nonconfig
* all
| The `content` is a query parameter that controls how descendant nodes of the requested data nodes in `path` will be processed in the reply. If value is *config* return only configuration descendant data nodes of value in `path`. If value is *nonconfig* return only non-configuration descendant data nodes of value in `path`. If value is *all* return all descendant data nodes of value in `path`
|
| **output** string | **Choices:*** **json** β
* xml
| The output of response received. |
| **path** string / required | | URI being used to execute API calls. |
Notes
-----
Note
* This module requires the RESTCONF system service be enabled on the remote device being managed.
* This module is supported with *ansible\_connection* value of *ansible.netcommon.httpapi* and *ansible\_network\_os* value of *ansible.netcommon.restconf*.
* This module is tested against Cisco IOSXE 16.12.02 version.
Examples
--------
```
- name: get l3vpn services
ansible.netcommon.restconf_get:
path: /config/ietf-l3vpn-svc:l3vpn-svc/vpn-services
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **response** dictionary | when the device response is valid JSON | A dictionary representing a JSON-formatted response **Sample:** { "vpn-services": { "vpn-service": [ { "customer-name": "red", "vpn-id": "blue\_vpn1", "vpn-service-topology": "ietf-l3vpn-svc:any-to-any" } ] } } |
### Authors
* Ganesh Nalawade (@ganeshrn)
ansible ansible.netcommon.netconf β Provides a persistent connection using the netconf protocol ansible.netcommon.netconf β Provides a persistent connection using the netconf protocol
=======================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.netconf`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
Synopsis
--------
* This connection plugin provides a connection to remote devices over the SSH NETCONF subsystem. This connection plugin is typically used by network devices for sending and receiving RPC calls over NETCONF.
* Note this connection plugin requires ncclient to be installed on the local Ansible controller.
Requirements
------------
The below requirements are needed on the local controller node that executes this connection.
* ncclient
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **host** string | **Default:**"inventory\_hostname" | var: ansible\_host | Specifies the remote device FQDN or IP address to establish the SSH connection to. |
| **host\_key\_checking** boolean | **Choices:*** no
* **yes** β
| ini entries: [defaults]host\_key\_checking = yes [paramiko\_connection]host\_key\_checking = yes env:ANSIBLE\_HOST\_KEY\_CHECKING env:ANSIBLE\_SSH\_HOST\_KEY\_CHECKING env:ANSIBLE\_NETCONF\_HOST\_KEY\_CHECKING var: ansible\_host\_key\_checking var: ansible\_ssh\_host\_key\_checking var: ansible\_netconf\_host\_key\_checking | Set this to "False" if you want to avoid host key checking by the underlying tools Ansible uses to connect to the host |
| **import\_modules** boolean | **Choices:*** **no** β
* yes
| ini entries: [ansible\_network]import\_modules = no env:ANSIBLE\_NETWORK\_IMPORT\_MODULES var: ansible\_network\_import\_modules | Reduce CPU usage and network module execution time by enabling direct execution. Instead of the module being packaged and executed by the shell, it will be directly executed by the Ansible control node using the same python interpreter as the Ansible process. Note- Incompatible with `asynchronous mode`. Note- Python 3 and Ansible 2.9.16 or greater required. Note- With Ansible 2.9.x fully qualified modules names are required in tasks. |
| **look\_for\_keys** boolean | **Choices:*** no
* **yes** β
| ini entries: [paramiko\_connection]look\_for\_keys = yes env:ANSIBLE\_PARAMIKO\_LOOK\_FOR\_KEYS | Enables looking for ssh keys in the usual locations for ssh keys (e.g. :file:`~/.ssh/id\_\*`). |
| **netconf\_ssh\_config** string | | ini entries: [netconf\_connection]ssh\_config = None env:ANSIBLE\_NETCONF\_SSH\_CONFIG var: ansible\_netconf\_ssh\_config | This variable is used to enable bastion/jump host with netconf connection. If set to True the bastion/jump host ssh settings should be present in ~/.ssh/config file, alternatively it can be set to custom ssh configuration file path to read the bastion/jump host settings. |
| **network\_os** string | | var: ansible\_network\_os | Configures the device platform network operating system. This value is used to load a device specific netconf plugin. If this option is not configured (or set to `auto`), then Ansible will attempt to guess the correct network\_os to use. If it can not guess a network\_os correctly it will use `default`. |
| **password** string | | var: ansible\_password var: ansible\_ssh\_pass var: ansible\_ssh\_password var: ansible\_netconf\_password | Configures the user password used to authenticate to the remote device when first establishing the SSH connection. |
| **persistent\_command\_timeout** integer | **Default:**30 | ini entries: [persistent\_connection]command\_timeout = 30 env:ANSIBLE\_PERSISTENT\_COMMAND\_TIMEOUT var: ansible\_command\_timeout | Configures, in seconds, the amount of time to wait for a command to return from the remote device. If this timer is exceeded before the command returns, the connection plugin will raise an exception and close. |
| **persistent\_connect\_timeout** integer | **Default:**30 | ini entries: [persistent\_connection]connect\_timeout = 30 env:ANSIBLE\_PERSISTENT\_CONNECT\_TIMEOUT var: ansible\_connect\_timeout | Configures, in seconds, the amount of time to wait when trying to initially establish a persistent connection. If this value expires before the connection to the remote device is completed, the connection will fail. |
| **persistent\_log\_messages** boolean | **Choices:*** **no** β
* yes
| ini entries: [persistent\_connection]log\_messages = no env:ANSIBLE\_PERSISTENT\_LOG\_MESSAGES var: ansible\_persistent\_log\_messages | This flag will enable logging the command executed and response received from target device in the ansible log file. For this option to work 'log\_path' ansible configuration option is required to be set to a file path with write access. Be sure to fully understand the security implications of enabling this option as it could create a security vulnerability by logging sensitive information in log file. |
| **port** integer | **Default:**830 | ini entries: [defaults]remote\_port = 830 env:ANSIBLE\_REMOTE\_PORT var: ansible\_port | Specifies the port on the remote device that listens for connections when establishing the SSH connection. |
| **private\_key\_file** string | | ini entries: [defaults]private\_key\_file = None env:ANSIBLE\_PRIVATE\_KEY\_FILE var: ansible\_private\_key\_file | The private SSH key or certificate file used to authenticate to the remote device when first establishing the SSH connection. |
| **proxy\_command** string | **Default:**"" | ini entries: [paramiko\_connection]proxy\_command = env:ANSIBLE\_NETCONF\_PROXY\_COMMAND var: ansible\_paramiko\_proxy\_command var: ansible\_netconf\_proxy\_command | Proxy information for running the connection via a jumphost. This requires ncclient >= 0.6.10 to be installed on the controller. |
| **remote\_user** string | | ini entries: [defaults]remote\_user = None env:ANSIBLE\_REMOTE\_USER var: ansible\_user | The username used to authenticate to the remote device when the SSH connection is first established. If the remote\_user is not specified, the connection will use the username of the logged in user. Can be configured from the CLI via the `--user` or `-u` options. |
### Authors
* Ansible Networking Team
ansible ansible.netcommon.net_lldp_interface β (deprecated, removed after 2022-06-01) Manage LLDP interfaces configuration on network devices ansible.netcommon.net\_lldp\_interface β (deprecated, removed after 2022-06-01) Manage LLDP interfaces configuration on network devices
=======================================================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_lldp_interface`.
New in version 1.0.0: of ansible.netcommon
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Updated modules released with more functionality
Alternative
Use platform-specific β[netos]\_lldp\_interfacesβ module
Synopsis
--------
* This module provides declarative management of LLDP interfaces configuration on network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of interfaces LLDP should be configured on. |
| **name** string | | Name of the interface LLDP should be configured on. |
| **purge** string | **Default:**"no" | Purge interfaces not defined in the aggregate parameter. |
| **state** string | **Choices:*** **present** β
* absent
* enabled
* disabled
| State of the LLDP configuration. |
Notes
-----
Note
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: Configure LLDP on specific interfaces
ansible.netcommon.net_lldp_interface:
name: eth1
state: present
- name: Disable LLDP on specific interfaces
ansible.netcommon.net_lldp_interface:
name: eth1
state: disabled
- name: Enable LLDP on specific interfaces
ansible.netcommon.net_lldp_interface:
name: eth1
state: enabled
- name: Delete LLDP on specific interfaces
ansible.netcommon.net_lldp_interface:
name: eth1
state: absent
- name: Create aggregate of LLDP interface configurations
ansible.netcommon.net_lldp_interface:
aggregate:
- {name: eth1}
- {name: eth2}
state: present
- name: Delete aggregate of LLDP interface configurations
ansible.netcommon.net_lldp_interface:
aggregate:
- {name: eth1}
- {name: eth2}
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['set service lldp eth1 disable'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ganesh Nalawade (@ganeshrn)
ansible ansible.netcommon.httpapi β Use httpapi to run command on network appliances ansible.netcommon.httpapi β Use httpapi to run command on network appliances
============================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.httpapi`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Parameters](#parameters)
Synopsis
--------
* This connection plugin provides a connection to remote devices over a HTTP(S)-based api.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **become** boolean | **Choices:*** **no** β
* yes
| ini entries: [privilege\_escalation]become = no env:ANSIBLE\_BECOME var: ansible\_become | The become option will instruct the CLI session to attempt privilege escalation on platforms that support it. Normally this means transitioning from user mode to `enable` mode in the CLI session. If become is set to True and the remote device does not support privilege escalation or the privilege has already been elevated, then this option is silently ignored. Can be configured from the CLI via the `--become` or `-b` options. |
| **become\_method** string | **Default:**"sudo" | ini entries: [privilege\_escalation]become\_method = sudo env:ANSIBLE\_BECOME\_METHOD var: ansible\_become\_method | This option allows the become method to be specified in for handling privilege escalation. Typically the become\_method value is set to `enable` but could be defined as other values. |
| **host** string | **Default:**"inventory\_hostname" | var: ansible\_host | Specifies the remote device FQDN or IP address to establish the HTTP(S) connection to. |
| **import\_modules** boolean | **Choices:*** **no** β
* yes
| ini entries: [ansible\_network]import\_modules = no env:ANSIBLE\_NETWORK\_IMPORT\_MODULES var: ansible\_network\_import\_modules | Reduce CPU usage and network module execution time by enabling direct execution. Instead of the module being packaged and executed by the shell, it will be directly executed by the Ansible control node using the same python interpreter as the Ansible process. Note- Incompatible with `asynchronous mode`. Note- Python 3 and Ansible 2.9.16 or greater required. Note- With Ansible 2.9.x fully qualified modules names are required in tasks. |
| **network\_os** string | | var: ansible\_network\_os | Configures the device platform network operating system. This value is used to load the correct httpapi plugin to communicate with the remote device |
| **password** string | | var: ansible\_password var: ansible\_httpapi\_pass var: ansible\_httpapi\_password | Configures the user password used to authenticate to the remote device when needed for the device API. |
| **persistent\_command\_timeout** integer | **Default:**30 | ini entries: [persistent\_connection]command\_timeout = 30 env:ANSIBLE\_PERSISTENT\_COMMAND\_TIMEOUT var: ansible\_command\_timeout | Configures, in seconds, the amount of time to wait for a command to return from the remote device. If this timer is exceeded before the command returns, the connection plugin will raise an exception and close. |
| **persistent\_connect\_timeout** integer | **Default:**30 | ini entries: [persistent\_connection]connect\_timeout = 30 env:ANSIBLE\_PERSISTENT\_CONNECT\_TIMEOUT var: ansible\_connect\_timeout | Configures, in seconds, the amount of time to wait when trying to initially establish a persistent connection. If this value expires before the connection to the remote device is completed, the connection will fail. |
| **persistent\_log\_messages** boolean | **Choices:*** **no** β
* yes
| ini entries: [persistent\_connection]log\_messages = no env:ANSIBLE\_PERSISTENT\_LOG\_MESSAGES var: ansible\_persistent\_log\_messages | This flag will enable logging the command executed and response received from target device in the ansible log file. For this option to work 'log\_path' ansible configuration option is required to be set to a file path with write access. Be sure to fully understand the security implications of enabling this option as it could create a security vulnerability by logging sensitive information in log file. |
| **port** integer | | ini entries: [defaults]remote\_port = None env:ANSIBLE\_REMOTE\_PORT var: ansible\_httpapi\_port | Specifies the port on the remote device that listens for connections when establishing the HTTP(S) connection. When unspecified, will pick 80 or 443 based on the value of use\_ssl. |
| **remote\_user** string | | ini entries: [defaults]remote\_user = None env:ANSIBLE\_REMOTE\_USER var: ansible\_user | The username used to authenticate to the remote device when the API connection is first established. If the remote\_user is not specified, the connection will use the username of the logged in user. Can be configured from the CLI via the `--user` or `-u` options. |
| **session\_key** dictionary | | var: ansible\_httpapi\_session\_key | Configures the session key to be used to authenticate to the remote device when needed for the device API. This should contain a dictionary representing the key name and value for the token. When specified, *password* is ignored. |
| **use\_proxy** boolean | **Choices:*** no
* **yes** β
| var: ansible\_httpapi\_use\_proxy | Whether to use https\_proxy for requests. |
| **use\_ssl** boolean | **Choices:*** **no** β
* yes
| var: ansible\_httpapi\_use\_ssl | Whether to connect using SSL (HTTPS) or not (HTTP). |
| **validate\_certs** boolean | **Choices:*** no
* **yes** β
| var: ansible\_httpapi\_validate\_certs | Whether to validate SSL certificates |
### Authors
* Ansible Networking Team
| programming_docs |
ansible ansible.netcommon.netconf_config β netconf device configuration ansible.netcommon.netconf\_config β netconf device configuration
================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.netconf_config`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Netconf is a network management protocol developed and standardized by the IETF. It is documented in RFC 6241.
* This module allows the user to send a configuration XML file to a netconf device, and detects if there was a configuration change.
Requirements
------------
The below requirements are needed on the host that executes this module.
* ncclient
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **backup** boolean | **Choices:*** **no** β
* yes
| This argument will cause the module to create a full backup of the current `running-config` from the remote device before any changes are made. If the `backup_options` value is not given, the backup file is written to the `backup` folder in the playbook root directory or role root directory, if playbook is part of an ansible role. If the directory does not exist, it is created. |
| **backup\_options** dictionary | | This is a dict object containing configurable options related to backup file path. The value of this option is read only when `backup` is set to *yes*, if `backup` is set to *no* this option will be silently ignored. |
| | **dir\_path** path | | This option provides the path ending with directory name in which the backup configuration file will be stored. If the directory does not exist it will be first created and the filename is either the value of `filename` or default filename as described in `filename` options description. If the path value is not given in that case a *backup* directory will be created in the current working directory and backup configuration will be copied in `filename` within *backup* directory. |
| | **filename** string | | The filename to be used to store the backup configuration. If the filename is not given it will be generated based on the hostname, current time and date in format defined by <hostname>\_config.<current-date>@<current-time> |
| **commit** boolean | **Choices:*** no
* **yes** β
| This boolean flag controls if the configuration changes should be committed or not after editing the candidate datastore. This option is supported only if remote Netconf server supports :candidate capability. If the value is set to *False* commit won't be issued after edit-config operation and user needs to handle commit or discard-changes explicitly. |
| **confirm** integer | **Default:**0 | This argument will configure a timeout value for the commit to be confirmed before it is automatically rolled back. If the `confirm_commit` argument is set to False, this argument is silently ignored. If the value of this argument is set to 0, the commit is confirmed immediately. The remote host MUST support :candidate and :confirmed-commit capability for this option to . |
| **confirm\_commit** boolean | **Choices:*** **no** β
* yes
| This argument will execute commit operation on remote device. It can be used to confirm a previous commit. |
| **content** raw | | The configuration data as defined by the device's data models, the value can be either in xml string format or text format or python dictionary representation of JSON format. In case of json string format it will be converted to the corresponding xml string using xmltodict library before pushing onto the remote host. In case the value of this option isn *text* format the format should be supported by remote Netconf server. If the value of `content` option is in *xml* format in that case the xml value should have *config* as root tag.
aliases: xml |
| **default\_operation** string | **Choices:*** merge
* replace
* none
| The default operation for <edit-config> rpc, valid values are *merge*, *replace* and *none*. If the default value is merge, the configuration data in the `content` option is merged at the corresponding level in the `target` datastore. If the value is replace the data in the `content` option completely replaces the configuration in the `target` datastore. If the value is none the `target` datastore is unaffected by the configuration in the config option, unless and until the incoming configuration data uses the `operation` operation to request a different operation. |
| **delete** boolean | **Choices:*** **no** β
* yes
| It instructs the module to delete the configuration from value mentioned in `target` datastore. |
| **error\_option** string | **Choices:*** **stop-on-error** β
* continue-on-error
* rollback-on-error
| This option controls the netconf server action after an error occurs while editing the configuration. If *error\_option=stop-on-error*, abort the config edit on first error. If *error\_option=continue-on-error*, continue to process configuration data on error. The error is recorded and negative response is generated if any errors occur. If *error\_option=rollback-on-error*, rollback to the original configuration if any error occurs. This requires the remote Netconf server to support the *error\_option=rollback-on-error* capability. |
| **format** string | **Choices:*** xml
* text
* json
| The format of the configuration provided as value of `content`. In case of json string format it will be converted to the corresponding xml string using xmltodict library before pushing onto the remote host. In case of *text* format of the configuration should be supported by remote Netconf server. If the value of `format` options is not given it tries to guess the data format of `content` option as one of *xml* or *json* or *text*. If the data format is not identified it is set to *xml* by default. |
| **get\_filter** raw | | This argument specifies the XML string which acts as a filter to restrict the portions of the data retrieved from the remote device when comparing the before and after state of the device following calls to edit\_config. When not specified, the entire configuration or state data is returned for comparison depending on the value of `source` option. The `get_filter` value can be either XML string or XPath or JSON string or native python dictionary, if the filter is in XPath format the NETCONF server running on remote host should support xpath capability else it will result in an error. |
| **lock** string | **Choices:*** never
* **always** β
* if-supported
| Instructs the module to explicitly lock the datastore specified as `target`. By setting the option value *always* is will explicitly lock the datastore mentioned in `target` option. It the value is *never* it will not lock the `target` datastore. The value *if-supported* lock the `target` datastore only if it is supported by the remote Netconf server. |
| **save** boolean | **Choices:*** **no** β
* yes
| The `save` argument instructs the module to save the configuration in `target` datastore to the startup-config if changed and if :startup capability is supported by Netconf server. |
| **source\_datastore** string | | Name of the configuration datastore to use as the source to copy the configuration to the datastore mentioned by `target` option. The values can be either *running*, *candidate*, *startup* or a remote URL
aliases: source |
| **target** string | **Choices:*** **auto** β
* candidate
* running
| Name of the configuration datastore to be edited. - auto, uses candidate and fallback to running - candidate, edit <candidate/> datastore and then commit - running, edit <running/> datastore directly
aliases: datastore |
| **validate** boolean | **Choices:*** **no** β
* yes
| This boolean flag if set validates the content of datastore given in `target` option. For this option to work remote Netconf server should support :validate capability. |
Notes
-----
Note
* This module requires the netconf system service be enabled on the remote device being managed.
* This module supports devices with and without the candidate and confirmed-commit capabilities. It will always use the safer feature.
* This module supports the use of connection=netconf
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: use lookup filter to provide xml configuration
ansible.netcommon.netconf_config:
content: "{{ lookup('file', './config.xml') }}"
- name: set ntp server in the device
ansible.netcommon.netconf_config:
content: |
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<system xmlns="urn:ietf:params:xml:ns:yang:ietf-system">
<ntp>
<enabled>true</enabled>
<server>
<name>ntp1</name>
<udp><address>127.0.0.1</address></udp>
</server>
</ntp>
</system>
</config>
- name: wipe ntp configuration
ansible.netcommon.netconf_config:
content: |
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
<system xmlns="urn:ietf:params:xml:ns:yang:ietf-system">
<ntp>
<enabled>false</enabled>
<server operation="remove">
<name>ntp1</name>
</server>
</ntp>
</system>
</config>
- name: configure interface while providing different private key file path (for connection=netconf)
ansible.netcommon.netconf_config:
backup: yes
register: backup_junos_location
vars:
ansible_private_key_file: /home/admin/.ssh/newprivatekeyfile
- name: configurable backup path
ansible.netcommon.netconf_config:
backup: yes
backup_options:
filename: backup.cfg
dir_path: /home/user
- name: "configure using direct native format configuration (cisco iosxr)"
ansible.netcommon.netconf_config:
format: json
content: {
"config": {
"interface-configurations": {
"@xmlns": "http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg",
"interface-configuration": {
"active": "act",
"description": "test for ansible Loopback999",
"interface-name": "Loopback999"
}
}
}
}
get_filter: {
"interface-configurations": {
"@xmlns": "http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg",
"interface-configuration": null
}
}
- name: "configure using json string format configuration (cisco iosxr)"
ansible.netcommon.netconf_config:
format: json
content: |
{
"config": {
"interface-configurations": {
"@xmlns": "http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg",
"interface-configuration": {
"active": "act",
"description": "test for ansible Loopback999",
"interface-name": "Loopback999"
}
}
}
}
get_filter: |
{
"interface-configurations": {
"@xmlns": "http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg",
"interface-configuration": null
}
}
# Make a round-trip interface description change, diff the before and after
# this demonstrates the use of the native display format and several utilities
# from the ansible.utils collection
- name: Define the openconfig interface filter
set_fact:
filter:
interfaces:
"@xmlns": "http://openconfig.net/yang/interfaces"
interface:
name: Ethernet2
- name: Get the pre-change config using the filter
ansible.netcommon.netconf_get:
source: running
filter: "{{ filter }}"
display: native
register: pre
- name: Update the description
ansible.utils.update_fact:
updates:
- path: pre.output.data.interfaces.interface.config.description
value: "Configured by ansible {{ 100 | random }}"
register: updated
- name: Apply the new configuration
ansible.netcommon.netconf_config:
content:
config:
interfaces: "{{ updated.pre.output.data.interfaces }}"
- name: Get the post-change config using the filter
ansible.netcommon.netconf_get:
source: running
filter: "{{ filter }}"
display: native
register: post
- name: Show the differences between the pre and post configurations
ansible.utils.fact_diff:
before: "{{ pre.output.data|ansible.utils.to_paths }}"
after: "{{ post.output.data|ansible.utils.to_paths }}"
# TASK [Show the differences between the pre and post configurations] ********
# --- before
# +++ after
# @@ -1,11 +1,11 @@
# {
# - "@time-modified": "2020-10-23T12:27:17.462332477Z",
# + "@time-modified": "2020-10-23T12:27:21.744541708Z",
# "@xmlns": "urn:ietf:params:xml:ns:netconf:base:1.0",
# "interfaces.interface.aggregation.config['fallback-timeout']['#text']": "90",
# "interfaces.interface.aggregation.config['fallback-timeout']['@xmlns']": "http://arista.com/yang/openconfig/interfaces/augments",
# "interfaces.interface.aggregation.config['min-links']": "0",
# "interfaces.interface.aggregation['@xmlns']": "http://openconfig.net/yang/interfaces/aggregate",
# - "interfaces.interface.config.description": "Configured by ansible 56",
# + "interfaces.interface.config.description": "Configured by ansible 67",
# "interfaces.interface.config.enabled": "true",
# "interfaces.interface.config.mtu": "0",
# "interfaces.interface.config.name": "Ethernet2",
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **backup\_path** string | when backup is yes | The full path to the backup file **Sample:** /playbooks/ansible/backup/config.2016-07-16@22:28:34 |
| **diff** dictionary | when diff is enabled | If --diff option in enabled while running, the before and after configuration change are returned as part of before and after key. **Sample:** {'after': '<rpc-reply> <data> <configuration> <version>17.3R1.10</version>...<--snip-->', 'before': '<rpc-reply> <data> <configuration> <version>17.3R1.10</version>...<--snip-->'} |
| **server\_capabilities** list / elements=string | success | list of capabilities of the server **Sample:** ['urn:ietf:params:netconf:base:1.1', 'urn:ietf:params:netconf:capability:confirmed-commit:1.0', 'urn:ietf:params:netconf:capability:candidate:1.0'] |
### Authors
* Leandro Lisboa Penz (@lpenz)
* Ganesh Nalawade (@ganeshrn)
ansible ansible.netcommon.net_put β Copy a file from Ansible Controller to a network device ansible.netcommon.net\_put β Copy a file from Ansible Controller to a network device
====================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_put`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Requirements](#requirements)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
Synopsis
--------
* This module provides functionality to copy file from Ansible controller to network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Requirements
------------
The below requirements are needed on the host that executes this module.
* scp if using protocol=scp with paramiko
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **dest** string | **Default:**["Filename from src and at default directory of user shell on network\_os."] | Specifies the destination file. The path to destination file can either be the full path or relative path as supported by network\_os. |
| **mode** string | **Choices:*** **binary** β
* text
| Set the file transfer mode. If mode is set to *text* then *src* file will go through Jinja2 template engine to replace any vars if present in the src file. If mode is set to *binary* then file will be copied as it is to destination device. |
| **protocol** string | **Choices:*** **scp** β
* sftp
| Protocol used to transfer file. |
| **src** string / required | | Specifies the source file. The path to the source file can either be the full path on the Ansible control host or a relative path from the playbook or role root directory. |
Notes
-----
Note
* Some devices need specific configurations to be enabled before scp can work These configuration should be pre-configured before using this module e.g ios - `ip scp server enable`.
* User privilege to do scp on network device should be pre-configured e.g. ios - need user privilege 15 by default for allowing scp.
* Default destination of source file.
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: copy file from ansible controller to a network device
ansible.netcommon.net_put:
src: running_cfg_ios1.txt
- name: copy file at root dir of flash in slot 3 of sw1(ios)
ansible.netcommon.net_put:
src: running_cfg_sw1.txt
protocol: sftp
dest: flash3:/running_cfg_sw1.txt
```
### Authors
* Deepak Agrawal (@dagrawal)
ansible ansible.netcommon.default β Use default netconf plugin to run standard netconf commands as per RFC ansible.netcommon.default β Use default netconf plugin to run standard netconf commands as per RFC
==================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.default`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Parameters](#parameters)
Synopsis
--------
* This default plugin provides low level abstraction apis for sending and receiving netconf commands as per Netconf RFC specification.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **ncclient\_device\_handler** string | **Default:**"default" | | Specifies the ncclient device handler name for network os that support default netconf implementation as per Netconf RFC specification. To identify the ncclient device handler name refer ncclient library documentation. |
### Authors
* Ansible Networking Team
| programming_docs |
ansible ansible.netcommon.telnet β Executes a low-down and dirty telnet command ansible.netcommon.telnet β Executes a low-down and dirty telnet command
=======================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.telnet`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Executes a low-down and dirty telnet command, not going through the module subsystem.
* This is mostly to be used for enabling ssh on devices that only have telnet enabled by default.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **command** list / elements=string / required | | List of commands to be executed in the telnet session.
aliases: commands |
| **host** string | **Default:**"remote\_addr" | The host/target on which to execute the command |
| **login\_prompt** string | **Default:**"login: " | Login or username prompt to expect |
| **password** string | | The password for login |
| **password\_prompt** string | **Default:**"Password: " | Login or username prompt to expect |
| **pause** integer | **Default:**1 | Seconds to pause between each command issued |
| **port** integer | **Default:**23 | Remote port to use |
| **prompts** list / elements=string | **Default:**["$"] | List of prompts expected before sending next command |
| **send\_newline** boolean | **Choices:*** **no** β
* yes
| Sends a newline character upon successful connection to start the terminal session. |
| **timeout** integer | **Default:**120 | timeout for remote operations |
| **user** string | **Default:**"remote\_user" | The user for login |
Notes
-----
Note
* The `environment` keyword does not work with this task
Examples
--------
```
- name: send configuration commands to IOS
ansible.netcommon.telnet:
user: cisco
password: cisco
login_prompt: 'Username: '
prompts:
- '[>#]'
command:
- terminal length 0
- configure terminal
- hostname ios01
- name: run show commands
ansible.netcommon.telnet:
user: cisco
password: cisco
login_prompt: 'Username: '
prompts:
- '[>#]'
command:
- terminal length 0
- show version
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **output** list / elements=string | always | output of each command is an element in this list **Sample:** ['success', 'success', '', 'warning .. something'] |
### Authors
* Ansible Core Team
ansible ansible.netcommon.net_l3_interface β (deprecated, removed after 2022-06-01) Manage L3 interfaces on network devices ansible.netcommon.net\_l3\_interface β (deprecated, removed after 2022-06-01) Manage L3 interfaces on network devices
=====================================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_l3_interface`.
New in version 1.0.0: of ansible.netcommon
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Updated modules released with more functionality
Alternative
Use platform-specific β[netos]\_l3\_interfacesβ module
Synopsis
--------
* This module provides declarative management of L3 interfaces on network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of L3 interfaces definitions |
| **ipv4** string | | IPv4 of the L3 interface. |
| **ipv6** string | | IPv6 of the L3 interface. |
| **name** string | | Name of the L3 interface. |
| **purge** string | **Default:**"no" | Purge L3 interfaces not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** β
* absent
| State of the L3 interface configuration. |
Notes
-----
Note
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: Set eth0 IPv4 address
ansible.netcommon.net_l3_interface:
name: eth0
ipv4: 192.168.0.1/24
- name: Remove eth0 IPv4 address
ansible.netcommon.net_l3_interface:
name: eth0
state: absent
- name: Set IP addresses on aggregate
ansible.netcommon.net_l3_interface:
aggregate:
- name: eth1
ipv4: 192.168.2.10/24
- name: eth2
ipv4: 192.168.3.10/24
ipv6: fd5d:12c9:2201:1::1/64
- name: Remove IP addresses on aggregate
ansible.netcommon.net_l3_interface:
aggregate:
- name: eth1
ipv4: 192.168.2.10/24
- name: eth2
ipv4: 192.168.3.10/24
ipv6: fd5d:12c9:2201:1::1/64
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ["set interfaces ethernet eth0 address '192.168.0.1/24'"] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ricardo Carrillo Cruz (@rcarrillocruz)
ansible ansible.netcommon.net_interface β (deprecated, removed after 2022-06-01) Manage Interface on network devices ansible.netcommon.net\_interface β (deprecated, removed after 2022-06-01) Manage Interface on network devices
=============================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_interface`.
New in version 1.0.0: of ansible.netcommon
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Updated modules released with more functionality
Alternative
Use platform-specific β[netos]\_interfacesβ module
Synopsis
--------
* This module provides declarative management of Interfaces on network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of Interfaces definitions. |
| **delay** string | **Default:**10 | Time in seconds to wait before checking for the operational state on remote device. This wait is applicable for operational state argument which are *state* with values `up`/`down`, *tx\_rate* and *rx\_rate*. |
| **description** string | | Description of Interface. |
| **duplex** string | **Choices:*** full
* half
* **auto** β
| Interface link status |
| **enabled** string | | Configure interface link status. |
| **mtu** string | | Maximum size of transmit packet. |
| **name** string / required | | Name of the Interface. |
| **purge** string | **Default:**"no" | Purge Interfaces not defined in the aggregate parameter. This applies only for logical interface. |
| **rx\_rate** string | | Receiver rate in bits per second (bps). This is state check parameter only. Supports conditionals, see [Conditionals in Networking Modules](../network/user_guide/network_working_with_command_output)
|
| **speed** string | | Interface link speed. |
| **state** string | **Choices:*** **present** β
* absent
* up
* down
| State of the Interface configuration, `up` indicates present and operationally up and `down` indicates present and operationally `down`
|
| **tx\_rate** string | | Transmit rate in bits per second (bps). This is state check parameter only. Supports conditionals, see [Conditionals in Networking Modules](../network/user_guide/network_working_with_command_output)
|
Notes
-----
Note
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: configure interface
ansible.netcommon.net_interface:
name: ge-0/0/1
description: test-interface
- name: remove interface
ansible.netcommon.net_interface:
name: ge-0/0/1
state: absent
- name: make interface up
ansible.netcommon.net_interface:
name: ge-0/0/1
description: test-interface
enabled: true
- name: make interface down
ansible.netcommon.net_interface:
name: ge-0/0/1
description: test-interface
enabled: false
- name: Create interface using aggregate
ansible.netcommon.net_interface:
aggregate:
- {name: ge-0/0/1, description: test-interface-1}
- {name: ge-0/0/2, description: test-interface-2}
speed: 1g
duplex: full
mtu: 512
- name: Delete interface using aggregate
ansible.netcommon.net_interface:
aggregate:
- {name: ge-0/0/1}
- {name: ge-0/0/2}
state: absent
- name: Check intent arguments
ansible.netcommon.net_interface:
name: fxp0
state: up
tx_rate: ge(0)
rx_rate: le(0)
- name: Config + intent
ansible.netcommon.net_interface:
name: fxp0
enabled: false
state: down
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device. **Sample:** ['interface 20', 'name test-interface'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ganesh Nalawade (@ganeshrn)
ansible ansible.netcommon.net_logging β (deprecated, removed after 2022-06-01) Manage logging on network devices ansible.netcommon.net\_logging β (deprecated, removed after 2022-06-01) Manage logging on network devices
=========================================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.net_logging`.
New in version 1.0.0: of ansible.netcommon
* [DEPRECATED](#deprecated)
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
* [Status](#status)
DEPRECATED
----------
Removed in
major release after 2022-06-01
Why
Updated modules released with more functionality
Alternative
Use platform-specific β[netos]\_loggingβ module
Synopsis
--------
* This module provides declarative management of logging on network devices.
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **aggregate** string | | List of logging definitions. |
| **dest** string | **Choices:*** console
* host
| Destination of the logs. |
| **facility** string | | Set logging facility. |
| **level** string | | Set logging severity levels. |
| **name** string | | If value of `dest` is *host* it indicates file-name the host name to be notified. |
| **purge** string | **Default:**"no" | Purge logging not defined in the *aggregate* parameter. |
| **state** string | **Choices:*** **present** β
* absent
| State of the logging configuration. |
Notes
-----
Note
* This module is supported on `ansible_network_os` network platforms. See the [Network Platform Options](../../../network/user_guide/platform_index#platform-options) for details.
Examples
--------
```
- name: configure console logging
ansible.netcommon.net_logging:
dest: console
facility: any
level: critical
- name: remove console logging configuration
ansible.netcommon.net_logging:
dest: console
state: absent
- name: configure host logging
ansible.netcommon.net_logging:
dest: host
name: 192.0.2.1
facility: kernel
level: critical
- name: Configure file logging using aggregate
ansible.netcommon.net_logging:
dest: file
aggregate:
- name: test-1
facility: pfe
level: critical
- name: test-2
facility: kernel
level: emergency
- name: Delete file logging using aggregate
ansible.netcommon.net_logging:
dest: file
aggregate:
- name: test-1
facility: pfe
level: critical
- name: test-2
facility: kernel
level: emergency
state: absent
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **commands** list / elements=string | always, except for the platforms that use Netconf transport to manage the device. | The list of configuration mode commands to send to the device **Sample:** ['logging console critical'] |
Status
------
* This module will be removed in a major release after 2022-06-01. *[deprecated]*
* For more information see [DEPRECATED](#deprecated).
### Authors
* Ganesh Nalawade (@ganeshrn)
ansible ansible.netcommon.cli_parse β Parse cli output or text using a variety of parsers ansible.netcommon.cli\_parse β Parse cli output or text using a variety of parsers
==================================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.cli_parse`.
New in version 1.2.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Parse cli output or text using a variety of parsers
Note
This module has a corresponding [action plugin](../../../plugins/action#action-plugins).
Parameters
----------
| Parameter | Choices/Defaults | Comments |
| --- | --- | --- |
| **command** string | | The command to run on the host |
| **parser** dictionary / required | | Parser specific parameters |
| | **command** string | | The command used to locate the parser's template |
| | **name** string / required | | The name of the parser to use |
| | **os** string | | Provide an operating system value to the parser For `ntc\_templates` parser, this should be in the supported `<vendor>\_<os>` format. |
| | **template\_path** string | | Path of the parser template on the Ansible controller This can be a relative or an absolute path |
| | **vars** dictionary | | Additional parser specific parameters See the cli\_parse user guide for examples of parser specific variables [https://docs.ansible.com/ansible/latest/network/user\_guide/cli\_parsing.html](../../../network/user_guide/cli_parsing) |
| **set\_fact** string | | Set the resulting parsed data as a fact |
| **text** string | | Text to be parsed |
Notes
-----
Note
* The default search path for a parser template is templates/{{ short\_os }}\_{{ command }}.{{ extension }}
* => short\_os derived from ansible\_network\_os or ansible\_distribution and set to lower case
* => command is the command passed to the module with spaces replaced with \_
* => extension is specific to the parser used (native=yaml, textfsm=textfsm, ttp=ttp)
* The default Ansible search path for the templates directory is used for parser templates as well
* Some parsers may have additional configuration options available. See the parsers/vars key and the parserβs documentation
* Some parsers require third-party python libraries be installed on the Ansible control node and a specific python version
* e.g. Pyats requires pyats and genie and requires Python 3
* e.g. ntc\_templates requires ntc\_templates
* e.g. textfsm requires textfsm
* e.g. ttp requires ttp
* e.g. xml requires xml\_to\_dict
* Support of 3rd party python libraries is limited to the use of their public APIs as documented
* Additional information and examples can be found in the parsing user guide:
* [https://docs.ansible.com/ansible/latest/network/user\_guide/cli\_parsing.html](../../../network/user_guide/cli_parsing)
Examples
--------
```
# Using the native parser
# -------------
# templates/nxos_show_interface.yaml
# - example: Ethernet1/1 is up
# getval: '(?P<name>\S+) is (?P<oper_state>\S+)'
# result:
# "{{ name }}":
# name: "{{ name }}"
# state:
# operating: "{{ oper_state }}"
# shared: True
#
# - example: admin state is up, Dedicated Interface
# getval: 'admin state is (?P<admin_state>\S+)'
# result:
# "{{ name }}":
# name: "{{ name }}"
# state:
# admin: "{{ admin_state }}"
#
# - example: " Hardware: Ethernet, address: 0000.5E00.5301 (bia 0000.5E00.5301)"
# getval: '\s+Hardware: (?P<hardware>.*), address: (?P<mac>\S+)'
# result:
# "{{ name }}":
# hardware: "{{ hardware }}"
# mac_address: "{{ mac }}"
- name: Run command and parse with native
ansible.netcommon.cli_parse:
command: "show interface"
parser:
name: ansible.netcommon.native
set_fact: interfaces_fact
- name: Pass text and template_path
ansible.netcommon.cli_parse:
text: "{{ previous_command['stdout'] }}"
parser:
name: ansible.netcommon.native
template_path: "{{ role_path }}/templates/nxos_show_interface.yaml"
# Using the ntc_templates parser
# -------------
# The ntc_templates use 'vendor_platform' for the file name
# it will be derived from ansible_network_os if not provided
# e.g. cisco.ios.ios => cisco_ios
- name: Run command and parse with ntc_templates
ansible.netcommon.cli_parse:
command: "show interface"
parser:
name: ansible.netcommon.ntc_templates
register: parser_output
- name: Pass text and command
ansible.netcommon.cli_parse:
text: "{{ previous_command['stdout'] }}"
parser:
name: ansible.netcommon.ntc_templates
command: show interface
register: parser_output
# Using the pyats parser
# -------------
# The pyats parser uses 'os' to locate the appropriate parser
# it will be derived from ansible_network_os if not provided
# in the case of pyats: cisco.ios.ios => iosxe
- name: Run command and parse with pyats
ansible.netcommon.cli_parse:
command: "show interface"
parser:
name: ansible.netcommon.pyats
register: parser_output
- name: Pass text and command
ansible.netcommon.cli_parse:
text: "{{ previous_command['stdout'] }}"
parser:
name: ansible.netcommon.pyats
command: show interface
register: parser_output
- name: Provide an OS to pyats to use an ios parser
ansible.netcommon.cli_parse:
text: "{{ previous_command['stdout'] }}"
parser:
name: ansible.netcommon.pyats
command: show interface
os: ios
register: parser_output
# Using the textfsm parser
# -------------
# templates/nxos_show_version.textfsm
#
# Value UPTIME ((\d+\s\w+.s.,?\s?){4})
# Value LAST_REBOOT_REASON (.+)
# Value OS (\d+.\d+(.+)?)
# Value BOOT_IMAGE (.*)
# Value PLATFORM (\w+)
#
# Start
# ^\s+(NXOS: version|system:\s+version)\s+${OS}\s*$$
# ^\s+(NXOS|kickstart)\s+image\s+file\s+is:\s+${BOOT_IMAGE}\s*$$
# ^\s+cisco\s+${PLATFORM}\s+[cC]hassis
# ^\s+cisco\s+Nexus\d+\s+${PLATFORM}
# # Cisco N5K platform
# ^\s+cisco\s+Nexus\s+${PLATFORM}\s+[cC]hassis
# ^\s+cisco\s+.+-${PLATFORM}\s*
# ^Kernel\s+uptime\s+is\s+${UPTIME}
# ^\s+Reason:\s${LAST_REBOOT_REASON} -> Record
- name: Run command and parse with textfsm
ansible.netcommon.cli_parse:
command: "show version"
parser:
name: ansible.netcommon.textfsm
register: parser_output
- name: Pass text and command
ansible.netcommon.cli_parse:
text: "{{ previous_command['stdout'] }}"
parser:
name: ansible.netcommon.textfsm
command: show version
register: parser_output
# Using the ttp parser
# -------------
# templates/nxos_show_interface.ttp
#
# {{ interface }} is {{ state }}
# admin state is {{ admin_state }}{{ ignore(".*") }}
- name: Run command and parse with ttp
ansible.netcommon.cli_parse:
command: "show interface"
parser:
name: ansible.netcommon.ttp
set_fact: new_fact_key
- name: Pass text and template_path
ansible.netcommon.cli_parse:
text: "{{ previous_command['stdout'] }}"
parser:
name: ansible.netcommon.ttp
template_path: "{{ role_path }}/templates/nxos_show_interface.ttp"
register: parser_output
# Using the XML parser
# -------------
- name: Run command and parse with xml
ansible.netcommon.cli_parse:
command: "show interface | xml"
parser:
name: ansible.netcommon.xml
register: parser_output
- name: Pass text and parse with xml
ansible.netcommon.cli_parse:
text: "{{ previous_command['stdout'] }}"
parser:
name: ansible.netcommon.xml
register: parser_output
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this module:
| Key | Returned | Description |
| --- | --- | --- |
| **parsed** dictionary | always | The structured data resulting from the parsing of the text |
| **stdout** string | when provided a command | The output from the command run |
| **stdout\_lines** list / elements=string | when provided a command | The output of the command run split into lines |
### Authors
* Bradley Thornton (@cidrblock)
| programming_docs |
ansible ansible.netcommon.enable β Switch to elevated permissions on a network device ansible.netcommon.enable β Switch to elevated permissions on a network device
=============================================================================
Note
This plugin is part of the [ansible.netcommon collection](https://galaxy.ansible.com/ansible/netcommon) (version 2.4.0).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.netcommon`.
To use it in a playbook, specify: `ansible.netcommon.enable`.
New in version 1.0.0: of ansible.netcommon
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
Synopsis
--------
* This become plugins allows elevated permissions on a remote network device.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **become\_pass** string | | ini entries: [enable\_become\_plugin]password = None env:ANSIBLE\_BECOME\_PASS env:ANSIBLE\_ENABLE\_PASS var: ansible\_become\_password var: ansible\_become\_pass var: ansible\_enable\_pass | password |
Notes
-----
Note
* enable is really implemented in the network connection handler and as such can only be used with network connections.
* This plugin ignores the βbecome\_exeβ and βbecome\_userβ settings as it uses an API and not an executable.
### Authors
* Ansible Networking Team
ansible ansible.utils.index_of β Find the indices of items in a list matching some criteria ansible.utils.index\_of β Find the indices of items in a list matching some criteria
====================================================================================
Note
This plugin is part of the [ansible.utils collection](https://galaxy.ansible.com/ansible/utils) (version 2.4.2).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.utils`.
To use it in a playbook, specify: `ansible.utils.index_of`.
New in version 1.0.0: of ansible.utils
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* This plugin returns the indices of items matching some criteria in a list.
* When working with a list of dictionaries, the key to evaluate can be specified.
* **index\_of** is also available as a **filter plugin** for convenience.
* Using the parameters below- `lookup('ansible.utils.index_of', data, test, value, key, fail_on_missing, wantlist`).
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **data** list / elements=string / required | | | A list of items to enumerate and test against. |
| **fail\_on\_missing** boolean | **Choices:*** no
* yes
| | When provided a list of dictionaries, fail if the key is missing from one or more of the dictionaries. |
| **key** string | | | When the data provided is a list of dictionaries, run the test against this dictionary key. When using a *key*, the *data* must only contain dictionaries. See *fail\_on\_missing* below to determine the behaviour when the *key* is missing from a dictionary in the *data*. |
| **test** string / required | | | The name of the test to run against the list, a valid jinja2 test or ansible test plugin. Jinja2 includes the following tests <http://jinja.palletsprojects.com/templates/#builtin-tests>. An overview of tests included in ansible [https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_tests.html](../../../user_guide/playbooks_tests). |
| **value** raw | | | The value used to test each list item against. Not required for simple tests (eg: `true`, `false`, `even`, `odd`) May be a `string`, `boolean`, `number`, `regular expression` `dict` and so on, depending on the **test** used. |
| **wantlist** boolean | **Choices:*** no
* yes
| | When only a single entry in the *data* is matched, the index of that entry is returned as an integer. If set to `True`, the return value will always be a list, even if only a single entry is matched. This can also be accomplished using `query` or `q` instead of `lookup`. [https://docs.ansible.com/ansible/latest/plugins/lookup.html](../../../plugins/lookup)
|
Examples
--------
```
#### Simple examples
- ansible.builtin.set_fact:
data:
- 1
- 2
- 3
- name: Find the index of 2
ansible.builtin.set_fact:
indices: "{{ lookup('ansible.utils.index_of', data, 'eq', 2) }}"
# TASK [Find the index of 2] *************************************************
# ok: [nxos101] => changed=false
# ansible_facts:
# indices: '1'
- name: Find the index of 2, ensure list is returned
ansible.builtin.set_fact:
indices: "{{ lookup('ansible.utils.index_of', data, 'eq', 2, wantlist=True) }}"
# TASK [Find the index of 2, ensure list is returned] ************************
# ok: [nxos101] => changed=false
# ansible_facts:
# indices:
# - 1
- name: Find the index of 3 using the long format
ansible.builtin.set_fact:
indices: "{{ lookup('ansible.utils.index_of', data=data, test='eq', value=value, wantlist=True) }}"
vars:
value: 3
# TASK [Find the index of 3 using the long format] ***************************
# ok: [nxos101] => changed=false
# ansible_facts:
# indices:
# - 2
- name: Find numbers greater than 1, using loop
debug:
msg: "{{ data[item] }} is {{ test }} than {{ value }}"
loop: "{{ lookup('ansible.utils.index_of', data, test, value) }}"
vars:
test: '>'
value: 1
# TASK [Find numbers great than 1, using loop] *******************************
# ok: [sw01] => (item=1) =>
# msg: 2 is > than 1
# ok: [sw01] => (item=2) =>
# msg: 3 is > than 1
- name: Find numbers greater than 1, using with
debug:
msg: "{{ data[item] }} is {{ params.test }} than {{ params.value }}"
with_ansible.utils.index_of: "{{ params }}"
vars:
params:
data: "{{ data }}"
test: '>'
value: 1
# TASK [Find numbers greater than 1, using with] *****************************
# ok: [nxos101] => (item=1) =>
# msg: 2 is > than 1
# ok: [nxos101] => (item=2) =>
# msg: 3 is > than 1
#### Working with lists of dictionaries
- ansible.builtin.set_fact:
data:
- name: sw01.example.lan
type: switch
- name: rtr01.example.lan
type: router
- name: fw01.example.corp
type: firewall
- name: fw02.example.corp
type: firewall
- name: Find the index of all firewalls using the type key
ansible.builtin.set_fact:
firewalls: "{{ lookup('ansible.utils.index_of', data, 'eq', 'firewall', 'type') }}"
# TASK [Find the index of all firewalls using the type key] ******************
# ok: [nxos101] => changed=false
# ansible_facts:
# firewalls:
# - 2
# - 3
- name: Find the index of all firewalls, use in a loop
debug:
msg: "The type of {{ device_type }} at index {{ item }} has name {{ data[item].name }}."
loop: "{{ lookup('ansible.utils.index_of', data, 'eq', device_type, 'type') }}"
vars:
device_type: firewall
# TASK [Find the index of all firewalls, use in a loop, as a filter] *********
# ok: [nxos101] => (item=2) =>
# msg: The type of firewall at index 2 has name fw01.example.corp.
# ok: [nxos101] => (item=3) =>
# msg: The type of firewall at index 3 has name fw02.example.corp.
- name: Find the index of all devices with a .corp name
debug:
msg: "The device named {{ data[item].name }} is a {{ data[item].type }}"
loop: "{{ lookup('ansible.utils.index_of', data, 'regex', expression, 'name') }}"
vars:
expression: '\.corp$' # ends with .corp
# TASK [Find the index of all devices with a .corp name] *********************
# ok: [nxos101] => (item=2) =>
# msg: The device named fw01.example.corp is a firewall
# ok: [nxos101] => (item=3) =>
# msg: The device named fw02.example.corp is a firewall
#### Working with complex structures from resource modules
- name: Retrieve the current L3 interface configuration
cisco.nxos.nxos_l3_interfaces:
state: gathered
register: current_l3
# TASK [Retrieve the current L3 interface configuration] *********************
# ok: [sw01] => changed=false
# gathered:
# - name: Ethernet1/1
# - name: Ethernet1/2
# <...>
# - name: Ethernet1/128
# - ipv4:
# - address: 192.168.101.14/24
# name: mgmt0
- name: Find the indices interfaces with a 192.168.101.xx ip address
ansible.builtin.set_fact:
found: "{{ found + entry }}"
with_indexed_items: "{{ current_l3.gathered }}"
vars:
found: []
ip: '192.168.101.'
address: "{{ lookup('ansible.utils.index_of', item.1.ipv4|d([]), 'search', ip, 'address', wantlist=True) }}"
entry:
- interface_idx: "{{ item.0 }}"
address_idxs: "{{ address }}"
when: address
# TASK [debug] ***************************************************************
# ok: [sw01] =>
# found:
# - address_idxs:
# - 0
# interface_idx: '128'
- name: Show all interfaces and their address
debug:
msg: "{{ interface.name }} has ip {{ address }}"
loop: "{{ found|subelements('address_idxs') }}"
vars:
interface: "{{ current_l3.gathered[item.0.interface_idx|int] }}"
address: "{{ interface.ipv4[item.1].address }}"
# TASK [Show all interfaces and their address] *******************************
# ok: [nxos101] => (item=[{'interface_idx': '128', 'address_idxs': [0]}, 0]) =>
# msg: mgmt0 has ip 192.168.101.14/24
#### Working with deeply nested data
- ansible.builtin.set_fact:
data:
interfaces:
interface:
- config:
description: configured by Ansible - 1
enabled: True
loopback-mode: False
mtu: 1024
name: loopback0000
type: eth
name: loopback0000
subinterfaces:
subinterface:
- config:
description: subinterface configured by Ansible - 1
enabled: True
index: 5
index: 5
- config:
description: subinterface configured by Ansible - 2
enabled: False
index: 2
index: 2
- config:
description: configured by Ansible - 2
enabled: False
loopback-mode: False
mtu: 2048
name: loopback1111
type: virt
name: loopback1111
subinterfaces:
subinterface:
- config:
description: subinterface configured by Ansible - 3
enabled: True
index: 10
index: 10
- config:
description: subinterface configured by Ansible - 4
enabled: False
index: 3
index: 3
- name: Find the description of loopback111, subinterface index 10
debug:
msg: |-
{{ data.interfaces.interface[int_idx|int]
.subinterfaces.subinterface[subint_idx|int]
.config.description }}
vars:
# the values to search for
int_name: loopback1111
sub_index: 10
# retrieve the index in each nested list
int_idx: |
{{ lookup('ansible.utils.index_of',
data.interfaces.interface,
'eq', int_name, 'name') }}
subint_idx: |
{{ lookup('ansible.utils.index_of',
data.interfaces.interface[int_idx|int].subinterfaces.subinterface,
'eq', sub_index, 'index') }}
# TASK [Find the description of loopback111, subinterface index 10] ************
# ok: [sw01] =>
# msg: subinterface configured by Ansible - 3
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this lookup:
| Key | Returned | Description |
| --- | --- | --- |
| **\_raw** string | success | One or more zero-based indicies of the matching list items. See `wantlist` if a list is always required. |
### Authors
* Bradley Thornton (@cidrblock)
ansible Ansible.Utils Ansible.Utils
=============
Collection version 2.4.2
Plugin Index
------------
These are the plugins in the ansible.utils collection
### Lookup Plugins
* [get\_path](get_path_lookup#ansible-collections-ansible-utils-get-path-lookup) β Retrieve the value in a variable using a path
* [index\_of](index_of_lookup#ansible-collections-ansible-utils-index-of-lookup) β Find the indices of items in a list matching some criteria
* [to\_paths](to_paths_lookup#ansible-collections-ansible-utils-to-paths-lookup) β Flatten a complex object into a dictionary of paths and values
* [validate](validate_lookup#ansible-collections-ansible-utils-validate-lookup) β Validate data with provided criteria
### Modules
* [cli\_parse](cli_parse_module#ansible-collections-ansible-utils-cli-parse-module) β Parse cli output or text using a variety of parsers
* [fact\_diff](fact_diff_module#ansible-collections-ansible-utils-fact-diff-module) β Find the difference between currently set facts
* [update\_fact](update_fact_module#ansible-collections-ansible-utils-update-fact-module) β Update currently set facts
* [validate](validate_module#ansible-collections-ansible-utils-validate-module) β Validate data with provided criteria
See also
List of [collections](../../index#list-of-collections) with docs hosted here.
ansible ansible.utils.validate β Validate data with provided criteria ansible.utils.validate β Validate data with provided criteria
=============================================================
Note
This plugin is part of the [ansible.utils collection](https://galaxy.ansible.com/ansible/utils) (version 2.4.2).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.utils`.
To use it in a playbook, specify: `ansible.utils.validate`.
New in version 1.0.0: of ansible.utils
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Notes](#notes)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Validate *data* with provided *criteria* based on the validation *engine*.
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **criteria** raw / required | | | The criteria used for validation of value that represents *data* options. This option represents the second argument passed in the lookup plugin For example `lookup(config_data, config_criteria, engine='ansible.utils.jsonschema'`), in this case the value of `config_criteria` represents this option. For the type of *criteria* that represents this value refer to the documentation of individual validate plugins. |
| **data** raw / required | | | Data that will be validated against *criteria*. This option represents the value that is passed to the lookup plugin as the first argument. For example `lookup(config_data, config_criteria, engine='ansible.utils.jsonschema'`), in this case `config_data` represents this option. For the type of *data* that represents this value refer to the documentation of individual validate plugins. |
| **engine** string | **Default:**"ansible.utils.jsonschema" | | The name of the validate plugin to use. This option can be passed in lookup plugin as a key, value pair. For example `lookup(config_data, config_criteria, engine='ansible.utils.jsonschema'`), in this case the value `ansible.utils.jsonschema` represents the engine to be use for data validation. If the value is not provided the default value that is `ansible.uitls.jsonschema` will be used. The value should be in fully qualified collection name format that is `<org-name>.<collection-name>.<validate-plugin-name>`. |
Notes
-----
Note
* For the type of options *data* and *criteria* refer to the individual validate plugin documentation that is represented in the value of *engine* option.
* For additional plugin configuration options refer to the individual validate plugin documentation that is represented by the value of *engine* option.
* The plugin configuration option can be either passed as `key=value` pairs within lookup plugin or task or environment variables.
* The precedence the validate plugin configurable option is the variable passed within lookup plugin as `key=value` pairs followed by task variables followed by environment variables.
Examples
--------
```
- name: set facts for data and criteria
ansible.builtin.set_fact:
data: "{{ lookup('ansible.builtin.file', './validate/data/show_interfaces_iosxr.json')}}"
criteria: "{{ lookup('ansible.builtin.file', './validate/criteria/jsonschema/show_interfaces_iosxr.json')}}"
- name: validate data in json format using jsonschema with lookup plugin by passing plugin configuration variable as key/value pairs
ansible.builtin.set_fact:
data_criteria_checks: "{{ lookup(data, criteria, engine='ansible.utils.jsonschema', draft='draft7') }}"
- name: validate data in json format using jsonschema with lookup plugin by passing plugin configuration variable as task variable
ansible.builtin.set_fact:
data_criteria_checks: "{{ lookup('ansible.utils.validate', data, criteria, engine='ansible.utils.jsonschema', draft='draft7') }}"
vars:
ansible_validate_jsonschema_draft: draft3
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this lookup:
| Key | Returned | Description |
| --- | --- | --- |
| **\_raw** string | success | If data is valid returns empty list. If data is invalid returns list of errors in data. |
### Authors
* Ganesh Nalawade (@ganeshrn)
ansible ansible.utils.get_path β Retrieve the value in a variable using a path ansible.utils.get\_path β Retrieve the value in a variable using a path
=======================================================================
Note
This plugin is part of the [ansible.utils collection](https://galaxy.ansible.com/ansible/utils) (version 2.4.2).
You might already have this collection installed if you are using the `ansible` package. It is not included in `ansible-core`. To check whether it is installed, run `ansible-galaxy collection list`.
To install it, use: `ansible-galaxy collection install ansible.utils`.
To use it in a playbook, specify: `ansible.utils.get_path`.
New in version 1.0.0: of ansible.utils
* [Synopsis](#synopsis)
* [Parameters](#parameters)
* [Examples](#examples)
* [Return Values](#return-values)
Synopsis
--------
* Use a *path* to retrieve a nested value from a *var*
* **get\_path** is also available as a **filter plugin** for convenience
* Using the parameters below- `lookup('ansible.utils.get_path', var, path, wantlist`)
Parameters
----------
| Parameter | Choices/Defaults | Configuration | Comments |
| --- | --- | --- | --- |
| **path** string / required | | | The *path* in the *var* to retrieve the value of. The *path* needs to a be a valid jinja path. |
| **var** raw / required | | | The variable from which the value should be extracted. |
| **wantlist** boolean | **Choices:*** no
* yes
| | If set to `True`, the return value will always be a list. This can also be accomplished using `query` or `q` instead of `lookup`. [https://docs.ansible.com/ansible/latest/plugins/lookup.html](../../../plugins/lookup). |
Examples
--------
```
- ansible.builtin.set_fact:
a:
b:
c:
d:
- 0
- 1
e:
- True
- False
- name: Retrieve a value deep inside a using a path
ansible.builtin.set_fact:
value: "{{ lookup('ansible.utils.get_path', a, path) }}"
vars:
path: b.c.d[0]
# TASK [Retrieve a value deep inside a using a path] ******************
# ok: [localhost] => changed=false
# ansible_facts:
# value: '0'
#### Working with hostvars
- name: Retrieve a value deep inside all of the host's vars
ansible.builtin.set_fact:
value: "{{ lookup('ansible.utils.get_path', look_in, look_for) }}"
vars:
look_in: "{{ hostvars[inventory_hostname] }}"
look_for: a.b.c.d[0]
# TASK [Retrieve a value deep inside all of the host's vars] ********
# ok: [nxos101] => changed=false
# ansible_facts:
# as_filter: '0'
# as_lookup: '0'
#### Used alongside ansible.utils.to_paths
- name: Get the paths for the object
ansible.builtin.set_fact:
paths: "{{ lookup('ansible.utils.to_paths', a, prepend='a') }}"
- name: Retrieve the value of each path from vars
ansible.builtin.debug:
msg: "The value of path {{ path }} in vars is {{ value }}"
loop: "{{ paths.keys()|list }}"
loop_control:
label: "{{ item }}"
vars:
path: "{{ item }}"
value: "{{ lookup('ansible.utils.get_path', hostvars[inventory_hostname], item) }}"
# TASK [Get the paths for the object] *******************************
# ok: [nxos101] => changed=false
# ansible_facts:
# paths:
# a.b.c.d[0]: 0
# a.b.c.d[1]: 1
# a.b.c.e[0]: True
# a.b.c.e[1]: False
# TASK [Retrieve the value of each path from vars] ******************
# ok: [nxos101] => (item=a.b.c.d[0]) =>
# msg: The value of path a.b.c.d[0] in vars is 0
# ok: [nxos101] => (item=a.b.c.d[1]) =>
# msg: The value of path a.b.c.d[1] in vars is 1
# ok: [nxos101] => (item=a.b.c.e[0]) =>
# msg: The value of path a.b.c.e[0] in vars is True
# ok: [nxos101] => (item=a.b.c.e[1]) =>
# msg: The value of path a.b.c.e[1] in vars is False
#### Working with complex structures and transforming results
- name: Retrieve the current interface config
cisco.nxos.nxos_interfaces:
state: gathered
register: interfaces
- name: Get the description of several interfaces
ansible.builtin.debug:
msg: "{{ lookup('ansible.utils.get_path', rekeyed, item) }}"
vars:
rekeyed:
by_name: "{{ interfaces.gathered|ansible.builtin.rekey_on_member('name') }}"
loop:
- by_name['Ethernet1/1'].description
- by_name['Ethernet1/2'].description|upper
- by_name['Ethernet1/3'].description|default('')
# TASK [Get the description of several interfaces] ******************
# ok: [nxos101] => (item=by_name['Ethernet1/1'].description) => changed=false
# msg: Configured by ansible
# ok: [nxos101] => (item=by_name['Ethernet1/2'].description|upper) => changed=false
# msg: CONFIGURED BY ANSIBLE
# ok: [nxos101] => (item=by_name['Ethernet1/3'].description|default('')) => changed=false
# msg: ''
```
Return Values
-------------
Common return values are documented [here](../../../reference_appendices/common_return_values#common-return-values), the following are the fields unique to this lookup:
| Key | Returned | Description |
| --- | --- | --- |
| **\_raw** string | success | One or more zero-based indices of the matching list items. See `wantlist` if a list is always required. |
### Authors
* Bradley Thornton (@cidrblock)
| programming_docs |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.