Exam4Training

RedHat EX447 Red Hat Certified Specialist in Advanced Automation: Ansible Best Practices Online Training

Question #1

CORRECT TEXT

Create a file called specs.empty in home/bob/ansible on the local machine as follows:

HOST=

MEMORY=

BIOS=

VDA_DISK_SIZE=

VDB_DISK_SIZE=

Create the playbook /home/bob/ansible/specs.yml which copies specs.empty to all remote nodes’ path /root/specs.txt. Using the specs.yml playbook then edit specs.txt on the remote machines to reflect theappropriate ansible facts.

Reveal Solution Hide Solution

Correct Answer: Solution as:



Question #2

CORRECT TEXT

Create a file calledadhoc.shin/home/sandy/ansiblewhich will use adhoc commands to set up anew repository. The name of the repo will be ‘EPEL’ the description ‘RHEL8’ the baseurl is’https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rmp’there is no gpgcheck, but you should enable the repo.

* You should be able to use an bash script using adhoc commands to enable repos. Depending on your lab setup, you may need to make this repo "state=absent" after you pass this task.

Reveal Solution Hide Solution

Correct Answer: chmod0777adhoc.sh

vim adhoc.sh

#I/bin/bash

ansible all -m yum_repository -a ‘name=EPEL description=RHEL8 baseurl=https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rmp gpgcheck=no enabled=yes’

Question #3

CORRECT TEXT

Create a file calledrequirements.ymlin/home/sandy/ansible/rolesto install two roles. The source for the first role is geerlingguy.haproxy and geerlingguy.php. Name the first haproxy-role and the second php-role. The roles should be installed in /home/sandy/ansible/roles.

Reveal Solution Hide Solution

Correct Answer: in /home/sandy/ansible/roles

vim requirements.yml

Run the requirements file from the roles directory:

ansible-galaxy install -r requirements.yml -p /home/sandy/ansible/roles


Question #4

CORRECT TEXT

Create an empty encrypted file calledmyvault.yml in /home/sandy/ansibleand set the passwordtonotsafepw. Rekey the passwordtoiwejfj2221.

Reveal Solution Hide Solution

Correct Answer: ansible-vault create myvault.yml

Create new password: notsafepw Confirm password: notsafepwansible-vault rekey

myvault.yml

Current password: notsafepw New password: iwejfj2221 Confirm password: iwejfj2221

Question #5

CORRECT TEXT

Create a playbook calledwebdev.ymlin’home/sandy/ansible. The playbook will create a directory Avcbdev on dev host. The permission of the directory are 2755 and owner is webdev. Create a symbolic link from/Webdevto /var/www/html/webdev. Serve a file from Avebdev7index.html which displays the text "Development" Curlhttp://node1.example.com/webdev/index.htmlto test

Reveal Solution Hide Solution

Correct Answer: Solution as:



Exit mobile version