Ansible-Playbook commands/Day2/assignment

DevOps

YOUR COSMETIC CARE STARTS HERE

Find the Best Cosmetic Hospitals

Trusted • Curated • Easy

Looking for the right place for a cosmetic procedure? Explore top cosmetic hospitals in one place and choose with confidence.

“Small steps lead to big changes — today is a perfect day to begin.”

Explore Cosmetic Hospitals Compare hospitals, services & options quickly.

✓ Shortlist providers • ✓ Review options • ✓ Take the next step with confidence


#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)