RedHat EX374 Actual Free Exam Questions & Community Discussion

  • Exam Code/Number: EX374
  • Exam Name/Title: Red Hat Certified Specialist in Developing Automation with Ansible Automation Platform
  • Certification Provider: RedHat
  • Corresponding Certification: Red Hat Certified Specialist
  • Exam Questions: 300
  • Updated On: Jul 23, 2026
Create an inventory that uses AWS EC2 tags to group hosts.
Correct Answer:
plugin: aws_ec2
regions:
- us-west-2 keyed_groups:
- key: tags.Name prefix: tag_
Explanation:
Using AWS EC2 tags to group hosts allows dynamic organization of cloud resources in inventories.
Create a custom configuration for the EE in Automation Controller.
Correct Answer:
1. Navigate to Execution Environments in the Automation Controller.
2. Add a new EE entry:
o Name: Custom EE
o Image: registry.example.com/my_execution_env:1.0
3. Associate the EE with a project or job template.
Explanation:
Customizing EEs in Automation Controller allows for task-specific runtime environments.
Set up an inventory file to assign a unique hostname to a host while using a different IP address for SSH connections.
Correct Answer:
# inventory.yml
web1:
ansible_host: 192.168.1.10
hostname: web1.example.com
Explanation:
Using ansible_host for SSH and a custom variable like hostname enables flexible host identification for different use cases.
Use a loop with the lookup plugin to read multiple files into variables.
Correct Answer:
- name: Read multiple files hosts: localhost
vars:
file_paths:
- /tmp/file1.txt
- /tmp/file2.txt
tasks:
- name: Display file contents debug:
msg: "{{ lookup('file', item) }}" with_items: "{{ file_paths }}"
Explanation:
The lookup plugin and with_items loop allow bulk file processing, making playbooks versatile and reusable.
Check if a string starts with a specific prefix.
Correct Answer:
- name: Validate string prefix hosts: localhost
vars:
text: "ansible_automation" tasks:
- name: Check prefix fail:
msg: "Invalid prefix"
when: not text.startswith("ansible")
Explanation:
The startswith method ensures strings adhere to expected prefixes, enforcing naming conventions.
Use a dynamic inventory to execute a playbook on a subset of hosts.
Correct Answer:
ansible-playbook -i dynamic_inventory.py site.yml --limit web1,db1
Explanation:
Limiting playbook execution to specific hosts in a dynamic inventory provides finer control over deployments.
Verify that an EE supports a specific Ansible version.
Correct Answer:
podman run --rm my_execution_env:1.0 ansible --version
Explanation:
Checking the Ansible version inside the EE ensures compatibility with playbooks and modules requiring specific versions.
Write a playbook to display all registered variables from previous tasks.
Correct Answer:
- name: Display variables hosts: all
tasks:
- name: Run command
command: echo "Hello"
register: command_output
- debug:
var: command_output
Explanation:
The register directive stores task outputs in variables, making them accessible for subsequent tasks.
Run a playbook from the Git project in Automation Controller.
Correct Answer:
1. Create a Job Template: o Name: Run Git Playbook o Project: Git Project
o Playbook: site.yml
o Inventory: Add an appropriate inventory.
2. Save and launch the job.
Explanation:
Job templates tie playbooks to inventories and credentials, enabling consistent and repeatable automation execution.
Validate the EE configuration using Ansible Builder.
Correct Answer:
ansible-builder validate --tag my_execution_env:1.0
Explanation:
The validate command checks the EE's configuration for errors, ensuring compatibility with Ansible's execution requirements.
You need to check the current configuration settings of your Git environment. Display them.
Correct Answer:
git config --list
Explanation:
Viewing configuration settings verifies the global and repository-specific settings for consistency.
Upload the EE to Red Hat Automation Hub.
Correct Answer:
ansible-builder push --tag automation-hub.example.com/my_execution_env:1.0
Explanation:
Uploading the EE to Automation Hub allows centralized management and sharing of the environment within an organization.
0
0
0
10