Create a file called requirements.yml /home/sandy/ansible/roles in a file called role.yml in /home/sandy/ansible/. The haproxy-role should be used on the proxy host. And when you curl http://node3.example.com it should display "Welcome tonode4.example.com" and when you curl again "Welcome tonode5.example.com"The php-role should be used on the prod host.
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 templatecalled 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 theip 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.
Create a playbook /home/bob/ansible/timesync.yml that runs on hosts in the webservers host group and does the following:
1.
Uses the timesync RHEL system role.
2.
Sets the ntp server to 0.uk.pool.ntp.org
3.
Sets the timezone to UTC
Create anansible vault password file called lock.yml with the password reallysafepw in the /home/sandy/ansible directory. In the lock.yml file define two variables. One is pw_dev and the password is 'dev' and the other is pw_mgr and the password is 'mgr' Create a regular file called secret.txt which contains the password for lock.yml.
Which command is the correct way to run the playbook /home/ansible/Buildwww.yml using the inventory file /home/ansible/inventory, assuming your present working directory is /home/ansible?
A. ansible -i inventory Build.yml
B. ansible -i inventory -p Buildwww.yml
C. ansible-playbook -i inventory -p Buildwww.yml
D. ansible-playbook -i inventory Buildwww.yml
If forks is set to 100 and Ansible is run against an inventory of 50 servers, how many forks will Ansible create?
A. 63
B. 5
C. 50
D. 100
How is Ansible Tower installed on your system?
A. It is installed with Ansible core.
B. Ansible Tower is provided through an rpm install.
C. Ansible Tower is provided in a tarball containing binaries, config files, and an installation script that must be ran.
D. A disk image may be downloaded and mounted containing the necessary Ansible Tower binaries.
Which command ships with Ansible and provides module documentation on your system?
A. ansible-documentation
B. ansible-help
C. ansible-doc
D. ansible-module-doc
Which of these are valid as the first thing in a playbook? (Choose all that apply.)
A. --
B. - tasks: name=
C. --- # this is a comment
D. - hosts: local
State whether the following statement is true or false.
If you create your own ansible facts file, it can be executable.
A. True
B. False