[2025年08月] 学習材料には有効なEX374効率的問題集! [Q140-Q161]

Share

[2025年08月] 学習材料には有効なEX374効率的問題集!

最新のEX374テストエンジンPDF無料問題集保証!

質問 # 140
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.


質問 # 141
Add a custom script to the EE image.

正解:

解説:
1. Create a script: echo '#!/bin/bash
echo "Custom Script"' > custom_script.sh chmod +x custom_script.sh
2. Modify the Dockerfile:
COPY custom_script.sh /usr/local/bin/custom_script
3. Rebuild the image:
podman build -t my_execution_env:1.1 -f context/Dockerfile .
Explanation:
Including custom scripts in the EE extends its functionality for specialized tasks.


質問 # 142
Set up multiple files for web1 in host_vars, splitting variables into web1_network.yml and web1_access.yml.

正解:

解説:
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.


質問 # 143
Make a file named config.txt in the cloned repository, add sample configuration details, and commit the file with the message "Add initial config".

正解:

解説:
cd /home/user/projects/repo
echo "server=127.0.0.1" > config.txt
git add config.txt
git commit -m "Add initial config"
Explanation:
New files must be staged with git add before committing. The git commit command saves the changes with a descriptive message.


質問 # 144
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.


質問 # 145
Validate the EE configuration using Ansible Builder.

正解:

解説:
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.


質問 # 146
Extract the domain name from an email address using the regex_search filter.

正解:

解説:
- 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.


質問 # 147
View the status of your local repository to determine untracked files and staged changes.

正解:

解説:
git status
Explanation:
git status shows the current state of the working directory and staging area, helping track changes.


質問 # 148
Generate a list of numbers from 1 to 10 using filters.

正解:

解説:
- name: Generate number range hosts: localhost
tasks:
- name: Create range debug:
var: "{{ range(1, 11) | list }}"
Explanation:
The range filter generates sequential numbers, useful for looping or numerical data generation.


質問 # 149
Create a credential in Automation Controller for accessing an EE registry.

正解:

解説:
1. Go to Credentials.
2. Add a credential:
o Type: Container Registry
o Registry URL: registry.example.com
o Username and password.
Explanation:
Container registry credentials ensure Automation Controller can pull EEs securely.


質問 # 150
Create a custom plugin for generating inventory.

正解:

解説:
# plugins/inventory/my_plugin.py
from ansible.plugins.inventory import BaseInventoryPlugin
class InventoryModule(BaseInventoryPlugin):
NAME = 'my_plugin'
def parse(self, inventory, loader, path, cache):
inventory.add_host('host1', group='all')
Explanation:
Custom inventory plugins allow highly tailored inventory generation for unique use cases.


質問 # 151
Set up a database query as a dynamic inventory source.

正解:

解説:
# db_inventory.py import sqlite3, json
connection = sqlite3.connect("inventory.db")
cursor = connection.cursor()
cursor.execute("SELECT hostname, ip FROM hosts")
inventory = {"all": {"hosts": {}}}
for row in cursor.fetchall():
inventory["all"]["hosts"][row[0]] = {"ansible_host": row[1]}
print(json.dumps(inventory))
Explanation:
Dynamic inventory from a database ensures inventories are generated based on up-to-date information stored in the database.


質問 # 152
Configure Automation Controller to authenticate with a private Git repository.

正解:

解説:
1. Navigate to Credentials and click Add.
2. Select Source Control as the type.
3. Enter:
o Username: git_user
o Token/Password: your_token
4. Use this credential in your Git project.
Explanation:
Adding credentials for private repositories ensures secure access while automating playbook fetching.


質問 # 153
Extract all unique keys from a dictionary using a filter.

正解:

解説:
- name: Extract dictionary keys hosts: localhost
vars:
my_dict: name: John age: 30 city: London
tasks:
- name: Get keys debug:
var: "{{ my_dict.keys() | list }}"
Explanation:
Extracting dictionary keys helps in scenarios requiring iteration or analysis of available attributes.


質問 # 154
Use ansible_facts to display the OS distribution of web1.

正解:

解説:
- name: Display OS distribution hosts: web1
tasks:
- debug:
var: ansible_distribution
Explanation:
Ansible facts provide detailed system information, enabling tailored configurations and playbook logic.


質問 # 155
Automate the update process for EEs in Automation Controller.

正解:

解説:
1. Use the awx-manage command:
awx-manage update_execution_environments --url registry.example.com/my_execution_env --username user --password pass
2. Schedule this command as a cron job.
Explanation:
Automating EE updates ensures they remain current without manual intervention, reducing maintenance overhead.


質問 # 156
Create a project in Automation Controller to pull playbooks from a Git repository.

正解:

解説:
1. Go to Projects in Automation Controller.
2. Click Add.
3. Fill in:
o Name: Git Project
o Source Control Type: Git
o Source Control URL: https://github.com/example/repo.git
4. Save and sync the project.
Explanation:
Creating a project from Git ensures that playbooks and configurations are version-controlled and automatically synchronized.


質問 # 157
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.


質問 # 158
Use a dynamic inventory to filter hosts by a specific tag.

正解:

解説:
ansible-inventory -i aws_ec2.yml --host tag_web
Explanation:
Filtering hosts by tag ensures that only the relevant resources are targeted for playbook execution.


質問 # 159
Run a playbook from the Git project in Automation Controller.

正解:

解説:
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.


質問 # 160
Analyze logs of an EE job run in Automation Controller.

正解:

解説:
1. Navigate to Jobs in Automation Controller.
2. Open the job details for the executed playbook.
3. View the logs for task outputs and errors.
Explanation:
Job logs provide insights into the execution flow and help debug issues within the EE.


質問 # 161
......

EX374問題集最新の練習テストと300独特な解答:https://jp.fast2test.com/EX374-premium-file.html

最新Red Hat Certified Specialist EX374実際の無料試験解答:https://drive.google.com/open?id=1oY_CGutaDUSJK9CY-bvn2qZx8cLhIANX


弊社を連絡する

我々は12時間以内ですべてのお問い合わせを答えます。

我々の働いている時間: ( GMT 0:00-15:00 )
月曜日から土曜日まで

サポート: 現在連絡 

English Deutsch 繁体中文 한국어