Ansible playbook Excercise

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

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”