Ansible-Playbook commands/Day2/assignment

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.yml
---
hosts:web
tasks:
- name: Create deploy group
  ansible.builtin.group:
    name: deploy
    state: present

------------------------
#2.yml
---
hosts:web
tasks:
- name: Create deploy-user
  ansible.builtin.user:
    name: deploy-user
    groups: deploy
    state: present
    shell: /bin/bash
---------------------------------
#3.yml
---
hosts:web
tasks:
- name: Install httpd
  yum:
    name: httpd
    state: present
---------------------------------
#4.yml
---
hosts:web
tasks:
- name: Install httpd
  yum:
    name: httpd
    state: 
     - started
     - enabled
-------------------------------
#5.yml
---
hosts:web
tasks:
- name: Create a file
  ansible.builtin.file:
    name: sample.html
    dest: /var/www/html/
----------------------------
#6.yml
---
hosts:web
tasks:
- name: Reboot self
  reboot:
-----------------------------
#7.yml
---
hosts:web
tasks:
- name: Install git
  yum:
    name:
      - git
      - wget
    state: present
------------------------------
#8.yml
---
hosts:web
tasks:
- name: Clone a repo
  ansible.builtin.git:
    repo: https://github.com/scmgalaxy/ansible-role-template
    dest: /home/centos/priyanka    
    clone: yes
     
Code language: PHP (php)