Skip to content

Automation, Orchestration, and Scripting Questions

Practice questions for Automation, Orchestration, and Scripting topic in CompTIA Linux+. 16 questions covering this domain.

16 questions4 easy8 medium4 hard
Q1
easy

What is the purpose of the shebang line `#!/bin/bash` at the very first line of a shell script?

Q2
easy

In Ansible, which file defines the list of managed hosts (IP addresses or hostnames) that playbooks are executed against?

Q3
medium

A developer needs to create a new Git branch named `feature/login` and immediately switch to it in a single command. Which command is correct?

Q4
medium

An administrator writes an Ansible playbook to install the `httpd` package on RHEL 9 target hosts. Which Ansible module should they specify for this t...

Q5
medium

A Python developer needs to isolate project dependencies from the system Python installation. Which command creates a Python virtual environment in a ...

Q6
hard

An administrator writes an Ansible playbook and needs a task to execute only when the variable `deploy_env` equals `production`. Which Ansible directi...

Q7
hard

An administrator writes a shell script that performs several critical operations and wants the script to terminate immediately if any command returns ...

Q8
medium

A bash script needs to check whether the last command executed successfully. Which special shell variable holds the exit status of the most recently e...

Q9
medium

A bash script processes a list of hostnames. Which syntax correctly defines a bash indexed array named `servers` containing three values?

Q10
hard

An administrator uses GitLab for source control and CI/CD. Which file in the repository defines the pipeline stages, jobs, and their scripts that run ...

Q11
medium

A Python developer needs to generate a `requirements.txt` file listing all packages installed in the current virtual environment for reproducible depl...

Q12
medium

An administrator needs to create a Git tag named `v2.0.0` on the current commit and push it to the remote repository. Which sequence of commands is co...

Q13
medium

In a Puppet manifest, which resource type ensures a software package is installed on a managed node?

Q14
easy

Which file format is used to write Ansible playbooks?

Q15
easy

Which Git command creates a local copy of a remote repository, including its full commit history and all branches?

Q16
hard

An administrator writes an Ansible playbook where a task needs to capture the output of a shell command and use the result in a subsequent task. Which...

Sign in to see all 16 questions

Create a free account to browse all questions — completely free during our launch phase.