Ansible Playbook Lab

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”

-name: first playbook
 hosts: web

 tasks:
  -name: Deploy Group
   ansible.builtin.group:
     name: deploy
     state: present
Code 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: second playbook
 hosts: web

 tasks:
  -name: Adding user to group
   ansible.builtin.user:
     name: deploy-user
     shell: /bin/bash
     groups: deploy
   

Code language: JavaScript (javascript)

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

-name: Third playbook
 hosts: web

 tasks:
  -name: Installing package
   ansible.builtin.package:
    name: httpd
    state: presentCode language: CSS (css)

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

-name: fourth playbook
 hosts: web

 tasks:
  -name: start and enable the service namedhttpdansible.builtin.service:
    name: httpd
    state: started
    enabled: yesCode language: CSS (css)

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

-name: fifth playbook
 hosts: web

 tasks:
  -name: create a file called “index.html” in /var/www/html 
   file:
      path: /var/www/html/index.html
      state: touchCode language: JavaScript (javascript)

Write a Ansible Playbook to reboot a self machine.

-name: sixth playbook
 hosts: web

 tasks:
  -name: reboot a self machine.
   reboot:
    reboot_timeout: 60Code language: PHP (php)

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

-name: seventh playbook
 hosts: web

 tasks:
  -name:  clone git repo. 
   ansible.builtin.git:
    repo: https://github.com/scmgalaxy/ansible-role-template
    clone: yesCode language: PHP (php)

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

 name: eighth playbook
  hosts: web
  tasks:
  - name: Installing git, wget packages 
    yum:
      name: 
         -git
         -wget
      state: present