
[Jun 27, 2026] Fast Exam Updates EX374 dumps with PDF Test Engine Practice
Exam Valid Dumps with Instant Download Free Updates
NEW QUESTION # 69
Validate if a variable my_ip contains a valid IP address using a filter.
Answer:
Explanation:
- name: Validate IP address hosts: localhost
vars:
my_ip: "192.168.1.1" tasks:
- name: Check if IP is valid
fail:
msg: "Invalid IP address"
when: my_ip | ipaddr is not defined
Explanation:
The ipaddr filter checks if a variable contains a valid IP address, ensuring proper network data validation.
NEW QUESTION # 70
Create an advanced workflow template in Automation Controller.
Answer:
Explanation:
1. Go to Templates and create a Workflow Template.
2. Add multiple job templates in a sequential or conditional order.
Explanation:
Workflow templates orchestrate complex automation sequences, enabling multi-step operations in a single execution.
NEW QUESTION # 71
Extract the domain name from an email address using the regex_search filter.
Answer:
Explanation:
- name: Extract domain from email hosts: localhost
vars:
email: "[email protected]" tasks:
- name: Get domain debug:
var: "{{ email | regex_search('@(.*)') }}"
Explanation:
The regex_search filter allows complex string manipulation by extracting specific patterns like domains from email addresses.
NEW QUESTION # 72
Use a loop with the lookup plugin to read multiple files into variables.
Answer:
Explanation:
- 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.
NEW QUESTION # 73
Use content from Automation Hub in a playbook.
Answer:
Explanation:
- name: Use Automation Hub role hosts: all
roles:
- ansible_role_from_hub
Explanation:
Playbooks can directly use roles from Automation Hub, simplifying the inclusion of pre-built automation tasks.
NEW QUESTION # 74
Sort a list of numbers in descending order using a filter.
Answer:
Explanation:
- name: Sort numbers hosts: localhost vars:
numbers: [5, 3, 8, 1] tasks:
- name: Display sorted numbers debug:
var: "{{ numbers | sort(reverse=True) }}"
Explanation:
The sort filter orders list elements, and the reverse parameter inverts the order, enabling advanced sorting operations.
NEW QUESTION # 75
Run a command on db1 but store the results in the context of web1.
Answer:
Explanation:
- name: Store delegated results hosts: web1
tasks:
- name: Get uptime from db1
command: uptime
delegate_to: db1
register: db1_uptime
- name: Display uptime debug:
var: db1_uptime
Explanation:
The register variable captures the results of a delegated task, storing them within the current host's context for further processing.
NEW QUESTION # 76
Configure the inventory so that web1 has both IPv4 and IPv6 addresses and use them conditionally in a playbook.
Answer:
Explanation:
# 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.
NEW QUESTION # 77
Convert a list of dictionaries into a single dictionary.
Answer:
Explanation:
- name: Flatten dictionaries hosts: localhost
vars: dict_list:
- key1: value1
- key2: value2
tasks:
- name: Merge dictionaries debug:
var: "{{ dict_list | combine }}"
Explanation:
The combine filter merges a list of dictionaries into one, simplifying complex data processing tasks.
NEW QUESTION # 78
List all available EEs in the Automation Controller.
Answer:
Explanation:
1. Log in to Automation Controller.
2. Navigate to Execution Environments to view all registered EEs.
Explanation:
Viewing the list of EEs helps administrators track available environments and their configurations.
NEW QUESTION # 79
Perform a delegated task to update firewall rules on a specific host.
Answer:
Explanation:
- name: Update firewall rules hosts: web1
tasks:
- name: Add firewall rule on db1
command: firewall-cmd --add-port=8080/tcp
delegate_to: db1
Explanation:
Delegating firewall rule updates ensures secure and host-specific configurations without unnecessary context switching.
NEW QUESTION # 80
Create a CHANGELOG.md file to track changes in your collection versions.
Answer:
Explanation:
echo "# Changelog
## 1.0.0
- Initial release" > my_namespace/my_collection/CHANGELOG.md
Explanation:
Maintaining a changelog provides transparency and version history for users of the collection.
NEW QUESTION # 81
Check the metadata of an installed collection.
Answer:
Explanation:
cat ~/.ansible/collections/ansible_collections/my_namespace/my_collection/galaxy.yml
Explanation:
Viewing the metadata file confirms details such as version, author, and dependencies of an installed collection.
NEW QUESTION # 82
Split db1 variables into multiple files: db1_connection.yml and db1_settings.yml. Include connection details and custom database settings.
Answer:
Explanation:
echo "ansible_user: dbadmin" > host_vars/db1_connection.yml
echo "db_name: my_database" > host_vars/db1_settings.yml
Explanation:
Splitting variables into logical files enhances modularity and improves clarity for managing complex configurations.
NEW QUESTION # 83
Merge multiple dictionaries into one using the combine filter.
Answer:
Explanation:
- name: Merge dictionaries hosts: localhost
vars:
dict1:
key1: value1 dict2:
key2: value2
dict3:
key3: value3
tasks:
- name: Combine dictionaries debug:
var: "{{ dict1 | combine(dict2) | combine(dict3) }}"
Explanation:
The combine filter simplifies merging multiple dictionaries into a single, unified structure.
NEW QUESTION # 84
......
Download EX374 Exam Dumps PDF Q&A: https://braindumps2go.dumptorrent.com/EX374-braindumps-torrent.html