EMT Practice Test

1. Question Content...


Question List

Question1: Use advanced inventory variables in a playbook.

Question2: Override the SSH port for web1 in the host_vars/web1.yml file.

Question3: Generate a list of numbers from 1 to 10 using filters.

Question4: Validate the EE configuration using Ansible Builder.

Question5: Create a playbook to run only tasks tagged as install.

Question6: Use group variables in a playbook to configure web servers.

Question7: Convert a list of dictionaries into a single dictionary.

Question8: Test the inventory in Automation Controller.

Question9: Push the EE image to a private container registry.

Question10: Sort a dictionary by its keys using a filter and display the result.

Question11: Use a source control credential in a project in Automation Controller.

Question12: Upload the EE to Red Hat Automation Hub.

Question13: You are asked to pull the latest changes from the main branch of the remote repository into your local branch. Perform this operation.

Question14: Transform a list of strings to uppercase using a filter and display the result.

Question15: Test the webserver role from the collection using ansible-playbook.

Question16: Set up a directory for multiple host variable files for all managed hosts.

Question17: Use delegation to upload a file to an S3 bucket from the control node.

Question18: Verify that an EE supports a specific Ansible version.

Question19: Gather facts for web1 but delegate the task to the control node.

Question20: Set up multiple files for web1 in host_vars, splitting variables into web1_network.yml and web1_access.yml.

Question21: Use a survey to capture runtime inputs for a job template.

Question22: You need to revert the last commit on the main branch without removing the changes locally. Revert the commit.

Question23: Trigger a playbook run using the Automation Controller API.

Question24: Automate inventory updates with a cron job.

Question25: Check if a variable is a list and fail if it is not.

Question26: Sync dynamic inventory with Automation Controller.

Question27: Set up notifications for job completions in Automation Controller.

Question28: Use ansible_facts to display the OS distribution of web1.

Question29: Use ansible-inventory to validate the syntax of your static inventory.

Question30: Run a delegated task to back up a database on a different host.

Question31: Create a custom plugin for generating inventory.

Question32: Split a string into a list of words using a filter.

Question33: Check if a string starts with a specific prefix.

Question34: Validate the EE used in a job template.

Question35: Pull an EE from Automation Hub and use it in Automation Controller.

Question36: Create an advanced inventory that includes both static and dynamic sources.

Question37: Write a playbook to check if a string is alphanumeric.

Question38: Test if the EE has all required collections installed.

Question39: Test the connectivity of managed nodes from within the EE.

Question40: Test the machine credentials by connecting to a host.

Question41: Configure Automation Controller to authenticate with a private Git repository.

Question42: Validate the configuration of group_vars for web_servers.

Question43: Validate if a given variable contains a valid MAC address using a filter.

Question44: Run a playbook with a different Ansible configuration file in an EE.

Question45: Convert all keys in a dictionary to uppercase.

Question46: Write a playbook to execute tasks on a host only if the variable http_port is defined.

Question47: Stash uncommitted changes to the feature-update branch temporarily.

Question48: Add a group variable in an advanced inventory.

Question49: Configure a playbook to fail if the http_port variable is undefined for a host.

Question50: Analyze logs of an EE job run in Automation Controller.

Question51: Build the execution environment image using Podman.

Question52: Create a playbook that retrieves the value of http_port for all web_servers.

Question53: Create a static inventory with groups web and db, each containing two hosts.

Question54: You realize you need to modify the config.txt file to add a new configuration port=8080. Update the file and commit with the message "Add port configuration".

Question55: Assign multiple EEs to a project in Automation Controller.

Question56: Set up a CI/CD pipeline to build and upload an EE.

Question57: Sort a list of numbers in descending order using a filter.

Question58: Create a playbook to compute the sum of a list of numbers.

Question59: Test Automation Controller integration with Automation Hub.

Question60: Configure Automation Controller to use custom inventory scripts.

Question61: Sync an AWS EC2 inventory plugin in Automation Controller.

Question62: Create a playbook to dynamically fetch and use host variables.

Question63: Add a custom script to the EE image.

Question64: Deploy an EE to Kubernetes for distributed execution.

Question65: Retrieve and display a list of available files in a directory using the lookup plugin.

Question66: Add documentation for your collection in a README.md file.

Question67: Create an inventory that uses AWS EC2 tags to group hosts.

Question68: Write a playbook to run a task as a non-root user and use become to escalate privileges for that task.

Question69: Use failed_when to define custom failure conditions for a task.

Question70: Validate if a string matches a specific regular expression.

Question71: Install the collection locally from the .tar.gz file.

Question72: Filter a list of dictionaries to include only those with a specific key-value pair.

Question73: Test a custom inventory plugin.

Question74: Set up an inventory where web1 and web2 belong to staging, while web3 belongs to production. Assign http_port as 8080 for staging.

Question75: Update an installed collection to the latest version.

Question76: Configure a playbook to use the inventory IP address directly and verify connectivity.

Question77: Write a playbook to execute a task based on a host's operating system version.

Question78: Extract all IP addresses from a list containing mixed data using a filter.

Question79: Find the longest string in a list using filters.

Question80: Use lookup with with_items to iterate over multiple external files.

Question81: Use a special variable to set a different remote user for web1 when executing a playbook.

Question82: Split db1 variables into multiple files: db1_connection.yml and db1_settings.yml. Include connection details and custom database settings.

Question83: Run a playbook on web1 with a specific ansible_connection type.

Question84: Write a playbook to populate a variable with the output of a command using the lookup plugin.

Question85: Secure the database credentials using Ansible Vault.

Question86: Create a directory structure where host variables for web1 are stored in host_vars/web1.yml and group variables for web_servers in group_vars/
web_servers.yml.

Question87: Push your changes from the feature-update branch to the remote repository.

Question88: Configure a playbook to dynamically retrieve the ansible_host variable of a host and display it.

Question89: Write a playbook to sort a dictionary by its values.

Question90: Set up web2 to use a proxy server for all Ansible tasks.

Question91: Extract all subnets from a list of CIDR notations using a filter.

Question92: Set up multiple environment inventories (dev and prod) with shared group variables.

Question93: Inspect the logs of an EE build process.

Question94: Set up a cron job to sync a dynamic inventory script periodically.

Question95: A teammate accidentally pushed sensitive data to the repository. Use an interactive rebase to remove the commit containing the sensitive data.

Question96: Run a command on the control node but store the result in the context of a managed host.

Question97: Validate the AWS inventory plugin.

Question98: Create a playbook to conditionally execute a task based on the presence of a file /tmp/example.

Question99: Set up a database query as a dynamic inventory source.

Question100: Configure a host db1 to use a specific username dbadmin and SSH key ~/.ssh/db_key. Ensure this is applied via host_vars.

Question101: Use delegation to restart a service on a specific host (db1) from a different host.

Question102: Create a directory structure for building an execution environment (EE).

Question103: Retrieve data from an environment variable using lookup.

Question104: Make a file named config.txt in the cloned repository, add sample configuration details, and commit the file with the message "Add initial config".

Question105: Configure the inventory so that web1 has both IPv4 and IPv6 addresses and use them conditionally in a playbook.

Question106: Run a playbook with custom variables passed at runtime in Automation Controller.

Question107: Test if the EE has the required Python packages installed.

Question108: Publish the collection to a private Automation Hub repository.

Question109: Configure your Git username as Developer and email as [email protected] globally.

Question110: Clone a private repository using the source control credential.

Question111: Extract all lines from a file that match a given string using the lookup plugin and regex_search.

Question112: Use the lookup plugin to read multiple lines from a file into a list.

Question113: Retrieve the hostname of a managed node using the ansible_hostname fact and display it.

Question114: Configure db1 to use a specific shell for commands via a host variable.

Question115: Create a playbook to skip tasks for hosts with ansible_distribution set to CentOS.

Question116: Write a test playbook to call the custom module hello.py.

Question117: Add dependencies to your collection's galaxy.yml file, such as requiring the community.general collection.

Question118: Fetch the latest updates from the remote repository without merging them.

Question119: Merge the feature-update branch into the main branch to integrate the changes.

Question120: Automate the update process for EEs in Automation Controller.

Question121: Write a Dockerfile for building the EE.

Question122: Create an inventory plugin configuration for AWS.

Question123: Run a task on a different host than the one defined in the inventory using delegate_to.