With Ansible playbooks for networking platforms, historically most of the networking modules require a provider argument per task (which supplied the connection type, username, password, etc). Notable exceptions included BigSwitch and Cumulus (one is a controller and one is a Linux NOS).
With Ansible 2.5 (which you can install now, via the latest dev release) allows connection: network_cli as a top level connection which is supported by all the major networking vendors now (ios, nxos, iosxr, eos, junos) and vyos. connection: netconf is supported on iosxr and junos. The deprecation for provider won't begin with Ansible 2.5, and will take considerable time, so there will not be any rush to update playbooks.
The network_cli and netconf connection plugins will allow playbooks to look, feel and operate just like they do on Linux hosts. Also the error reporting is significantly improved, which will help a lot of people who were frustrated with changes to Ansible in 2.3.
Here is a quick example:
--- - hosts: rtr1 connection: network_cli remote_user: admin become: yes become_method: enable tasks: - name: Backup configuration ios_config: backup: yes
Feel free to ask questions on this thread and I will try to answer them to the best of my ability :)
More details and examples can be found on my post here
No comments:
Post a Comment