DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1

any Ansible component installed on the managed
servers, as the implementation is agentless. For network
devices, because there is limited Python support on the
devices themselves, the Python code that represents the
Ansible jobs runs locally on the control host. The control
host still uses SSH or NETCONF, RESTCONF, SNMP,
and other interfaces to connect to the network devices
and perform the desired configuration changes. Ansible
has a large number of modules that support several Cisco
operating systems, including IOS, IOS XE, IOS XR, and
NX-OS. Some of the most popular Ansible modules that
are used with Cisco devices are the following:


ios_command to send mostly show commands to devices running
IOS and IOS XE operating systems
ios_config to send configuration commands to IOS and IOS XE
devices
nxos_command and nxos_config to interact with devices running
the NX-OS operating system

Next, let’s explore a sample Ansible project. Two files are
required in order to get started with Ansible playbook
projects: an inventory file and a playbook. In the
following Ansible project, the inventory file is called
hosts, and the playbook file is called site.yml:


$ tree.
├── hosts
└── site.yml

0 directories, 2 files

The hosts file contains an inventory of all the devices that
will be managed by Ansible. For example, the hosts file
can look like this:


Click here to view code image

Free download pdf