350-401 Practice Question: A network engineer wants to automate configuration backups for a fleet of Cisco IOS XE…
A network engineer wants to automate configuration backups for a fleet of Cisco IOS XE devices using Ansible. The engineer uses the ios_config module with the backup: yes option and sets the backup directory via the ANSIBLE_BACKUP_DIR environment variable. After running the playbook, the engineer finds that no backup files are created on the control node. What is the most likely cause?
⚠ Common exam trap
The trap here is assuming that Ansible uses environment variables to configure module-specific options like backup directories, when in fact such options are defined within the playbook task itself.
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
✓
The ANSIBLE_BACKUP_DIR environment variable is not recognized by Ansible; the backup directory must be specified using the backup_options parameter in the task.
The ios_config module's backup feature saves the device configuration to the Ansible control node. The directory for these backups is not controlled by an environment variable like ANSIBLE_BACKUP_DIR; instead, it is set using the backup_options parameter, specifically the dir_path sub-option. Without specifying this, backups may go to a default location or fail to be created, leading to the observed issue.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The ios_config module does not support the backup option; the ios_command module must be used instead.
Why it's wrong here
ios_config does support 'backup: yes', saving the running configuration to the control node before applying changes, or on its own when no lines are given. ios_command could run 'show running-config', but it only returns the output into a variable; another task would be needed to write it to a file. So switching modules is unnecessary, and the real issue is the unsupported environment variable.
- ✗
The ios_config module requires the backup option to be set to a file path, not a boolean value.
Why it's wrong here
'backup' is a yes or no option; the location and file name are set separately with 'backup_options', using 'dir_path' and 'filename'. Setting backup to a path would fail validation rather than silently skip the backup. By default, backups are written to a 'backup' folder next to the playbook, which is where the engineer should look before setting backup_options explicitly.
- ✓
The ANSIBLE_BACKUP_DIR environment variable is not recognized by Ansible; the backup directory must be specified using the backup_options parameter in the task.
Why this is correct
Ansible does not use an environment variable named ANSIBLE_BACKUP_DIR to set the backup directory. Instead, the ios_config module provides the backup_options parameter, which includes a dir_path sub-option to specify where backups are stored. Without this, backups may be saved to a default location or not at all, depending on the Ansible version.
- ✗
The Ansible control node must have the paramiko library installed for backups to work; otherwise, backups are silently skipped.
Why it's wrong here
If the library needed for the SSH connection were missing, the task would fail with a connection error rather than silently skipping the backup. Network modules connect through network_cli, using paramiko or ansible-pylibssh. Since the playbook ran without errors, the connection worked and the backup was written, most likely to the default 'backup' folder beside the playbook.
Go deeper
Related to this question
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 →
You might also like
Similar 350-401 questions
- A network engineer is using the RESTCONF API on a Cisco IOS XE device to configure an interface. The engineer sends a PA…
- A network engineer is using the YANG Suite tool to explore YANG models on a Cisco IOS XE device. The engineer wants to r…
- A network automation team wants to programmatically configure a Cisco Catalyst 9300 switch using RESTCONF. The switch is…
- An organization uses Chef to manage network device configurations. A cookbook that configures SNMP community strings is…
- Match each QoS feature to its description.
Written and reviewed by Johnson Ajibi, MSc IT Security
Security Systems Architect · 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.