🔥 3-day streak
CompTIA Linux+ (XK0-006)7 / 123
Question 7 of 123

An Ansible playbook manages a fleet of web servers. A team member added a task that runs a shell command to regenerate a config cache. Every playbook run reports this task as 'changed', even when nothing was actually modified, which triggers an unnecessary handler that restarts the web service. Which approach BEST makes this task idempotent so it only reports 'changed' when the cache is truly rebuilt?

Reviewed for accuracy · Report an issueNext question