Skip to content

Commit

Permalink
Update network platform guides with FQCN (ansible#70699)
Browse files Browse the repository at this point in the history
* fqcn all the docs things!
  • Loading branch information
samccann authored Jul 31, 2020
1 parent 61b36c6 commit 54bee71
Show file tree
Hide file tree
Showing 16 changed files with 269 additions and 247 deletions.
192 changes: 97 additions & 95 deletions docs/docsite/rst/network/user_guide/platform_ce.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
CloudEngine OS Platform Options
***************************************

CloudEngine CE OS supports multiple connections. This page offers details on how each connection works in Ansible and how to use it.
CloudEngine CE OS is part of the `community.network <https://galaxy.ansible.com/community/network>`_ collection and supports multiple connections. This page offers details on how each connection works in Ansible and how to use it.

.. contents:: Topics
.. contents::
:local:

Connections Available
Connections available
================================================================================

.. table::
Expand All @@ -27,7 +28,8 @@ Connections Available

Indirect Access via a bastion (jump host) via a bastion (jump host)

Connection Settings ``ansible_connection: network_cli`` ``ansible_connection: netconf``
Connection Settings ``ansible_connection:`` ``ansible_connection:``
``ansible.netcommon.network_cli`` ``ansible.netcommon.netconf``

|enable_mode| not supported by ce OS not supported by ce OS

Expand All @@ -36,7 +38,7 @@ Connections Available

.. |enable_mode| replace:: Enable Mode |br| (Privilege Escalation)

For legacy playbooks, Ansible still supports ``ansible_connection=local`` on all CloudEngine modules. We recommend modernizing to use ``ansible_connection=netconf`` or ``ansible_connection=network_cli`` as soon as possible.
The ``ansible_connection: local`` has been deprecated. Please use ``ansible_connection: ansible.netcommon.netconf`` or ``ansible_connection=ansible.netcommon.network_cli`` instead.

Using CLI in Ansible
====================
Expand All @@ -47,8 +49,8 @@ Example CLI inventory ``[ce:vars]``
.. code-block:: yaml

[ce:vars]
ansible_connection=network_cli
ansible_network_os=ce
ansible_connection=ansible.netcommon.network_cli
ansible_network_os=community.network.ce
ansible_user=myuser
ansible_password=!vault...
ansible_ssh_common_args='-o ProxyCommand="ssh -W %h:%p -q bastion01"'
Expand All @@ -58,15 +60,15 @@ Example CLI inventory ``[ce:vars]``
- If you are accessing your host directly (not through a bastion/jump host) you can remove the ``ansible_ssh_common_args`` configuration.
- If you are accessing your host through a bastion/jump host, you cannot include your SSH password in the ``ProxyCommand`` directive. To prevent secrets from leaking out (for example in ``ps`` output), SSH does not support providing passwords via environment variables.

Example CLI Task
Example CLI task
----------------

.. code-block:: yaml

- name: Retrieve CE OS version
ce_command:
community.network.ce_command:
commands: display version
when: ansible_network_os == 'ce'
when: ansible_network_os == 'community.network.ce'


Using NETCONF in Ansible
Expand All @@ -80,16 +82,16 @@ Before you can use NETCONF to connect to a switch, you must:
- install the ``ncclient`` python package on your control node(s) with ``pip install ncclient``
- enable NETCONF on the CloudEngine OS device(s)

To enable NETCONF on a new switch via Ansible, use the ``ce_config`` module via the CLI connection. Set up your platform-level variables just like in the CLI example above, then run a playbook task like this:
To enable NETCONF on a new switch using Ansible, use the ``community.network.ce_config`` module with the CLI connection. Set up your platform-level variables just like in the CLI example above, then run a playbook task like this:

.. code-block:: yaml

- name: Enable NETCONF
connection: network_cli
ce_config:
connection: ansible.netcommon.network_cli
community.network.ce_config:
lines:
- snetconf server enable
when: ansible_network_os == 'ce'
when: ansible_network_os == 'community.network.ce'

Once NETCONF is enabled, change your variables to use the NETCONF connection.

Expand All @@ -99,110 +101,110 @@ Example NETCONF inventory ``[ce:vars]``
.. code-block:: yaml

[ce:vars]
ansible_connection=netconf
ansible_network_os=ce
ansible_connection=ansible.netcommon.netconf
ansible_network_os=community.network.ce
ansible_user=myuser
ansible_password=!vault |
ansible_ssh_common_args='-o ProxyCommand="ssh -W %h:%p -q bastion01"'


Example NETCONF Task
Example NETCONF task
--------------------

.. code-block:: yaml

- name: Create a vlan, id is 50(ce)
ce_vlan:
community.network.ce_vlan:
vlan_id: 50
name: WEB
when: ansible_network_os == 'ce'
when: ansible_network_os == 'community.network.ce'


Notes
========================

Modules work with connection C(network_cli)
--------------------------------------------
Modules that work with ``ansible.netcommon.network_cli``
---------------------------------------------------------

.. code-block:: yaml

ce_acl_interface
ce_command
ce_config
ce_evpn_bgp
ce_evpn_bgp_rr
ce_evpn_global
ce_facts
ce_mlag_interface
ce_mtu
ce_netstream_aging
ce_netstream_export
ce_netstream_global
ce_netstream_template
ce_ntp_auth
ce_rollback
ce_snmp_contact
ce_snmp_location
ce_snmp_traps
ce_startup
ce_stp
ce_vxlan_arp
ce_vxlan_gateway
ce_vxlan_global


Modules work with connection C(netconf)
--------------------------------------------
community.network.ce_acl_interface
community.network.ce_command
community.network.ce_config
community.network.ce_evpn_bgp
community.network.ce_evpn_bgp_rr
community.network.ce_evpn_global
community.network.ce_facts
community.network.ce_mlag_interface
community.network.ce_mtu
community.network.ce_netstream_aging
community.network.ce_netstream_export
community.network.ce_netstream_global
community.network.ce_netstream_template
community.network.ce_ntp_auth
community.network.ce_rollback
community.network.ce_snmp_contact
community.network.ce_snmp_location
community.network.ce_snmp_traps
community.network.ce_startup
community.network.ce_stp
community.network.ce_vxlan_arp
community.network.ce_vxlan_gateway
community.network.ce_vxlan_global


Modules that work with ``ansible.netcommon.netconf``
-----------------------------------------------------

.. code-block:: yaml

ce_aaa_server
ce_aaa_server_host
ce_acl
ce_acl_advance
ce_bfd_global
ce_bfd_session
ce_bfd_view
ce_bgp
ce_bgp_af
ce_bgp_neighbor
ce_bgp_neighbor_af
ce_dldp
ce_dldp_interface
ce_eth_trunk
ce_evpn_bd_vni
ce_file_copy
ce_info_center_debug
ce_info_center_global
ce_info_center_log
ce_info_center_trap
ce_interface
ce_interface_ospf
ce_ip_interface
ce_lacp
ce_link_status
ce_lldp
ce_lldp_interface
ce_mlag_config
ce_netconf
ce_ntp
ce_ospf
ce_ospf_vrf
ce_reboot
ce_sflow
ce_snmp_community
ce_snmp_target_host
ce_snmp_user
ce_static_route
ce_static_route_bfd
ce_switchport
ce_vlan
ce_vrf
ce_vrf_af
ce_vrf_interface
ce_vrrp
ce_vxlan_tunnel
ce_vxlan_vap
community.network.ce_aaa_server
community.network.ce_aaa_server_host
community.network.ce_acl
community.network.ce_acl_advance
community.network.ce_bfd_global
community.network.ce_bfd_session
community.network.ce_bfd_view
community.network.ce_bgp
community.network.ce_bgp_af
community.network.ce_bgp_neighbor
community.network.ce_bgp_neighbor_af
community.network.ce_dldp
community.network.ce_dldp_interface
community.network.ce_eth_trunk
community.network.ce_evpn_bd_vni
community.network.ce_file_copy
community.network.ce_info_center_debug
community.network.ce_info_center_global
community.network.ce_info_center_log
community.network.ce_info_center_trap
community.network.ce_interface
community.network.ce_interface_ospf
community.network.ce_ip_interface
community.network.ce_lacp
community.network.ce_link_status
community.network.ce_lldp
community.network.ce_lldp_interface
community.network.ce_mlag_config
community.network.ce_netconf
community.network.ce_ntp
community.network.ce_ospf
community.network.ce_ospf_vrf
community.network.ce_reboot
community.network.ce_sflow
community.network.ce_snmp_community
community.network.ce_snmp_target_host
community.network.ce_snmp_user
community.network.ce_static_route
community.network.ce_static_route_bfd
community.network.ce_switchport
community.network.ce_vlan
community.network.ce_vrf
community.network.ce_vrf_af
community.network.ce_vrf_interface
community.network.ce_vrrp
community.network.ce_vxlan_tunnel
community.network.ce_vxlan_vap

.. include:: shared_snippets/SSH_warning.txt

Expand Down
21 changes: 11 additions & 10 deletions docs/docsite/rst/network/user_guide/platform_cnos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
CNOS Platform Options
***************************************

CNOS supports Enable Mode (Privilege Escalation). This page offers details on how to use Enable Mode on CNOS in Ansible.
CNOS is part of the `community.network <https://galaxy.ansible.com/community/network>`_ collection and supports Enable Mode (Privilege Escalation). This page offers details on how to use Enable Mode on CNOS in Ansible.

.. contents:: Topics
.. contents::
:local:

Connections Available
Connections available
================================================================================

.. table::
Expand All @@ -25,7 +26,7 @@ Connections Available

Indirect Access via a bastion (jump host)

Connection Settings ``ansible_connection: network_cli``
Connection Settings ``ansible_connection: ansible.netcommon.network_cli``

|enable_mode| supported: use ``ansible_become: yes``
with ``ansible_become_method: enable``
Expand All @@ -36,7 +37,7 @@ Connections Available

.. |enable_mode| replace:: Enable Mode |br| (Privilege Escalation)

For legacy playbooks, CNOS still supports ``ansible_connection: local``. We recommend modernizing to use ``ansible_connection: network_cli`` as soon as possible.
The ``ansible_connection: local`` has been deprecated. Please use ``ansible_connection: ansible.netcommon.network_cli`` instead.

Using CLI in Ansible
================================================================================
Expand All @@ -46,8 +47,8 @@ Example CLI ``group_vars/cnos.yml``

.. code-block:: yaml

ansible_connection: network_cli
ansible_network_os: cnos
ansible_connection: ansible.netcommon.network_cli
ansible_network_os: community.network.cnos
ansible_user: myuser
ansible_password: !vault...
ansible_become: yes
Expand All @@ -60,15 +61,15 @@ Example CLI ``group_vars/cnos.yml``
- If you are accessing your host directly (not through a bastion/jump host) you can remove the ``ansible_ssh_common_args`` configuration.
- If you are accessing your host through a bastion/jump host, you cannot include your SSH password in the ``ProxyCommand`` directive. To prevent secrets from leaking out (for example in ``ps`` output), SSH does not support providing passwords via environment variables.

Example CLI Task
Example CLI task
----------------

.. code-block:: yaml

- name: Retrieve CNOS OS version
cnos_command:
community.network.cnos_command:
commands: show version
when: ansible_network_os == 'cnos'
when: ansible_network_os == 'community.network.cnos'

.. include:: shared_snippets/SSH_warning.txt

Expand Down
Loading

0 comments on commit 54bee71

Please sign in to comment.