exam 7

 Write a playbook /home/thor/playbooks/configure_webserver.yml which installs nginx web server and serves a html file: index.html from directory /usr/share/nginx/html on remote servers.


You are provided with /home/thor/playbooks/index.html that you should copy to remote web servers listed on inventory /home/thor/playbooks/inventory. Ensure that nginx is serving the file, that you copied.


Create configure_webserver.yml playbook and add below given code

---
- hosts: all
  tasks:
    - package:
        name: nginx
        state: present
    - copy:
        src: index.html
        dest: /usr/share/nginx/html/index.html
    - service:
        name: nginx
        state: started

Comments

Popular posts from this blog

exam 16

ansible 5

practical 3