IaC Ansible

Please answer the quiz and click the "Test" button at the bottom right.

Question 1

Consider the following playbook:

- name: Frontend servers
  hosts: frontend
  become: yes
  tasks:
    - name: ???
      ansible.builtin.apt:
        name: nginx
        state: absent

Applying this playbook on an Ubuntu host with Nginx already installed:

Consider the below playbook:

- 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

Answer the below 2 questions:

Question 2

After applying the playbook, the output is:

PLAY RECAP ******************************************************************************************************************************
server        : ok=3    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Question 3

After applying the playbook, the output is:

PLAY RECAP ******************************************************************************************************************************
server        : ok=3    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Question 4

Which of the following is a good use case for an ad-hoc command?

license