CCNP Automation Practice Question
A network engineer is using Ansible to manage a fleet of Cisco IOS XE devices. The playbook uses the 'ios_config' module to push a set of configuration lines. After running the playbook, the engineer notices that the configuration changes are not being saved to the startup configuration, and the devices revert to the previous configuration after a reboot. Which parameter should be added to the 'ios_config' task to ensure the running configuration is saved to the startup configuration?
⚠ Common exam trap
The trap here is assuming that any configuration change automatically saves to startup, or confusing backup and diff parameters with saving the configuration.
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
✓
save_when: always
The 'save_when' parameter with the value 'always' forces the ios_config module to save the running configuration to the startup configuration after every change. This ensures that configuration persists across reboots. Other parameters like 'backup', 'diff_against', and 'replace' serve different purposes and do not save the configuration. Thus, 'save_when: always' is the correct solution.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
diff_against: startup
Why it's wrong here
The 'diff_against' parameter is used to compare the running configuration against a specified source, such as 'startup' or 'intended', to generate a diff. It does not save the configuration. It is used for reporting differences, not for persisting changes. Thus, it does not address the issue.
- ✗
replace: config
Why it's wrong here
The 'replace' parameter determines how configuration lines are merged or replaced. Setting it to 'config' would replace the entire configuration, which is dangerous and not related to saving to startup. It does not save the running configuration. Therefore, it is incorrect for this scenario.
- ✗
backup: yes
Why it's wrong here
The 'backup' parameter creates a backup of the current running configuration on the Ansible control node before making changes. It does not save the configuration to the device's startup configuration. While useful for rollback, it does not solve the persistence problem. Therefore, it is not the correct choice here.
- ✓
save_when: always
Why this is correct
The 'save_when' parameter in the ios_config module controls when the running configuration is saved to the startup configuration. Setting it to 'always' ensures that after any configuration change, the running config is saved. This directly addresses the issue of changes not persisting after reboot. It is the correct parameter to use.
About these practice questions
Courseiva writes every 350-401 question from scratch — 1,923 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.