
Red Hat Certified Specialist EX374リアル試験問題と無料最新回答2026年06月09日
EX374究極な学習ガイド
質問 # 112
List the layers of an EE image to analyze its build structure.
正解:
解説:
podman history my_execution_env:1.0
Explanation:
The podman history command displays the layers of the image, helping analyze the build process and track changes across layers.
質問 # 113
Create a group load_balancers and assign two hosts lb1 and lb2 with specific variables for load balancing.
正解:
解説:
# inventory.yml load_balancers: hosts:
lb1:
ansible_host: 192.168.1.20
role: primary lb2:
ansible_host: 192.168.1.21
role: backup
Explanation:
Group-level organization combined with host-specific variables simplifies configuration for specialized roles.
質問 # 114
Create a playbook to skip tasks for hosts with ansible_distribution set to CentOS.
正解:
解説:
- name: Skip CentOS hosts: all
tasks:
- name: Run on non-CentOS debug:
msg: "This is not CentOS"
when: ansible_facts['distribution'] != "CentOS"
Explanation:
Skipping tasks based on conditions ensures compatibility and avoids unnecessary errors on unsupported hosts.
質問 # 115
Use the EE to execute a playbook that requires an external library not in the base image.
正解:
解説:
1. Update requirements.yml:
python:
- name: requests version: ">=2.25.0"
2. Rebuild the EE:
ansible-builder build --tag my_execution_env:1.1
3. Run the playbook:
podman run --rm -v $(pwd):/workspace -w /workspace my_execution_env:1.1 ansible-playbook site.yml
Explanation:
Adding external libraries ensures compatibility with modules requiring additional dependencies.
質問 # 116
Check if a variable is a list and fail if it is not.
正解:
解説:
- name: Validate list hosts: localhost
vars:
data: [1, 2, 3]
tasks:
- name: Ensure variable is a list fail:
msg: "Variable is not a list" when: data is not list
Explanation:
The is list filter ensures the data type matches expectations, preventing runtime errors.
質問 # 117
Publish the collection to Ansible Galaxy.
正解:
解説:
ansible-galaxy collection publish my_namespace-my_collection-1.0.0.tar.gz --api-key <your_galaxy_api_key>
Explanation:
The publish command uploads the collection to Ansible Galaxy, making it accessible to the community or other users.
質問 # 118
Update an installed collection to the latest version.
正解:
解説:
ansible-galaxy collection install my_namespace.my_collection --force
Explanation:
Using --force ensures the collection is reinstalled, fetching the latest version if available.
質問 # 119
Update credentials for a dynamic inventory in Automation Controller.
正解:
解説:
1. Navigate to Credentials.
2. Edit the associated credential.
3. Update the fields (e.g., username, password) and save.
Explanation:
Updating credentials ensures uninterrupted access to dynamic inventory sources, such as APIs or databases.
質問 # 120
Tag an EE image with multiple tags for versioning.
正解:
解説:
podman tag my_execution_env:1.0 registry.example.com/my_execution_env:latest podman tag my_execution_env:1.0 registry.example.com/my_execution_env:stable
Explanation:
Tagging an EE with multiple versions provides flexibility for different environments (e.g., latest, stable).
質問 # 121
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".
正解:
解説:
echo "port=8080" >> config.txt
git add config.txt
git commit -m "Add port configuration"
Explanation:
Appending to a file and committing the changes ensures version control captures the updated state, allowing tracking of incremental modifications.
質問 # 122
Run a playbook in an EE using Ansible Automation Controller.
正解:
解説:
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.
質問 # 123
Create a survey for a job template in Automation Controller.
正解:
解説:
1. Edit a job template and enable Survey.
2. Add questions to collect runtime variables.
Explanation:
Surveys allow runtime customization of playbook executions based on user inputs.
質問 # 124
Integrate a webhook with Automation Controller to trigger a job.
正解:
解説:
1. Go to Job Templates and enable Webhook.
2. Configure the webhook URL in an external system.
Explanation:
Webhooks enable external triggers for jobs, facilitating integration with CI/CD pipelines or monitoring tools.
質問 # 125
Create a playbook to stop execution after encountering an error in any task.
正解:
解説:
- name: Stop on error hosts: all
tasks:
- name: Intentional failure
command: exit 1
ignore_errors: no
Explanation:
By default, Ansible stops on errors unless ignore_errors is set to yes. This ensures errors are addressed before proceeding.
質問 # 126
Assign multiple credentials to a job template.
正解:
解説:
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.
質問 # 127
Use the ansible_user variable to run commands on web1 as a different user temporarily.
正解:
解説:
ANSIBLE_USER=root ansible-playbook -i inventory.yml playbook.yml
Explanation:
Environment variables like ANSIBLE_USER dynamically override settings for temporary executions without changing inventory files.
質問 # 128
Use a survey to capture runtime inputs for a job template.
正解:
解説:
1. Edit the job template and enable Survey.
2. Add survey questions:
o Name: Environment
o Type: Multiple Choice
o Options: Dev, Test, Prod
3. Save and launch the job.
Explanation:
Surveys provide a user-friendly way to collect runtime inputs, enabling customization of playbook execution.
質問 # 129
Gather facts for web1 but delegate the task to the control node.
正解:
解説:
- name: Gather facts on control node hosts: web1
tasks:
- name: Get system facts setup:
delegate_to: localhost
Explanation:
Delegating the setup module task to the control node ensures that facts for web1 are gathered from the control node's perspective.
質問 # 130
Filter out duplicate items from a list.
正解:
解説:
- name: Remove duplicates hosts: localhost
vars:
items: [1, 2, 2, 3, 3, 4] tasks:
- name: Unique list debug:
var: "{{ items | unique }}"
Explanation:
The unique filter removes duplicate elements, ensuring clean and distinct data.
質問 # 131
Run a task on localhost but save its output in the context of web1.
正解:
解説:
- name: Local execution with remote context hosts: web1
tasks:
- name: Execute locally
command: echo "Local task output"
delegate_to: localhost
register: local_output
- name: Display output debug:
var: local_output
Explanation:
This setup retains control node task output within the delegating host's scope, enabling contextual analysis.
質問 # 132
Replace a substring in all elements of a list.
正解:
解説:
- name: Replace substrings hosts: localhost
vars:
items: ["file_1.log", "file_2.log", "file_3.log"] tasks:
- name: Transform filenames debug:
var: "{{ items | map('regex_replace', '_', '-') | list }}"
Explanation:
The regex_replace filter applies pattern-based transformations to all elements in a list.
質問 # 133
Configure a playbook to run on a specific IP address instead of the host name defined in the inventory.
正解:
解説:
# playbook.yml
- name: Ping specific host hosts: 192.168.1.10 tasks:
- ping:
Explanation:
Specifying an IP directly overrides inventory naming, providing flexibility for ad-hoc runs or testing specific hosts.
質問 # 134
Create a .gitignore file to exclude all .log files and commit the change.
正解:
解説:
echo "*.log" > .gitignore
git add .gitignore
git commit -m "Add .gitignore to exclude log files"
Explanation:
The .gitignore file specifies patterns for files Git should ignore, preventing unnecessary files from cluttering the repository.
質問 # 135
Validate the use of a specific EE in a job execution.
正解:
解説:
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.
質問 # 136
......
究極なガイド準備EX374認定試験Red Hat Certified Specialist:https://www.goshiken.com/RedHat/EX374-mondaishu.html
リアルEX374問題集でRedHat明確な解答を試そう:https://drive.google.com/open?id=1SEPI0VLv7U5Xf6eh2lqQoEPt-YE8pzq-