PLAYBOOK – ANSIBLE

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
  1. Write a Ansible Playbook to create a group called “deploy”
- ansible Creating a deploy group name=deploy become=trueCode language: JavaScript (javascript)

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

- ansible creating deploy user name=deploy-user group=deploy password="abcd" shell=/bin/bash state=presentCode language: JavaScript (javascript)

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


- ansible localhost deploying a webserver -m service -a "name=httpd state=started"
Code language: JavaScript (javascript)

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

- ansible localhost starting -m service -a"name=httpd state=started"Code language: JavaScript (javascript)

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

- ansible create an index.html path=/var/www/html/index.html mode 366 state=touch

  - ansible adding contents to index.html path=/var/www/html/index.html block=<h1> Welcome to Ansible programming tutorial </h1>
    Code language: JavaScript (javascript)

6. Write a Ansible Playbook to reboot a self machine.

- ansible -m ansible.builtin.reboot -a"name=reboot the self machine"Code language: JavaScript (javascript)

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

- ansible installing git and wget packages name=git,wget state=present

8. Write a Ansible Playbook to clone git repo. thttps://github.com/scmgalaxy/ansible-role-template

- ansible Clone the git repo https://github.com/scmgalaxy/ansible-role-template name: cloning dest= http_proxy
Code language: PHP (php)