시험덤프
매달, 우리는 1000명 이상의 사람들이 시험 준비를 잘하고 시험을 잘 통과할 수 있도록 도와줍니다.
  / EX374 덤프  / EX374 문제 연습

RedHat EX374 시험

Red Hat Certified Specialist in Developing Automation with Ansible Automation Platform exam 온라인 연습

최종 업데이트 시간: 2025년06월06일

당신은 온라인 연습 문제를 통해 RedHat EX374 시험지식에 대해 자신이 어떻게 알고 있는지 파악한 후 시험 참가 신청 여부를 결정할 수 있다.

시험을 100% 합격하고 시험 준비 시간을 35% 절약하기를 바라며 EX374 덤프 (최신 실제 시험 문제)를 사용 선택하여 현재 최신 300개의 시험 문제와 답을 포함하십시오.

 / 4

Question No : 1


Set up an inventory file to assign a unique hostname to a host while using a different IP address for SSH connections.

정답: # inventory.yml
web1:
ansible_host: 192.168.1.10
hostname: web1.example.com
Explanation:
Using ansible_host for SSH and a custom variable like hostname enables flexible host identification for different use cases.

Question No : 2


Write a playbook to verify if all hosts in the staging group have an accessible HTTP port (http_port).

정답: - name: Verify HTTP port hosts: staging
tasks:
- debug:
msg: "Host {{ inventory_hostname }} is using HTTP port {{ http_port }}"
Explanation:
Playbooks accessing group variables verify configurations, such as application ports, across a group.

Question No : 3


Create a custom directory for inventory files and use it during a playbook execution.

정답: mkdir -p custom_inventory
echo "[web_servers]" > custom_inventory/inventory.ini
echo "web1 ansible_host=192.168.1.10" >> custom_inventory/inventory.ini ansible-playbook -i custom_inventory playbook.yml
Explanation:
Custom inventory directories organize host definitions for easier management, especially in large-scale deployments.

Question No : 4


Override the default SSH connection type for a host in the inventory to use paramiko.

정답: echo "ansible_connection: paramiko" > host_vars/web1.yml
Explanation:
The ansible_connection variable specifies the connection backend, useful for handling specific infrastructure constraints.

Question No : 5


Configure the inventory so that web1 has both IPv4 and IPv6 addresses and use them conditionally in a playbook.

정답: # 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 : 6


Set up an inventory where web1 and web2 belong to staging, while web3 belongs to production. Assign http_port as 8080 for staging.

정답: # inventory.yml
staging:
hosts:
web1:
web2:
vars:
http_port: 8080
production:
hosts:
web3:
Explanation:
Group-level variables apply uniformly to all hosts within a group, ensuring consistent configurations across environments.

Question No : 7


Configure a playbook to dynamically retrieve the ansible_host variable of a host and display it.

정답: # playbook.yml
- name: Retrieve ansible_host hosts: web1
tasks:
- debug:
var: ansible_host
Explanation:
Dynamic variable retrieval helps validate host-level settings such as IP addresses or DNS names.

Question No : 8


Split db1 variables into multiple files: db1_connection.yml and db1_settings.yml. Include connection details and custom database settings.

정답: 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.

Question No : 9


Create a playbook to override the default inventory SSH port by using a special variable at runtime.

정답: # playbook.yml
- name: Test connection with overridden SSH port hosts: web1
tasks:
- ping:
Execution:
ansible-playbook -i inventory.yml playbook.yml -e "ansible_port=2022"
Explanation:
Passing ansible_port as an extra variable ensures runtime overrides without altering the inventory.

Question No : 10


Configure a host db1 to use a specific username dbadmin and SSH key ~/.ssh/db_key. Ensure this is applied via host_vars.

정답: 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 : 11


Set up an inventory file to manage hosts using different SSH keys.

정답: # host_vars/web1.yml
ansible_ssh_private_key_file: ~/.ssh/web1_key
Explanation:
Defining ansible_ssh_private_key_file ensures secure, host-specific authentication, vital for multi-host environments.

Question No : 12


Use ansible_inventory to display host-specific variables.

정답: ansible-inventory -i inventory.yml --host web1
Explanation:
This command retrieves detailed information about host variables, verifying correctness and debugging issues.

Question No : 13


Create an inventory to manage multiple environments like staging and production.

정답: # 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 : 14


Override the default user for all hosts in the web_servers group.

정답: echo "ansible_user: webadmin" > group_vars/web_servers.yml
Explanation:
Defining group-level variables overrides individual host settings, ensuring uniformity across similar hosts.

Question No : 15


Run a playbook on web1 with a specific ansible_connection type.

정답: # host_vars/web1.yml ansible_connection: ssh
Explanation:
The ansible_connection variable defines the protocol for communicating with hosts, useful for automation adjustments.

 / 4