Cisco IOS Collection

The Ansible Cisco IOS collection includes a variety of Ansible content to help automate the management of Cisco IOS and Cisco IOS XE network appliances.
This collection has been tested against Cisco IOS XE Version 17.3 on CML.
Requirements
- Ansible Core 2.16.0 or later.
- Python 3.10 or later.
- The
ansible.netcommon collection, version 8.5.2 or later.
- The
ansible.utils collection, required transitively by ansible.netcommon as declared in its collection metadata.
- Python packages declared in this collection’s
requirements.txt and ansible.netcommon’s requirements.txt: ansible-pylibssh 1.4.0 or later, jxmlease, ncclient, paramiko, xmltodict, grpcio, and protobuf.
ansible-pylibssh provides the libssh backend for ansible.netcommon.network_cli. The paramiko backend is now deprecated. Refer to the following forum post for more information.
Support
As Red Hat Ansible Certified Content, this collection is entitled to support through Ansible Automation Platform (AAP). Open a support case using the Create issue button in the top-right corner of this collection’s page in Red Hat Ansible Automation Hub.
Community help is also available on #network:ansible.com or the Ansible Forum Network Working Group.
Communication
For more information about communication, see the Ansible communication guide.
Ansible version compatibility
This collection has been tested against the following Ansible versions: >=2.16.0.
Plugins and modules within a collection may be tested with only specific Ansible versions.
A collection may contain metadata that identifies these versions.
PEP440 is the schema used to describe the versions of Ansible.
Supported connections
The Cisco IOS collection supports network_cli connections. A detailed platform guide can be found here.
Included content
Cliconf plugins
| Name |
Description |
| cisco.ios.ios |
Use ios cliconf to run command on Cisco IOS platform |
Modules
Installation
Install the certified Cisco IOS collection from Red Hat Ansible Automation Hub. Access to certified content requires a Red Hat account with an active Ansible Automation Platform subscription and an Automation Hub offline token. In the Red Hat Hybrid Cloud Console, go to Automation Hub > Connect Hub, load the offline token, and store it securely. See the Red Hat token management instructions.
Configure your ansible.cfg to use the hosted Automation Hub service:
[galaxy]
server_list = automation_hub
[galaxy_server.automation_hub]
url = https://console.redhat.com/api/automation-hub/content/published/
auth_url = https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token = <your_automation_hub_token>
Keep the token secret and out of source control. Then install the collection:
ansible-galaxy collection install cisco.ios --server automation_hub
For a requirements.yml file, identify Automation Hub as the source:
---
collections:
- name: cisco.ios
source: automation_hub
Install the requirements with ansible-galaxy collection install -r requirements.yml.
For community use outside Red Hat supported environments, you can install the collection from Ansible Galaxy:
ansible-galaxy collection install cisco.ios
You can also add it to a requirements.yml file:
---
collections:
- name: cisco.ios
Using this collection
This collection includes network resource modules.
Using modules from the Cisco IOS collection in your playbooks
You can call modules by their Fully Qualified Collection Namespace (FQCN), such as cisco.ios.ios_l2_interfaces.
The following example task replaces configuration changes in the existing configuration on a Cisco IOS network device, using the FQCN:
---
- name: Replace device configuration of specified 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
NOTE: For Ansible 2.9, you may not see deprecation warnings when you run your playbooks with this collection. Use this documentation to track when a module is deprecated.
See Also:
Contributing to this collection
We welcome community contributions to this collection. If you find problems, please open an issue or create a PR against the Cisco IOS collection repository. See Contributing to Ansible-maintained collections for complete details.
You can also join us on:
See the Ansible Community Guide for details on contributing to Ansible.
Code of Conduct
This collection follows the Ansible project’s
Code of Conduct.
Please read and familiarize yourself with this document.
Release notes
Release notes are available here.
Licensing
GNU General Public License v3.0 or later.
See LICENSE to see the full text.
评论