Ready to Pass Your Certification Test

Ready to guarantee a pass on the certification that will elevate your career? Visit this page to explore our catalog and get the questions and answers you need to ace the test.

Exam contains 300 questions

Page 4 of 50
Question 19 🔥

You need to check the current configuration settings of your Git environment. Display them. ee the Solution below. Solution: git config --list Explanation: Viewing configuration settings verifies the global and repository-specific settings for consistency.

Question 20 🔥

Create an inventory file inventory.yml with a host web1 and a group web_servers. Assign the variable ansible_user as admin for web1. ee the Solution below. Solution: # inventory.yml all: children: web_servers:hosts: web1: ansible_user: admin Explanation: The inventory file assigns variables like ansible_user for specific hosts or groups. This configuration defines web1 under the web_servers group with admin as the remote user.

Question 21 🔥

Create a directory structure where host variables for web1 are stored in host_vars/web1.yml and group variables for web_servers in group_vars/

Question 22 🔥

Set up a playbook to display ansible_user for web1 using the inventory from inventory.yml. ee the Solution below. Solution: # playbook.yml - name: Display ansible_user hosts: web1 tasks: - debug: var: ansible_user Execution: ansible-playbook -i inventory.yml playbook.yml Explanation:The debug module helps display variable values, verifying the correct assignment of ansible_user from the inventory.

Question 23 🔥

Override the SSH port for web1 in the host_vars/web1.yml file. ee the Solution below. Solution: echo "ansible_port: 2222" >> host_vars/web1.yml Explanation: The ansible_port variable specifies the SSH port for a host. Adding it to host_vars ensures the override is host-specific.

Question 24 🔥

You are given access to a Git repository with the URL https://github.com/example/repo.git. Clone the repository to your local machine in the directory /home/user/projects. ee the Solution below. Solution: cd /home/user/projects git clone https://github.com/example/repo.git Explanation: Cloning a repository retrieves all files, branches, and history to your local system. The git clone command initiates this process by downloading the specified repository.

Lorem ipsum dolor sit amet consectetur. Eget sed turpis aenean sit aenean. Integer at nam ullamcorper a.

© 2024 Exam Prepare, Inc. All Rights Reserved.