Ansible-Playbook commands/Day2/assignment

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

#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