RedHat Red Hat Certified Specialist in Developing Automation with Ansible Automation Platform - EX374 Free Exam Questions

QUESTION NO: 1
Clone a private repository using the source control credential.
Correct Answer:
ansible-playbook git_clone.yml --vault-password-file vault_pass.txt git_clone.yml:
- name: Clone repository hosts: localhost tasks:
- git:
repo: "https://github.com/private/repo.git"
dest: "~/repo"
version: "main"
key_file: "~/.ssh/id_rsa"
Explanation:
Using git module with secure credentials fetches repositories for automated deployments or configurations.
QUESTION NO: 2
Configure the inventory so that web1 has both IPv4 and IPv6 addresses and use them conditionally in a playbook.
Correct Answer:
# host_vars/web1.yml ansible_host: 192.168.1.10 ansible_ipv6_address: "2001:db8::1" Playbook:
- name: Use IPv4 or IPv6 hosts: web1
tasks:
- debug:
msg: "{{ ansible_ipv6_address if ansible_ipv6_address else ansible_host }}"
Explanation:
Defining multiple addresses and using conditional logic allows flexibility for dual-stack environments.
QUESTION NO: 3
Set up notifications for job failures in Automation Controller.
Correct Answer:
1. Navigate to Notifications and click Add.
2. Choose Type: Slack.
3. Configure Slack details and associate it with a job template.
4. Set the trigger to On Failure.
Explanation:
Notifications improve responsiveness by alerting users of job failures in real time.
QUESTION NO: 4
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.
QUESTION NO: 5
Run a playbook in an EE using Ansible Automation Controller.
Correct Answer:
1. Log in to the Automation Controller web UI.
2. Go to Execution Environments and create a new EE entry using the image registry.example.com/my_execution_env:1.0.
3. Associate the EE with a Job Template and run the playbook.
Explanation:
Configuring the EE in the Automation Controller ensures playbooks run consistently across environments.
QUESTION NO: 6
Create an inventory to manage multiple environments like staging and production.
Correct Answer:
# inventory.yml
staging:
hosts:
web1:
ansible_host: 192.168.1.11 production:
hosts:
web1:
ansible_host: 192.168.1.20
Explanation:
Environment-specific inventories simplify deployments and maintenance across diverse infrastructure setups.
QUESTION NO: 7
Configure a host db1 to use a specific username dbadmin and SSH key ~/.ssh/db_key. Ensure this is applied via host_vars.
Correct Answer:
mkdir -p host_vars
echo "ansible_user: dbadmin" > host_vars/db1.yml
echo "ansible_ssh_private_key_file: ~/.ssh/db_key" >> host_vars/db1.yml
Explanation:
Using host_vars allows granular control of variables, such as user credentials and SSH keys, for individual hosts.
QUESTION NO: 8
Use the Vault file to configure credentials for inventory hosts.
Correct Answer:
# inventory_with_vault.yml
all:
hosts:
web1:
ansible_user: "{{ ansible_user }}"
ansible_password: "{{ ansible_password }}"
Run with:
ansible-playbook site.yml --vault-password-file vault_pass.txt
Explanation:
Integrating Vault variables into inventory files ensures secure use of sensitive credentials during task execution.
QUESTION NO: 9
Use ansible_facts to display the OS distribution of web1.
Correct Answer:
- name: Display OS distribution hosts: web1
tasks:
- debug:
var: ansible_distribution
Explanation:
Ansible facts provide detailed system information, enabling tailored configurations and playbook logic.
QUESTION NO: 10
You are given access to a Git repository with the URL https://github.com/example/repo.git. Clone the repository to your local machine in the directory /home/user/projects.
Correct Answer:
cd /home/user/projects
git clone https://github.com/example/repo.git
Explanation:
Cloning a repository retrieves all files, branches, and history to your local system. The git clone command initiates this process by downloading the specified repository.
QUESTION NO: 11
Create a playbook to retrieve the last element of a list using a filter.
Correct Answer:
- name: Get last element hosts: localhost
vars:
items: [1, 2, 3, 4, 5] tasks:
- name: Display last element debug:
var: "{{ items | last }}"
Explanation:
The last filter extracts the last item from a list, simplifying operations on sequential data structures.
QUESTION NO: 12
Split a list into chunks of a specified size.
Correct Answer:
- name: Chunk list hosts: localhost vars:
items: [1, 2, 3, 4, 5, 6] tasks:
- name: Create chunks
debug:
var: "{{ items | batch(2) }}"
Explanation:
The batch filter splits a list into smaller groups of specified size, useful for parallel processing.
QUESTION NO: 13
Create an inventory in Automation Controller using a dynamic inventory script.
Correct Answer:
1. Go to Inventories and add: o Name: Dynamic Inventory
o Source: Custom Script
o Script: Upload the inventory script (e.g., idm_inventory.py).
2. Sync the inventory.
Explanation:
Dynamic inventory scripts allow fetching host information from external systems like databases or cloud platforms.
QUESTION NO: 14
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.
QUESTION NO: 15
Modify the playbook to override ansible_port for web1 in the inventory.
Correct Answer:
echo "ansible_port: 2222" >> host_vars/web1.yml
Explanation:
Overriding ansible_port at the host level ensures compatibility with non-standard SSH configurations.

QUALITY AND VALUE

Actual4test Practice Exams are written to the highest standards of technical accuracy, using only certified subject matter experts and published authors for development - no all study materials.

Tested and Approved

We are committed to the process of vendor and third party approvals. We believe professionals and executives alike deserve the confidence of quality coverage these authorizations provide.

Easy to Pass

If you prepare for the exams using our Actual4test testing engine, It is easy to succeed for all certifications in the first attempt. You don't have to deal with all dumps or any free torrent / rapidshare all stuff.

Try Before Buy

Actual4test offers free demo of each product. You can check out the interface, question quality and usability of our practice exams before you decide to buy.