EX407 Dumps

EX407 Free Practice Test

Red-Hat EX407: Red Hat Certified Specialist in Ansible Automation exam

QUESTION 6

CORRECT TEXT
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.j2 that displays "Welcome to the server HOSTNAME"
In a play called apache.yml in /home/bob/ansible/ run the sample-apache role.
Solution:
/home/sandy/ansible/apache.yml
EX407 dumps exhibit
/home/sandy/ansible/roles/sample-apache/tasks/main.yml
EX407 dumps exhibit
/home/sandy/ansible/roles/sample-apache/templates/index.html.j2
EX407 dumps exhibit
EX407 dumps exhibitIn /home/sandy/ansible/roles/sample-apache/handlers/main.yml

Does this meet the goal?

Correct Answer: A

QUESTION 7

CORRECT TEXT
Create a role called sample-apache in /home/sandy/ansible/roles that enables and starts httpd, enables and starts the firewall and allows the webserver service. Create a template called index.html.j2 which creates and serves a message from
/var/www/html/index.html Whenever the content of the file changes, restart the webserver service.
Welcome to [FQDN] on [IP]
Replace the FQDN with the fully qualified domain name and IP with the ip address of the node using ansible facts. Lastly, create a playbook in /home/sandy/ansible/ called apache.yml and use the role to serve the index file on webserver hosts.
Solution:
/home/sandy/ansible/apache.yml
EX407 dumps exhibit
/home/sandy/ansible/roles/sample-apache/tasks/main.yml
EX407 dumps exhibit
/home/sandy/ansible/roles/sample-apache/templates/index.html.j2
EX407 dumps exhibit
In /home/sandy/ansible/roles/sample-apache/handlers/main.yml
EX407 dumps exhibit

Does this meet the goal?

Correct Answer: A

QUESTION 8

CORRECT TEXT
Using the Simulation Program, perform the following tasks:
Ad-Hoc Ansible Commands (Number Two) Task:
* 1. Use the ad-hoc command to make sure php is installed.
* 2. Use the ad-hoc command to make sure that php is installed and is the latest version.
* 3. Use the ad-hoc command to make sure that httpd is installed.
* 4. Use the ad-hoc command to remove httpd from the servers.
Solution:
* 1. ansible all -b -m yum -a 'name=php state=present'
* 2. ansible all -b -m yum -a 'name=php state=latest'
* 3. ansible all -b -m yum -a 'name=httpd state=latest'
* 4. ansible all -b -m yum -a 'name=httpd state=absent'

Does this meet the goal?

Correct Answer: A

QUESTION 9

CORRECT TEXT
Create an empty encrypted file called myvault.yml in /home/sandy/ansible and set the password to notsafepw. Rekey the password to iwejfj2221.
Solution:
ansible-vault create myvault.yml
Create new password: notsafepw Confirm password: notsafepw ansible-vault rekey myvault.yml
Current password: notsafepw New password: iwejfj2221 Confirm password: iwejfj2221

Does this meet the goal?

Correct Answer: A

QUESTION 10

CORRECT TEXT
Install and configure ansible
User bob has 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 may be 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 group dev. nodc2 is a member of group test, nodc3 is a member of group proxy, nodc4 and node 5 are members of group prod. Also, prod is a member of group webservers.
Solution:
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]
node 1 .example.com [test] node2.example.com [proxy]
node3 .example.com [prod] node4.example.com node5 .example.com [webservers:children] prod

Does this meet the goal?

Correct Answer: A