Create a file called adhoc.sh /home/sandy/ansible in which will use adhoc commands to set up a new repository. The name of the repo will be 'EPEL' thedescription 'RHEL8' the baseurl is'https://dl.fedoraproject.org/pub/epel/epel-releaselatest-8.noarch.rmp'there is no gpgcheck, but you should enable the repo.
* You should be able to use an bash script using adhoc commands to enable repos. Depending on your lab setup, you may need to make this repo "state=absent" after you pass this task.
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.
What command is used to run a playbook?
A. ansible-playbook
B. ansible
C. ansible-p
D. playbook
Consider the following playbook.
-hosts: webservers become: yes
-name: install httpd yum: name: httpd state: latest
Which line includes a syntax error?
A. become: yes
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
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 of the following are shared between roles on the same system? (Choose all that apply.)
A. Templates
B. Tasks
C. Variables
D. Handlers
How is information on a given module displayed using the command ansible-doc andlt;moduleandgt;?
A. The information is simply printed to STDOUT.
B. The information is displayed in vim.
C. The information is displayed in the ansible-doc tui.
D. The information is displayed in a less-like program.
State whether the following statement is true or false.
Is this the correct format for an ansible ad-hoc command?
ansible servers -m ping
A. True
B. False