SlideShare una empresa de Scribd logo
1 de 21
Descargar para leer sin conexión
'BCSJDsV7´–Ï 
v 
TTNKQñK
ß…Ãu 
_|c]ŸPm	!/JSBUBNB
 
¼–¶âê±–ß5 
1FSMXÝžžz{f 
?ß{£òÔètWiomzfÆX*[r| 
Xop–Öì¯èß„PrvP÷d
'BCSJDt{ 
IUUQXXXGBCGJMFPSH 
¶òÖêvÆÖ죀¶¸ÅßvÖê 
t–NTf¥—zw³T—_tX vP 
1ZUIPOksÔ £êŽ1ZUIPOz¸®éÖÇ 
Pbtv˜|1ZUIPOs„]—_t{vŸsŽsY— 
44)-,s)z´–ÏwÙ–ŸsfÆe— 
Ù–Ÿl–zݶòwP™P™£ò¸Ç–êe— 
«P{vP 
.Z42-'BCSJDt{vPse
”Ÿq] 
$IFG1VQQFUsXop–ve—zt|¶¦ê¸®é 
ÖÇs
zwop]—zz¯Nk– 
1ZUIPOz¸®éÖÇvzs|Öì¯èÝz€ÝW•f 
—tPeP 
X¶¦ê¸®éÖÇvv•¤ícePWŽ
Ô £ê 
fabfile.pytPRؼsÔ £ê	1ZUIPOz¸®éÖÇ 
Ô £ê
žJe— 
¾¸®	1ZUIPOzD
w{vž„[ 
DÔ £êw
Çcrá·ä–êBsY—zs|Lé 
XN— _RY[vorŽŠ
from fabric.api import * 
@task 
def hostname(): 
run('hostname') 
@task 
def upload_module(): 
put('~/works/webapp/lib', '/home/user/webapp/') 
@task 
def download_logs(): 
get('/home/user/webapp/log/access.log') 
@task 
def reboot_httpd(): 
sudo('/sbin/service httpd restart')
$PSF1* 
éá–Çz²ÝòÈžöí|éá–ÇtzÔ £êD 
²òŬ¸ÇÝÌ–·âžžok§p—sz/Ò 
Ʋ떾žžok¾¸®z[/Ò 
쯐ຖ·z¼Ü|ªè–¼Ü 
iz)å–Å¢éÅ¢
$POUSJC1* 
éá–ÇzÔ £êìf	Ŭ¸ÇzðH€Ÿú|Ô  
£êz#WÀ¦Â®
 
Öì·¦®ÇŠ—`tz¡ÂÖì–È 
%KBOHPtz×%
'BCSJD
$VJTJOF 
IUUQTHJUIVCDPNTFCBTUJFODVJTJOF 
˜[XXcPtYwžRðH1* 
šòvX•È¬äàòÇXNŠ–^˜a˜rvPzs| 
žRw{cuisine.pyž­Œ«PXN—
from fabric.api import * 
from fabric.contrib.files import * 
import cuisine 
from pit import Pit 
cuisine.select_package('yum') 
@task 
def create_user(): 
with settings(user='root'): 
cuisine.user_ensure('ssmjp') 
append('/etc/sudoers', 'ssmjp ALL=(ALL) ALL') 
cuisine.ssh_authorize('ssmjp', cuisine.file_local_read('~/.ssh/ssmjp.pub')) 
conf = Pit.get('ssmjp-user', { 'require': { 'password': 'Your password' } }) 
cuisine.user_passwd('ssmjp', conf['password']) 
@task 
def install_packages(): 
with settings(user='root'): 
cuisine.package_ensure('nginx')
5JQT
44)zDPOGJHÔ £êžˆ¹e— 
óà{44)zDPOGJHÔ £ê{ˆ¹cvPX|’Az 
žcrV[tˆ¹cr[˜— 
*EFOUJUZGJMF1SPYZ$PNNBOEŽfr[˜—zs6q 
env.use_ssh_config = True
éá–ÇwÅòÜèéÆ¢ë®Çé 
éá–Çsmktemp -džöícr|try›finallys? w  
¥²e— 
run()zöíHQwfokÆ¢ë®ÇéØXû— 
def diff_hosts(): 
tempdir = run('mktemp -d') 
try: 
tempfile = '%s/hosts' % tempdir 
put('/etc/hosts', tempfile) 
run('diff -u /etc/hosts %s' % tempfile, warn_only=True) 
finally: 
run('rm -r %s' % tempdir)
á·ä–êB 
fabfiletPRÆ¢ë®Çéw__init__.pytPRÔ £êž 
for|iz¯s¾¸®ž„PkÔ £êžJNQPSUe 
—tá·ä–êBsY— 
¾¸®zcc{fab module.task‹kPvscg 
—
Ô £êÖ 
. 
└── fabfile/ 
├── __init__.py 
├── foo.py 
└── math.py 
__init__.py 
import foo 
import math
ȬäàòÅ–¶æòÐÊ 
¾¸®wȬäàòÅ–¶æòÐÊžÔ]rV[ 
t|fab -lžöícktYw¾¸®zÚtcr¼Üa˜ 
— 
@task 
def calc_add(x, y): 
''' 
add two integer 
''' 
print '%d + %d = %d' % (int(x), int(y), int(x) + int(y))
Ú¸ÇØzv 
²ÝòÈè£ò©Ö¶æòsUckÚ¸ÇØ{ 
FOWIPTUTs¡®º¸sY—zs|GBCGJMFQZw  
Œ_tŽIÿ 
env.hosts = ['server1', 'server2']
FOWSPMFEFGžcrV[t|ڸǞ3PMFsŠt 
rT— 
env.roledefs = { 
'web': ['web01','web02'], 
'db': ['db01'] 
}
1ZUIPO¸®éÖÇvzs|“óW•Ú¸Ç´pž­‹ 
Œ_tŽIÿ 
1Z:.-X

Más contenido relacionado

La actualidad más candente

Python Developer's Daily Routine
Python Developer's Daily RoutinePython Developer's Daily Routine
Python Developer's Daily Routine
Maxim Avanov
 
大規模画像配信とPerl
大規模画像配信とPerl大規模画像配信とPerl
大規模画像配信とPerl
Masahiro Nagano
 
Seattle.rb 6.4
Seattle.rb 6.4Seattle.rb 6.4
Seattle.rb 6.4
deanhudson
 

La actualidad más candente (20)

Python Developer's Daily Routine
Python Developer's Daily RoutinePython Developer's Daily Routine
Python Developer's Daily Routine
 
大規模画像配信とPerl
大規模画像配信とPerl大規模画像配信とPerl
大規模画像配信とPerl
 
actor madhu
actor madhuactor madhu
actor madhu
 
Pg 0195
Pg 0195Pg 0195
Pg 0195
 
Denuncia roubo
Denuncia   rouboDenuncia   roubo
Denuncia roubo
 
COnnect4Game
COnnect4GameCOnnect4Game
COnnect4Game
 
ELECTRONICS
ELECTRONICSELECTRONICS
ELECTRONICS
 
Notebook english V
Notebook english VNotebook english V
Notebook english V
 
PHALADEEPIKA - CHAPTER 23
PHALADEEPIKA - CHAPTER 23PHALADEEPIKA - CHAPTER 23
PHALADEEPIKA - CHAPTER 23
 
Original Career Path Finder Chart - 2021 Edition
Original Career Path Finder Chart - 2021 EditionOriginal Career Path Finder Chart - 2021 Edition
Original Career Path Finder Chart - 2021 Edition
 
BHADRATHA public distribution system of Government of Kerala. pdf uploaded by...
BHADRATHA public distribution system of Government of Kerala. pdf uploaded by...BHADRATHA public distribution system of Government of Kerala. pdf uploaded by...
BHADRATHA public distribution system of Government of Kerala. pdf uploaded by...
 
Revenue guide 2021 - ildm revenue guide 2021 of kerala Land revenue departmen...
Revenue guide 2021 - ildm revenue guide 2021 of kerala Land revenue departmen...Revenue guide 2021 - ildm revenue guide 2021 of kerala Land revenue departmen...
Revenue guide 2021 - ildm revenue guide 2021 of kerala Land revenue departmen...
 
Presentation 1
Presentation 1Presentation 1
Presentation 1
 
164 172-fadil-nasiiriالجسد والصورة والمقدس في الإسلام (فريد الزاهي)
164 172-fadil-nasiiriالجسد والصورة والمقدس في الإسلام (فريد الزاهي)164 172-fadil-nasiiriالجسد والصورة والمقدس في الإسلام (فريد الزاهي)
164 172-fadil-nasiiriالجسد والصورة والمقدس في الإسلام (فريد الزاهي)
 
R で解く FizzBuzz 問題
R で解く FizzBuzz 問題R で解く FizzBuzz 問題
R で解く FizzBuzz 問題
 
Hybridizations
HybridizationsHybridizations
Hybridizations
 
Miquel serracanta, profesor de eae business school, vigia
Miquel serracanta, profesor de eae business school, vigiaMiquel serracanta, profesor de eae business school, vigia
Miquel serracanta, profesor de eae business school, vigia
 
Answer key
Answer keyAnswer key
Answer key
 
Seattle.rb 6.4
Seattle.rb 6.4Seattle.rb 6.4
Seattle.rb 6.4
 
Alwazeefa tul kareema.urdu
Alwazeefa tul kareema.urduAlwazeefa tul kareema.urdu
Alwazeefa tul kareema.urdu
 

Destacado

クラウド時代のアーキテクチャ設計
クラウド時代のアーキテクチャ設計クラウド時代のアーキテクチャ設計
クラウド時代のアーキテクチャ設計
SORACOM, INC
 
変化の時代で勝つための開発組織のあり方 2011 12-22
変化の時代で勝つための開発組織のあり方 2011 12-22変化の時代で勝つための開発組織のあり方 2011 12-22
変化の時代で勝つための開発組織のあり方 2011 12-22
俊仁 小林
 

Destacado (8)

クラウド時代のアーキテクチャ設計
クラウド時代のアーキテクチャ設計クラウド時代のアーキテクチャ設計
クラウド時代のアーキテクチャ設計
 
XenServerによるお手軽開発サーバ運用
XenServerによるお手軽開発サーバ運用XenServerによるお手軽開発サーバ運用
XenServerによるお手軽開発サーバ運用
 
特別講義の資料
特別講義の資料特別講義の資料
特別講義の資料
 
Innovation, how to make it
Innovation, how to make itInnovation, how to make it
Innovation, how to make it
 
うちのRedmineの使い方
うちのRedmineの使い方うちのRedmineの使い方
うちのRedmineの使い方
 
変化の時代で勝つための開発組織のあり方 2011 12-22
変化の時代で勝つための開発組織のあり方 2011 12-22変化の時代で勝つための開発組織のあり方 2011 12-22
変化の時代で勝つための開発組織のあり方 2011 12-22
 
10分で作るオリジナルサイト - CMS/blog/adiary/Wordpress
10分で作るオリジナルサイト -  CMS/blog/adiary/Wordpress10分で作るオリジナルサイト -  CMS/blog/adiary/Wordpress
10分で作るオリジナルサイト - CMS/blog/adiary/Wordpress
 
Xen, XenServer, and XAPI: What’s the Difference?-XPUS13 Bulpin,Pavlicek
Xen, XenServer, and XAPI: What’s the Difference?-XPUS13 Bulpin,PavlicekXen, XenServer, and XAPI: What’s the Difference?-XPUS13 Bulpin,Pavlicek
Xen, XenServer, and XAPI: What’s the Difference?-XPUS13 Bulpin,Pavlicek
 

Similar a Fabricでお手軽サーバ管理

The Call of Revolution - (Urdu)
The Call of Revolution - (Urdu)The Call of Revolution - (Urdu)
The Call of Revolution - (Urdu)
Zaid Ahmad
 
Apendice modelo equaçoes diferenciais ordinarias no atp
Apendice   modelo equaçoes diferenciais ordinarias no atp Apendice   modelo equaçoes diferenciais ordinarias no atp
Apendice modelo equaçoes diferenciais ordinarias no atp
Alex Sebaje
 
مذهب أهل التفويض في نصوص الصفات الشيخ أحمد بن عبد الرحمن القاضي
مذهب أهل التفويض في نصوص الصفات   الشيخ أحمد بن عبد الرحمن القاضيمذهب أهل التفويض في نصوص الصفات   الشيخ أحمد بن عبد الرحمن القاضي
مذهب أهل التفويض في نصوص الصفات الشيخ أحمد بن عبد الرحمن القاضي
Om Muktar
 
Gerencia de informatic apdf
Gerencia de informatic apdfGerencia de informatic apdf
Gerencia de informatic apdf
Giomar Serna
 

Similar a Fabricでお手軽サーバ管理 (20)

No.23-D (1)
No.23-D (1)No.23-D (1)
No.23-D (1)
 
Juliaで学ぶ Hamiltonian Monte Carlo (NUTS 入り)
Juliaで学ぶ Hamiltonian Monte Carlo (NUTS 入り)Juliaで学ぶ Hamiltonian Monte Carlo (NUTS 入り)
Juliaで学ぶ Hamiltonian Monte Carlo (NUTS 入り)
 
The Call of Revolution - (Urdu)
The Call of Revolution - (Urdu)The Call of Revolution - (Urdu)
The Call of Revolution - (Urdu)
 
Modern Roundabouts FHWA March 2012
Modern Roundabouts FHWA March 2012 Modern Roundabouts FHWA March 2012
Modern Roundabouts FHWA March 2012
 
การใช้ Turbo C ชุดที่ 11 function
การใช้ Turbo C ชุดที่ 11 functionการใช้ Turbo C ชุดที่ 11 function
การใช้ Turbo C ชุดที่ 11 function
 
Tercera parte parte del Cuaderno de Ingles
Tercera parte parte del Cuaderno de InglesTercera parte parte del Cuaderno de Ingles
Tercera parte parte del Cuaderno de Ingles
 
Diário Oficial 25/02/2014
Diário Oficial 25/02/2014Diário Oficial 25/02/2014
Diário Oficial 25/02/2014
 
Apendice modelo equaçoes diferenciais ordinarias no atp
Apendice   modelo equaçoes diferenciais ordinarias no atp Apendice   modelo equaçoes diferenciais ordinarias no atp
Apendice modelo equaçoes diferenciais ordinarias no atp
 
A
AA
A
 
HIV AIDS booklet
HIV AIDS bookletHIV AIDS booklet
HIV AIDS booklet
 
مذهب أهل التفويض في نصوص الصفات الشيخ أحمد بن عبد الرحمن القاضي
مذهب أهل التفويض في نصوص الصفات   الشيخ أحمد بن عبد الرحمن القاضيمذهب أهل التفويض في نصوص الصفات   الشيخ أحمد بن عبد الرحمن القاضي
مذهب أهل التفويض في نصوص الصفات الشيخ أحمد بن عبد الرحمن القاضي
 
Signs of muhammad in the bible
Signs of muhammad in the bibleSigns of muhammad in the bible
Signs of muhammad in the bible
 
Decisão ação MP - Serviços essenciais
Decisão ação MP - Serviços essenciaisDecisão ação MP - Serviços essenciais
Decisão ação MP - Serviços essenciais
 
Buenas practicas
Buenas practicasBuenas practicas
Buenas practicas
 
Gerencia de informatic apdf
Gerencia de informatic apdfGerencia de informatic apdf
Gerencia de informatic apdf
 
Pertumbuhan Asuransi Syariah copy.pdf
Pertumbuhan Asuransi Syariah copy.pdfPertumbuhan Asuransi Syariah copy.pdf
Pertumbuhan Asuransi Syariah copy.pdf
 
Markenräume - Markenwerte übersetzen in temporäre Architektur
Markenräume - Markenwerte übersetzen in temporäre ArchitekturMarkenräume - Markenwerte übersetzen in temporäre Architektur
Markenräume - Markenwerte übersetzen in temporäre Architektur
 
iphone app development
iphone app developmentiphone app development
iphone app development
 
Z
ZZ
Z
 
Worst
WorstWorst
Worst
 

Último

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Último (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 

Fabricでお手軽サーバ管理