EX294 Manage task execution and roles Practice Question
During a playbook execution, a task that uses the 'ansible.builtin.copy' module fails with 'Permission denied' on a remote host. The playbook runs as user 'ansible' which is a sudoer without password. Which of the following is the most likely cause and solution?
⚠ Common exam trap
A common mix-up: candidates assume 'become_user: root' alone is sufficient for privilege escalation, but Ansible requires the explicit 'become: yes' flag to activate any become method, including sudo.
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 task lacks 'become: yes' but has 'become_user: root'. Add 'become: yes' to the task.
The 'Permission denied' error occurs because the task attempts to copy a file to a location that requires root privileges, but the playbook does not use privilege escalation. The user 'ansible' is a passwordless sudoer, so adding 'become: yes' to the task enables sudo, granting the necessary permissions to write to the destination. Option C correctly identifies this missing directive.
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 remote path does not exist. Use 'remote_src: yes' to copy from remote.
Why it's wrong here
The copy module creates intermediate directories if needed; remote_src is for copying from remote to remote.
- ✗
The local source file is not readable by the user running ansible-playbook. Change permissions on the source file.
Why it's wrong here
Permission denied is on the remote host, not local.
- ✓
The task lacks 'become: yes' but has 'become_user: root'. Add 'become: yes' to the task.
Why this is correct
Without 'become: yes', become_user is ignored; adding 'become: yes' enables privilege escalation.
- ✗
The remote file is owned by root and the destination directory is not writable by ansible. Use 'become: yes' and set 'owner: ansible'.
Why it's wrong here
Setting owner is not needed if become is used; the task should write as root.
Go deeper
Related to this question
About these practice questions
This EX294 question is part of Courseiva's 520-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This EX294 practice question is part of Courseiva's free Red Hat 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 EX294 exam.