
Apr-2026 Realistic EX374 Exam Dumps with Accurate & Updated Questions
EX374 Exam Dumps - PDF Questions and Testing Engine
NEW QUESTION # 106
Write a galaxy.yml file for your collection with metadata like the name, version, and description.
Answer:
Explanation:
# my_namespace/my_collection/galaxy.yml namespace: my_namespace
name: my_collection
version: 1.0.0
description: My custom Ansible collection
Explanation:
The galaxy.yml file defines metadata for the collection, including its namespace, name, version, and description, ensuring it complies with Ansible Galaxy standards.
NEW QUESTION # 107
Create an advanced inventory with host-specific variables.
Answer:
Explanation:
# inventory_advanced.yml all:
hosts:
web1:
ansible_host: 192.168.1.10
http_port: 80 db1:
ansible_host: 192.168.1.20
db_port: 3306
Explanation:
Advanced inventories define host-specific variables, enabling fine-grained control over task execution.
NEW QUESTION # 108
Test if the EE has all required collections installed.
Answer:
Explanation:
podman run --rm my_execution_env:1.0 ansible-galaxy collection list
Explanation:
Listing installed collections verifies the EE contains the specified dependencies for playbook execution.
NEW QUESTION # 109
Use your custom filter in a playbook to transform text.
Answer:
Explanation:
# playbook.yml
- name: Use custom filter hosts: localhost
tasks:
- name: Transform text debug:
msg: "{{ 'ansible' | my_namespace.my_collection.my_filter }}"
Explanation:
Testing the custom filter ensures it integrates seamlessly with the collection and provides the expected output.
NEW QUESTION # 110
You need to revert the last commit on the main branch without removing the changes locally. Revert the commit.
Answer:
Explanation:
git revert HEAD
Explanation:
Reverting creates a new commit that undoes the changes made by the specified commit, maintaining the repository's integrity.
NEW QUESTION # 111
Integrate an EE with a specific project in Automation Controller.
Answer:
Explanation:
1. Go to Projects in Automation Controller.
2. Edit the project and assign the custom EE (registry.example.com/my_execution_env:1.0).
3. Save and test the integration with a Job Template.
Explanation:
Associating projects with specific EEs ensures tasks run in a controlled environment tailored to project requirements.
NEW QUESTION # 112
Run a delegated task to back up a database on a different host.
Answer:
Explanation:
- name: Backup database hosts: web1
tasks:
- name: Run backup on db1
command: mysqldump -u root -p mydb > /tmp/mydb.sql
delegate_to: db1
Explanation:
Delegating database backups ensures the task is executed directly on the database server, reducing network overhead.
NEW QUESTION # 113
Set up multiple files for web1 in host_vars, splitting variables into web1_network.yml and web1_access.yml.
Answer:
Explanation:
echo "ansible_host: 192.168.1.10" > host_vars/web1_network.yml
echo "ansible_user: admin" > host_vars/web1_access.yml
Explanation:
Dividing host variables into multiple files improves modularity, making complex configurations easier to manage.
NEW QUESTION # 114
Use the Vault file to configure credentials for inventory hosts.
Answer:
Explanation:
# 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.
NEW QUESTION # 115
Test the inventory in Automation Controller.
Answer:
Explanation:
1. Select the inventory in Automation Controller.
2. Click Sync to fetch the latest data from the dynamic source.
Explanation:
Sync tests validate the integration of dynamic inventories in Automation Controller.
NEW QUESTION # 116
Validate the configuration of group_vars for web_servers.
Answer:
Explanation:
ansible-inventory -i inventory.yml --graph
Explanation:
ansible-inventory --graph displays the host and group hierarchy, confirming the correct application of variables.
NEW QUESTION # 117
Validate the use of a specific EE in a job execution.
Answer:
Explanation:
1. Launch a job template using the EE.
2. Check the job output logs for the EE image used:
o Look for: Using Execution Environment: registry.example.com/my_execution_env:latest.
Explanation:
Validating the EE ensures that the job uses the correct runtime with the required dependencies.
NEW QUESTION # 118
Create a plugin directory in your collection and add a custom module.
Answer:
Explanation:
mkdir -p my_namespace/my_collection/plugins/modules echo -e "#!/usr/bin/python
print('Hello, world!')" > my_namespace/my_collection/plugins/modules/hello.py chmod +x my_namespace/my_collection/plugins/modules/hello.py
Explanation:
Adding a custom module extends the collection's functionality, allowing users to implement specific operations.
NEW QUESTION # 119
Create an inventory in Automation Controller using a dynamic inventory script.
Answer:
Explanation:
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.
NEW QUESTION # 120
Find the longest string in a list using filters.
Answer:
Explanation:
- name: Find longest string hosts: localhost
vars:
strings: ["ansible", "automation", "platform"]
tasks:
- name: Display longest string debug:
var: "{{ strings | max(attribute='length') }}"
Explanation:
The max filter identifies the largest or longest element in a list based on a specified attribute.
NEW QUESTION # 121
Set up a directory for multiple host variable files for all managed hosts.
Answer:
Explanation:
mkdir -p host_vars
echo "ansible_user: admin" > host_vars/web1.yml
echo "ansible_user: root" > host_vars/db1.yml
Explanation:
Organizing host_vars ensures clarity when managing unique configurations for multiple hosts.
NEW QUESTION # 122
Assign multiple credentials to a job template.
Answer:
Explanation:
1. Open the job template.
2. Under Credentials, add:
o Machine credentials for host access.
o Source control credentials for pulling playbooks.
3. Save the template and run.
Explanation:
Assigning multiple credentials allows playbooks to access multiple resources, such as repositories and managed hosts.
NEW QUESTION # 123
......
Pass RedHat EX374 Exam Quickly With GuideTorrent: https://examcollection.guidetorrent.com/EX374-dumps-questions.html