CCNP Ansible Automation • Complete Question Bank
Complete CCNP Ansible Automation question bank — all 0 questions with answers and detailed explanations.
A network engineer writes the following Ansible playbook to configure an interface on a Cisco IOS-XE device:
--- - hosts: routers gather_facts: no tasks: - name: Configure interface cisco.ios.ios_config: lines: - ip address 192.168.1.1 255.255.255.0 parents: interface GigabitEthernet0/1
What is the issue with this playbook?
A Python script using Netmiko is written to send a command to a Cisco router:
from netmiko import ConnectHandler
device = { 'device_type': 'cisco_ios', 'ip': '192.168.1.1', 'username': 'admin', 'password': 'cisco', 'secret': 'enable'
}
connection = ConnectHandler(**device) connection.enable() output = connection.send_command('show ip interface brief')
print(output)
connection.disconnect()
What is the potential issue with this script?
A REST API call is made to Cisco DNA Center to get the list of network devices:
GET /dna/intent/api/v1/network-device Headers: X-Auth-Token: <token>
The response is:
{
"response": [
{
"id": "123456",
"managementIpAddress": "10.10.10.1",
"platformId": "C9300-24P",
"role": "ACCESS"
}
],
"version": "1.0"
}What does this response indicate?
An Ansible playbook uses the cisco.nxos.nxos_config module to configure a Nexus switch:
--- - hosts: nxos_switches gather_facts: no connection: network_cli tasks: - name: Configure VLAN cisco.nxos.nxos_config: lines: - vlan 100 - name Test_VLAN parents: vlan 100
What will be the result of this playbook?
A Python script uses NAPALM to retrieve the ARP table from a Cisco IOS-XE device:
from napalm import get_network_driver
driver = get_network_driver('ios') device = driver('192.168.1.1', 'admin', 'cisco') device.open() arp_table = device.get_arp_table()
print(arp_table)
device.close()
What is the issue with this script?
A RESTCONF request is sent to a Cisco IOS-XE device to retrieve interface statistics:
GET /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1 Accept: application/yang-data+json
Response:
{"ietf-interfaces:interface": [
{
"name": "GigabitEthernet1",
"type": "iana-if-type:ethernetCsmacd",
"enabled": true,"ietf-ip:ipv4": {
"address": [
{
"ip": "192.168.1.1",
"netmask": "255.255.255.0"
}
]
}
}
]
}What does the response indicate about the interface?
An Ansible playbook uses the uri module to make a REST API call to Cisco DNA Center:
--- - hosts: localhost gather_facts: no tasks: - name: Get devices uri: url: "https://dna-center/api/v1/network-device" method: GET headers: X-Auth-Token: "{{ token }}" return_content: yes register: result
- debug: var: result.json
What is missing from this playbook?
A telemetry subscription is configured on a Cisco IOS-XE device using gRPC dial-out:
telemetry ietf subscription 101 encoding encode-kvgpb filter xpath /interfaces/interface/statistics stream yang-push update-policy periodic 500 receiver ip address 10.10.10.10 50001 protocol grpc-tcp
What does this configuration do?
A Python script uses the requests library to interact with Cisco DNA Center's REST API:
import requests
url = "https://dna-center/api/v1/network-device" headers = {
"X-Auth-Token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..." }
response = requests.get(url, headers=headers, verify=False)
print(response.json())
What is a security concern with this script?