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.
Consider the following play excerpt:
-name: deploy app config template: src: app.xml.j2 dest: /etc/app.xml notify:
-
restart memcached
-
restart apache
-name: deploy httpd config
template:
src: httpd.conf.j2
dest: /etc/httpd/conf/httpd.conf
notify:
-restart apache
-name: deploy httpd config
template:
src: site.conf.j2
dest: /etc/httpd/conf/site.conf
notify:
-restart apache
Presuming all of the listed tasks in the play change the files they act on and the handler is correctly defined in another file, how many times is the "restart apache" handler ran?
A. 3
B. 0
C. 2
D. 1
What is a typical use case for an Ansible Template?
A. Managing remote system configuration files
B. Defining a host group
C. Installing remote Ansible installations
D. Running remote commands
What special character is used to designate that you are passing a variable file to a play using the -e flag?
A. The plugs sign: "+"
B. There is no special character required.
C. The at symbol: "@"
D. The pipe: "|"
Is there a syntax error in the following excerpt? If so, what is it?
vars: package: httpd tasks:
-
name: Deploy {{ package }}
yum:
name:
{{ package }}
state: present
A.
No, there are no syntax errors in the provided excerpt.
B.
Yes, the variable package is not defined correctly.
C.
Yes, the name parameter for the yum module should have a quoted value.
D.
Yes, the name keyword (below tasks) should have a quoted value.
By default, how many times can a role be applied during a play?
A. Once, no matter the parameters provided.
B. As many times as necessary, no matter the parameters.
C. Once, presuming it is only applied with a single set of parameters.
D. As many times as necessary, presuming the `single_run' attribute is set to false.
Which keywords will cause a role to be applied in a playbook? (Choose all that apply.)
A. use_role
B. include_role
C. load_role
D. role
Which of the following are shared between roles on the same system? (Choose all that apply.)
A. Templates
B. Tasks
C. Variables
D. Handlers
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
What values will serial accept? (Choose all that apply.)
A. A mix of integer and appropriately specified percentage values
B. Symbolic percentage values (as in 50%)
C. Decimal percentage values (as in .50)
D. Integer values