Skip to main content

EX447 Real Exam Questions

Red Hat Certified Specialist in Advanced Automation: Ansible Best Practices

26 questions available · Page 1 of 3

Updated Exam DumpsVerified AnswersPass Guarantee

Get Complete Exam Dumps
Question 1 Lab simulation

FILL BLANK

Install and configure ansible

User sandy has been created on your control node with the appropriate permissions already, do not change or modify ssh keys. Install the necessary packages to run ansible on the control node. Configure ansible.cfg to be in folder /home/sandy/ansible/ansible.cfg and configure to access remote machines via the sandy user. All roles should be in the path /home/sandy/ansible/roles. The inventory path should be in /
home/sandy/ansible/invenlory.

You will have access to 5 nodes. node1.example.com

node2.example.com

node3.example.com

node4.example.com

node5.example.com

Configure these nodes to be in an inventory file where node I is a member of group dev. nodc2 is a member of group test, node3 is a member of group proxy, nodc4 and node 5 are members of group prod.
Also, prod is a member of group webservers.

Show answer and explanation

In/home/sandy/ansible/ansible.cfg
[defaults] inventory=/home/sandy/ansible/inventory
roles_path=/home/sandy/ansible/roles
remote_user= sandy
host_key_checking=false
[privilegeescalation]
become=true
become_user=root
become_method=sudo
become_ask_pass=false

In /home/sandy/ansible/inventory
[dev]
node1 .example.com
[test]
node2.example.com
[proxy]
node3 .example.com
[prod]
node4.example.com
node5 .example.com
[webservers:children]
prod

Question 2 Lab simulation

FILL BLANK

Create a playbook /home/bob/ansible/timesync.yml that runs on hosts in the webservers host group and does the following:

Uses thetimesync RHEL system role.
Sets the ntp server to 0.uk.pool.ntp.org Sets the timezone to UTC

Show answer and explanation

Solution as:

Question 3 Lab simulation

FILL BLANK

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.

Show answer and explanation

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 Lab simulation

FILL BLANK

Create the users in the fileusersjist.ymlfile provided. Do this in a playbook called users.yml located at/ home/sandy/ansible.The passwords for these users should be set using thelock.ymlfile from TASK7. When running the playbook, the lock.yml file should be unlocked withsecret.txtfile from TASK 7.

All users with the job of 'developer' should be created on thedevhosts, add them to the group devops, their password should be set using thepw_devvariable. Likewise create users with the job of 'manager' on theproxyhost and add the users to the group 'managers', their password should be set using thepw_mgrvariable.

Show answer and explanation

ansible-playbook users.yml ault-password-file=secret.txt

Question 5 Lab simulation

FILL BLANK

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

Show answer and explanation

Solution as:

Question 6 Lab simulation

FILL BLANK
Create an ansible vault password file calledlock.ymlwith the passwordreallysafepwin the /home/sandy/ ansibledirectory. In the lock.yml file define two variables. One ispw_devand the password is 'dev' and the other ispw_mgrand the password is 'mgr' Create a regular file calledsecret.txtwhich contains the password for lock.yml.

Show answer and explanation

ansible-vault create lock.yml
New Vault Password: reallysafepw
Confirm: reallysafepw

Question 7 Lab simulation

FILL BLANK

Create a role called sample-apache and store it in /home/bob/ansible/roles. The role should

satisfy the following requirements:

In the role, install and enable httpd. Also enable the firewall to allow http. Also run the template index.html.j2 and make sure this runs Create a template index.html.j2that displays "Welcome to the server HOSTNAME"

In a play called apache.yml in /home/bob/ansible/ run the sample-apache role.

Show answer and explanation

/home/sandy/ansible/apache.yml

/home/sandy/ansible/roles/sample-apache/tasks/main.yml

/home/sandy/ansible/roles/sample-apache/templates/index.html.j2

In /home/sandy/ansible/roles/sample-apache/handlers/main.yml

Question 8 Lab simulation

FILL BLANK

Create a playbookthatchanges the default target onallnodes tomulti-usertarqet. Do this in playbook file called target.yml in /home/sandy/ansible

Show answer and explanation

- name: change default target
hosts: all
tasks:
- name: change target
file:
src:/usr/lib/systemd/system/multi-user.target dest: /etc/systemd/system/default.target state:
link

Question 9 Lab simulation

FILL BLANK

Create a playbook calledtimesvnc.yml in /home/sandy/ansible using rhel system role timesync. Set the time to use currently configured nip with the server 0.uk.pool.ntp.org.
Enable burst. Do this on all hosts.

Show answer and explanation

Solution as:

Question 10 Lab simulation

FILL BLANK

Install and configure ansible

Userbobhas been created on your control node. Give him the appropriate permissions on the control node.Install the necessary packages to run ansible on the control node.

Create a configuration file /home/bob/ansible/ansible.cfg to meet the following requirements:

The roles path should include /home/bob/ansible/roles, as well as any other path that maybe required for the course of the sample exam.
The inventory file path is /home/bob/ansible/inventory.
Ansible should be able to manage 10 hosts at a single time.
Ansible should connect to all managed nodes using the bob user.

Create an inventory file for the following five nodes:

nodel.example.com

node2.example.com

node3.example.com

node4.example.com

node5.example.com

Configure these nodes to be in an inventory file where node1 is a member of groupdev. nodc2 is a member of group test, nodc3 is a member of groupproxy,nodc4 and node 5 are members of groupprod.Also,prodis a member of group webservers.

Show answer and explanation

In/home/sandy/ansible/ansible.cfg
[defaults] inventory=/home/sandy/ansible/inventory
roles_path=/home/sandy/ansible/roles
remote_user= sandy
host_key_checking=false
[privilegeescalation]
become=true
become_user=root
become_method=sudo
become_ask_pass=false

In /home/sandy/ansible/inventory
[dev]
node1 .example.com
[test]
node2.example.com
[proxy]
node3 .example.com
[prod]
node4.example.com
node5 .example.com
[webservers:children]
prod