SlideShare a Scribd company logo
1 of 8
LVM QUESTION’S ANSWER>>>
[student@server1 ansible]$ cat lvm.yml
---
- name: Create and use logical volume
hosts: all
tasks:
- block:
- name: check for vg research
command: vgs research
rescue:
- name: display vg error message
debug:
msg: "volume group does not exist"
- block:
- name: create logical volume data in research volume group
community.general.lvol:
lv: data
vg: research
size: 1500m
- name: format lv with filesystem
filesystem:
dev: /dev/research/data
fstype: ext4
rescue:
- name: display msg for lv error
debug:
msg: "colud not create logical volume of that size"
- block:
- name: creat logical volume of size 800m
community.general.lvol:
lv: data
vg: research
size: 800m
- name: format lv with the file system
filesystem:
dev: /dev/research/data
fstype: ext4
ignore_errors: true
Question 8 Use Roles from Ansible Galaxy
Note: final play book execuation k dauran pahle php vala role run karange so that blancer
per fatcs; gather ho jaye.ulta karge to kaam nahi kerega.…otherwise error aati hey.
[student@server1 ansible]$ cat deploy-haproxy.yml
---
- name: deploy phpinfo role on webserver hostgroup
hosts: webservers
roles:
- phpinfo
- name: deploy haproxy role on balancer hostgroup
hosts: balancer
# ignore_errors: true
roles:
- balancer
[student@server1 ansible]$
Note: Ignore_errors tab lagana ki any reason balancer bala role run na kere ..to 50% marks
to mil hi jaynge..
[student@server1 ansible]$ cat roles/balancer/vars/main.yml
haproxy_appservers:
- name: serverb.lab.example.com
ip: 172.25.250.11
backend_port: 80
- name: serverc.lab.exaample.com
ip: 172.25.250.12
backend_port: 80
[student@server1 ansible]$
[student@server1 ansible]$ cat roles/phpinfo/vars/main.yml
web_message: Hello PHP World
[student@server1 ansible]$
[student@server1 ansible]$ ansible-navigator run -m stdout deploy-haproxy.yml
Y METHOD SIMPLE VALA HEY …AGER JINJA VALA KERNA HEY TO..
PHP VALE ROLE ME KUCH NAHI KERNGE…BAS BALANCER VALE ROLE KO SAHI
KERNGE…haproxcy.cfg.j2 file milegi..kuch missing hoga usko fill kerna hey.
[student@server1 ansible]$ cd roles/balancer/
[student@server1 balancer]$ vim templates/haproxy.cfg.j2
Line number 86 tak sahi lika hoga..87 88 and 89 likh ker save kerk bahar aa jao..
Iske baad seedhe play book bana ker run kara do..
[student@server1 ansible]$ cat deploy-haproxy.yml
---
- name: deploy phpinfo role on webserver hostgroup
hosts: webservers
roles:
- phpinfo
- name: deploy haproxy role on balancer hostgroup
hosts: balancer
# ignore_errors: true
roles:
- balancer
[student@server1 ansible]$

More Related Content

Similar to LVM QUESTION.docx

playbooks.pptx
playbooks.pptxplaybooks.pptx
playbooks.pptx
BaskarKannanK
 

Similar to LVM QUESTION.docx (20)

An Introduction to Symfony
An Introduction to SymfonyAn Introduction to Symfony
An Introduction to Symfony
 
More tips n tricks
More tips n tricksMore tips n tricks
More tips n tricks
 
Power shell training
Power shell trainingPower shell training
Power shell training
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0
 
Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기Node.js API 서버 성능 개선기
Node.js API 서버 성능 개선기
 
Ex407
Ex407Ex407
Ex407
 
More to RoC weibo
More to RoC weiboMore to RoC weibo
More to RoC weibo
 
Introduction to Ansible - (dev ops for people who hate devops)
Introduction to Ansible - (dev ops for people who hate devops)Introduction to Ansible - (dev ops for people who hate devops)
Introduction to Ansible - (dev ops for people who hate devops)
 
My SQL 101
My SQL 101My SQL 101
My SQL 101
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/Press
 
playbooks.pptx
playbooks.pptxplaybooks.pptx
playbooks.pptx
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
 
Ansible ex407 and EX 294
Ansible ex407 and EX 294Ansible ex407 and EX 294
Ansible ex407 and EX 294
 
Laravel tips-2019-04
Laravel tips-2019-04Laravel tips-2019-04
Laravel tips-2019-04
 
Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutions
 
Ruby meetup-dry
Ruby meetup-dryRuby meetup-dry
Ruby meetup-dry
 
Laravel Artisan Cheat Sheet
Laravel Artisan Cheat SheetLaravel Artisan Cheat Sheet
Laravel Artisan Cheat Sheet
 
How To Test Everything
How To Test EverythingHow To Test Everything
How To Test Everything
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 

Recently uploaded

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Recently uploaded (20)

An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 

LVM QUESTION.docx

  • 1. LVM QUESTION’S ANSWER>>> [student@server1 ansible]$ cat lvm.yml --- - name: Create and use logical volume hosts: all tasks: - block: - name: check for vg research command: vgs research rescue: - name: display vg error message debug: msg: "volume group does not exist"
  • 2. - block: - name: create logical volume data in research volume group community.general.lvol: lv: data vg: research size: 1500m - name: format lv with filesystem filesystem: dev: /dev/research/data fstype: ext4 rescue:
  • 3. - name: display msg for lv error debug: msg: "colud not create logical volume of that size" - block: - name: creat logical volume of size 800m community.general.lvol: lv: data vg: research size: 800m - name: format lv with the file system filesystem: dev: /dev/research/data
  • 4. fstype: ext4 ignore_errors: true Question 8 Use Roles from Ansible Galaxy Note: final play book execuation k dauran pahle php vala role run karange so that blancer per fatcs; gather ho jaye.ulta karge to kaam nahi kerega.…otherwise error aati hey. [student@server1 ansible]$ cat deploy-haproxy.yml --- - name: deploy phpinfo role on webserver hostgroup hosts: webservers roles: - phpinfo - name: deploy haproxy role on balancer hostgroup hosts: balancer
  • 5. # ignore_errors: true roles: - balancer [student@server1 ansible]$ Note: Ignore_errors tab lagana ki any reason balancer bala role run na kere ..to 50% marks to mil hi jaynge.. [student@server1 ansible]$ cat roles/balancer/vars/main.yml haproxy_appservers: - name: serverb.lab.example.com ip: 172.25.250.11 backend_port: 80 - name: serverc.lab.exaample.com ip: 172.25.250.12 backend_port: 80
  • 6. [student@server1 ansible]$ [student@server1 ansible]$ cat roles/phpinfo/vars/main.yml web_message: Hello PHP World [student@server1 ansible]$ [student@server1 ansible]$ ansible-navigator run -m stdout deploy-haproxy.yml Y METHOD SIMPLE VALA HEY …AGER JINJA VALA KERNA HEY TO.. PHP VALE ROLE ME KUCH NAHI KERNGE…BAS BALANCER VALE ROLE KO SAHI KERNGE…haproxcy.cfg.j2 file milegi..kuch missing hoga usko fill kerna hey. [student@server1 ansible]$ cd roles/balancer/ [student@server1 balancer]$ vim templates/haproxy.cfg.j2 Line number 86 tak sahi lika hoga..87 88 and 89 likh ker save kerk bahar aa jao..
  • 7. Iske baad seedhe play book bana ker run kara do.. [student@server1 ansible]$ cat deploy-haproxy.yml --- - name: deploy phpinfo role on webserver hostgroup hosts: webservers roles: - phpinfo - name: deploy haproxy role on balancer hostgroup hosts: balancer # ignore_errors: true