Ansible playbook Excercise

DevOps

MOTOSHARE 🚗🏍️
Turning Idle Vehicles into Shared Rides & Earnings

From Idle to Income. From Parked to Purpose.
Earn by Sharing, Ride by Renting.
Where Owners Earn, Riders Move.
Owners Earn. Riders Move. Motoshare Connects.

With Motoshare, every parked vehicle finds a purpose. Owners earn. Renters ride.
🚀 Everyone wins.

Start Your Journey with Motoshare

Write a Ansible Playbook to create a group called “deploy”

tasks:
   - name: create group
     group:
       name:deploy

       state: presentCode language: CSS (css)

Write a Ansible Playbook to create a user called “deploy-user” which is part of group called “deploy” and with /bin/bash shell.

- name: create user
     user:
       name: deploy-user
       group: deploy
       shell: /bin/bash
    
      Code language: JavaScript (javascript)

Write a Ansible Playbook to install package named “httpd” in RHEL/centos.

- name: Install the package
  ansible.builtin.package:
    name:
      - httpd
    state: latest
Code language: CSS (css)

Write a Ansible Playbook to start and enable the service named “httpd”

- name: Install the package
  ansible.builtin.package:
    name:
      - httpd
    state: started
Code language: CSS (css)

Write a Ansible Playbook to create a file called “index.html” in /var/www/html with some dummy html contents.

---

- hosts: all
  tasks:
  - name: Creating an empty file
    file:
      path: "/var/www/html"
      state: touchCode language: PHP (php)

Write a Ansible Playbook to reboot a self machine.

Write a Ansible Playbook to install a package called “git”, “wget”