Create the users in the file usersjist.yml file provided. Do this in a playbook called users.yml located at /home/sandy/ansible. The passwords for these users should be set using the lock.yml file from TASK7. When running the playbook, the lock.yml file should be unlocked with secret.txt file from TASK 7.
All users with the job of 'developer' should be created on the dev hosts, add them to the group devops, their password should be set using the pw_dev variable. Likewise create users with the job of 'manager' on the proxy host and add the users to the group 'managers', their password should be set using the pw_mgr variable.
users_list.yml
Consider the following playbook:
# playbook name: /home/ansible/web.yml
-hosts: webservers become: yes
tasks:
-name: edit file 1
lineinfile:
path: /var/www/content.hml line: "{{ text }}" tags:
-content
-name: edit file 2
lineinfile: path: /var/www/index.hml
line: "{{ text }}"
tags:
-web
-name: edit file 3 lineinfile: path: /var/www/etc.hml line: "{{ text }}" tags: - content - misc
Which use of the ansible-playbook command on the provided playbook will result in ONLY editing the file /var/www/index.html?
A. ansible-playbook /home/ansible/web.yml
B. ansible-playbook /home/ansible/web.yml --skip-tags web
C. ansible-playbook /home/ansible/web.yml --skip-tags content
D. ansible-playbook /home/ansible/web.yml --tags content
What keyword sets a change condition for a given task?
A. flag_change
B. changed_when
C. register_change
D. change_set
Which keywords are valid? (Choose all that apply.)
A. never
B. rescue
C. always
D. block
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
Which of the following are Ansible modules? (Choose all that apply.)
A. get_dnshostname
B. setup
C. yum
D. ping
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.
State whether the following statement is true or false.
There is a 10 user trial available.
A. True
B. False