Automation, Orchestration, and Scripting Questions
Practice questions for Automation, Orchestration, and Scripting topic in CompTIA Linux+. 16 questions covering this domain.
What is the purpose of the shebang line `#!/bin/bash` at the very first line of a shell script?
In Ansible, which file defines the list of managed hosts (IP addresses or hostnames) that playbooks are executed against?
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?
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...
A Python developer needs to isolate project dependencies from the system Python installation. Which command creates a Python virtual environment in a ...
An administrator writes an Ansible playbook and needs a task to execute only when the variable `deploy_env` equals `production`. Which Ansible directi...
An administrator writes a shell script that performs several critical operations and wants the script to terminate immediately if any command returns ...
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...
A bash script processes a list of hostnames. Which syntax correctly defines a bash indexed array named `servers` containing three values?
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 ...
A Python developer needs to generate a `requirements.txt` file listing all packages installed in the current virtual environment for reproducible depl...
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...
In a Puppet manifest, which resource type ensures a software package is installed on a managed node?
Which file format is used to write Ansible playbooks?
Which Git command creates a local copy of a remote repository, including its full commit history and all branches?
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.