mediumMultiple Choice
350-401 Practice Question: Given the following Ansible playbook snippet: ---…
Given the following Ansible playbook snippet: --- - name: Backup running config hosts: routers gather_facts: no tasks: - name: Save config ios_config: backup: yes backup_options: dir_path: /backup/ What is the purpose of the 'backup_options' parameter?
⚠ Common exam trap
Cisco often tests the distinction between the 'backup' and 'backup_options' parameters, trapping candidates who think 'backup_options' is optional or ignored when 'backup: yes' is set, or who assume it controls the filename directly rather than the directory path.
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
✓
It specifies the directory where the backup file will be saved.
The 'backup_options' parameter in the ios_config module allows you to customize the backup behavior. Specifically, the 'dir_path' sub-option defines the directory path where the backup file will be saved. Without this parameter, the backup file is saved in the default location (the 'backup' subdirectory of the playbook's root directory). Option A correctly identifies this purpose.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
It specifies the directory where the backup file will be saved.
Why this is correct
In Ansible's Cisco IOS configuration modules (such as ios_config), the 'backup_options' parameter accepts a dictionary with a 'dir_path' key. This key determines the local filesystem directory where the configuration backup file is written when backup functionality is enabled. The filename itself is automatically generated with a timestamp, so dir_path only controls the location, not the name.
- ✗
It specifies the filename for the backup.
Why it's wrong here
The 'backup_options' dictionary does not support a 'filename' key; Ansible deliberately auto-generates backup filenames using the target device's hostname and a UTC timestamp to guarantee uniqueness across multiple runs. Setting a custom filename would require manually copying or renaming the backup after the module executes, since the native module lacks any filename override capability.
- ✗
It enables compression of the backup file.
Why it's wrong here
There is no 'compression' or 'compress' key available inside 'backup_options'; the backup is always stored as a plaintext configuration file containing the exact device running-config. If compression is a requirement, a separate task using archive or gzip must be invoked after the ios_config module completes, but backup_options itself provides no such feature.
- ✗
It is ignored because backup: yes is already set.
Why it's wrong here
'backup_options' is not ignored when 'backup: yes' is set; rather, it is an optional modifier that only takes effect in that context. The 'backup' flag merely enables the backup creation, while 'backup_options' customizes the destination directory via 'dir_path'. Setting backup_options without backup: yes would be ineffective, but when both are present, the module honors the directory specified in backup_options.
Go deeper
Related to this question
Learn chapter
BGP Fundamentals and Path Selection
Key term
Ansible for Network Automation
Ansible for Network Automation is an open-source tool that allows network engineers to automate the configuration, management, and deployment of network devices like routers and switches using simple text files instead of manual commands.
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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.