CompTIA Linux+ Practice Questions: Automation

7 free, exam-style CompTIA Linux+ (XK0-006) practice questions covering Automation, each with the correct answer and an explanation. Start a timed exam below, or scroll on to read through the questions.

🧠

Mini Exam

25 Questions · 50 minutes

Start Quiz 🚀
🏆

Mock Linux+ Exam

85 Questions · 165 minutes

Start Quiz 🚀
📅

Daily Quiz

10 Questions · 20 minutes

Start Quiz 🚀
🎯

Standard Practice

50 Questions · 100 minutes

Start Quiz 🚀

Automation practice questions

Answers and explanations are shown. Take the timed exam above to test yourself first.

Q1. Which Ansible module copies files to remote hosts?

  • A.copy✓ Correct
  • B.file
  • C.template
  • D.fetch
Explanation: copy module transfers files from control node to managed nodes. Learn more.

Q2. Which Ansible playbook directive executes tasks?

  • A.tasks:✓ Correct
  • B.handlers:
  • C.vars:
  • D.roles:
Explanation: tasks: section contains playbook operations. Learn more.

Q3. Which command tests Ansible inventory connectivity?

  • A.ansible ping✓ Correct
  • B.ansible-test
  • C.ansible ad-hoc
  • D.ansible-console
Explanation: ansible -m ping all checks host reachability. Learn more.

Q4. Which directory contains Ansible playbooks by convention?

  • A./etc/ansible✓ Correct
  • B.~/ansible
  • C./usr/share/ansible
  • D./var/lib/ansible
Explanation: /etc/ansible is default configuration directory. Learn more.

Q5. Which command schedules recurring jobs for a user?

  • A.crontab✓ Correct
  • B.journalctl
  • C.passwd
  • D.hostnamectl
Explanation: crontab manages recurring scheduled commands for users. Learn more.

Q6. Which systemd unit type is paired with a service unit to run a job on a schedule?

  • A.Socket only
  • B.Target only
  • C.Timer✓ Correct
  • D.Mount
Explanation: A .timer unit defines when systemd activates its associated .service unit and can replace many cron-style schedules. Learn more.

Q7. What does idempotence mean for an Ansible playbook?

  • A.Every run must reboot the host
  • B.Tasks always produce different output
  • C.The playbook can manage only one server
  • D.Repeated runs converge on the same desired state✓ Correct
Explanation: Idempotent tasks change a system only when necessary, so repeated playbook runs leave an already compliant host in the same desired state. Learn more.

More CompTIA Linux+ practice topics

Keep studying CompTIA Linux+

Full CompTIA Linux+ practice exam · CompTIA Linux+ study guide · All CompTIA practice questions

Last updated