Single Playbook for previous exercise:

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

Build many sub-playbooks and aggregate them via include statements.
- include: playbook-1.yml
- include: playbook-2.yml

Note - 
include is deprecated. docs.ansible.com/ansible/latest/playbooks_reuse.html import_playbook: foo is the right way to go

For newer versions of Ansilbe, you can build many sub-playbooks and aggregate them via import_playbook statements:
---
- import_playbook: A-systemd-networkd.yml
- import_playbook: B-fail2ban-ssh.yml
- import_playbook: C-enable-watchdog.ymlCode language: PHP (php)
<strong>playbook1.yaml:group </strong>                                ---create group
- name: Deploying group
  hosts: web

  tasks:
  - name: create group
    group:
      name: deploy
      state: present
  
<strong>playbook-2:httpd</strong>                                  -----install http package
- name: Start the first play
  hosts: web
  
  tasks:
  - name: Install the latest version of Apache
    yum:
      name: httpd
      state: latest
  - name: Copy file with owner and permissions
    copy:
      src: index.html
      dest: /var/www/html/index.html
  - name: Start service httpd, if not started
    service:
      name: httpd
      state: started


<strong>playbook-3:mysql </strong>                                  ------install mysql package
- name: Start the first play
      
  hosts: db
  
tasks:
  - name: Install the latest version of Apache
    yum:
      name: mysql
      state: latest
  - name: Start service httpd, if not started
    service:
      name: mysqld
      state: started

<strong>playbook4:installgit</strong>                              ------install git
- name: Update web servers
  hosts: web
  vars:
    myname: gitinstalled
    age: "18"
    packagename: github
    servicename: github
  vars_files:
    - "vars.yaml"
  vars_prompt:
    - name: "version"
      prompt: "Which version Do you want to install?"
      private: no

<strong>playbook-5:gropinsidegroup </strong>                            ----create group in another group with /bin/bash
- name: Deploying user
  hosts: web

  tasks:
  - name: create user
    user:
      name: deploy-user

      shell:/bin/bash
      group: deploy

<strong>playbook-6:httpd service</strong>                                 ------enable http service
- name: Starting the service
  hosts: webservers

  tasks:
  - name: start service
    service:
      name: httpd

      state: started

<strong>playbook-7:createfile  </strong>                                       ----create dummy index.html file
- name: Initiating File Creation
  hosts: webservers

  tasks:
  - name: creating a file
    copy:
      src: index.html

      dest: index1.html

<strong>playbook-8:copyfile</strong>                                          ------copy second.html 
- name: Copying File
  hosts: webservers

  tasks:
  - name: copy a file
    copy:
      src: seecond.html

      dest: /var/www/html/second.htmlCode language: HTML, XML (xml)