CCNP Automation Practice Question
A network administrator is new to automation and wants to start using Ansible to manage a group of Cisco IOS XE switches. The administrator has installed Ansible on a Linux control node and created an inventory file listing the switches. The administrator now needs to create a playbook that will gather facts from the switches and display them. Which Ansible module should the administrator use in the playbook to collect operational facts from the Cisco IOS XE devices?
⚠ Common exam trap
The trap here is assuming that the generic setup module works for network devices, but it only works for Linux/Unix hosts; network devices require vendor-specific fact modules.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
ios_facts
Ansible provides platform-specific modules for network devices. For Cisco IOS XE, the ios_facts module is designed to collect a wide range of operational facts, such as version, interfaces, and hardware. It returns structured data that can be used in playbooks. This module is the standard way to gather facts from IOS XE devices without manual parsing.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
ios_facts
Why this is correct
The ios_facts module is specifically designed to collect facts from Cisco IOS devices, including IOS XE. It gathers information such as hostname, version, interfaces, and hardware details. Using this module, the administrator can retrieve operational data and display it using the debug or other output mechanisms. It is the correct choice for fact gathering on Cisco IOS XE platforms.
- ✗
ios_config
Why it's wrong here
The ios_config module is used to manage configuration lines on IOS devices, such as applying ACLs or interface settings. It is not intended for gathering facts. Using it to collect operational data would be ineffective and could inadvertently change configurations. The administrator needs a read-only module for facts, so ios_config is incorrect.
- ✗
ios_command
Why it's wrong here
The ios_command module is used to execute arbitrary operational commands on IOS devices and return the output. While it can be used to run show commands, it does not automatically gather structured facts. The administrator would have to manually parse the output. For fact gathering, ios_facts is the purpose-built module that returns structured data.
- ✗
setup
Why it's wrong here
The setup module is a generic Ansible module that gathers facts from Linux hosts, not network devices. It runs on the target host and collects system information. For Cisco IOS XE devices, which are network appliances, the setup module is not applicable. The administrator must use a network-specific module like ios_facts to retrieve device facts.
About these practice questions
One of 1,923 original 350-401 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Cisco exam blueprint
This 350-401 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 350-401 exam.