Dev m5 Demo4 v1 h8s nn4pv4q
Dev m5 Demo4 v1 h8s nn4pv4q
Note: The text editor used in this demo is vi. You can use any editor of your choice.
Note: Create a custom index.html file and past it inside the roleName/files directory inside your
ansible/roles directory
Syntax: cd /etc/ansible/roles
▪ Open and edit the main.yml file inside the tasks folder
---
- name: Install nginx web server
apt: pkg=nginx state=installed update_cache=true
notify:
- start nginx
- name: Upload
copy: src=index.html dest=/usr/share/nginx/www/ mode=0644
register: php
ignore_errors: True
---
- name: start nginx
service: name=nginx state=started
▪ Inside the ansible directory create and edit a new playbook to use the role in
---
- hosts: all
become: true
vars:
ansible_become_pass: edureka
roles:
- role: demo-role