SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Downloaden Sie, um offline zu lesen
fabric
Hachioji.pm #31
@equinox79
1
自己紹介
•@equinox79
•位置情報系のシステムやってます
•GPS測位データの分析システム
•スマホアプリも少々
2
ある日
•「Zabbixのエージェントを入れて欲し
いんですけどー」
•「いいですよーどのサーバですか?」
•「これですーズラズラ、、(30台ぐら
い)」
•「え」
3
めんどい
•「あ、あれだ、、、最近流行りのアレ
を使おう、、」
4
chefを調べる
5
•凄く良く出来てるけど、こういうのに
興味ない人にまで使わせるにはちょっ
と厳しい・・・
感想
6
http://hozumi.github.io/2013/03/chef-fabric-ja.html
7
fabric
•python製のデプロイツール
•https://github.com/fabric/fabric
•http://docs.fabfile.org/en/1.7/
8
fabfile.py
-----------------------------
from fabric.api import *
env.hosts = [‘host1’, ‘host2’, ... ]
env.user = ‘hoge’
env.password = ‘fuga’
def hello_fab():
run("uname -a")
sudo("whoami")
-----------------------------
とりえず動かす
• pip install Fabric
• こういうのを書く→
• fab hello_fab
• -f hoge.py も可
9
•run() ... コマンド実行
•local() ... ローカルで実行
•put() / get() ... scp
•with構文
とりあえず
10
実行時
$ fab develop hello_fab
11
vagrant@localhost ]$ fab develop hello_fab
[localhost] Executing task 'hello_fab'
[localhost] run: uname -a
[localhost] out: Linux localhost.localdomain 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x8
x86_64 x86_64 GNU/Linux
[localhost] out:
[localhost] sudo: whoami
[localhost] out: root
[localhost] out:
[localhost] sudo: pwd
[localhost] out: /usr/local/src
[localhost] out:
[127.0.0.1] Executing task 'hello_fab'
[127.0.0.1] run: uname -a
[127.0.0.1] out: Linux localhost.localdomain 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012
x86_64 x86_64 x86_64 GNU/Linux
[127.0.0.1] out:
[127.0.0.1] sudo: whoami
[127.0.0.1] out: root
[127.0.0.1] out:
[127.0.0.1] sudo: pwd
[127.0.0.1] out: /usr/local/src
[127.0.0.1] out:
Done.
Disconnecting from 127.0.0.1... done.
Disconnecting from localhost... done.
12
関連ツール
• cuisine
• fabricにchefライクな機能を追加
• https://github.com/sebastien/cuisine
• envassert
• fabricでserverspecみたいな事ができるみたい
• http://tdoc.info/blog/2013/05/14/envassert.html
13

Weitere ähnliche Inhalte

Andere mochten auch

Adreso - Yapc::Asia Tokyo 2012 LTソン
Adreso - Yapc::Asia Tokyo 2012 LTソンAdreso - Yapc::Asia Tokyo 2012 LTソン
Adreso - Yapc::Asia Tokyo 2012 LTソンJunichiro Suzuki
 
Sarbatorile Pascale
Sarbatorile PascaleSarbatorile Pascale
Sarbatorile Pascaledanyelyta
 
Chapter 12 and 13 - Public Speaking Developing And Structuring The Message
Chapter 12 and 13 - Public Speaking Developing And Structuring The MessageChapter 12 and 13 - Public Speaking Developing And Structuring The Message
Chapter 12 and 13 - Public Speaking Developing And Structuring The Messageguestfdfd3a
 
Chapter 9 And 10: Groups (Members)
Chapter 9 And 10: Groups (Members)Chapter 9 And 10: Groups (Members)
Chapter 9 And 10: Groups (Members)guestfdfd3a
 
Chapter 15: Informative Public Speaking
Chapter 15: Informative Public SpeakingChapter 15: Informative Public Speaking
Chapter 15: Informative Public Speakingguestfdfd3a
 
New Microsoft Office Power Point Presentation
New Microsoft Office Power Point PresentationNew Microsoft Office Power Point Presentation
New Microsoft Office Power Point Presentationdanyelyta
 
Chapter 11 - Public Speaking Planning The Message
Chapter 11 - Public Speaking Planning The MessageChapter 11 - Public Speaking Planning The Message
Chapter 11 - Public Speaking Planning The Messageguestfdfd3a
 
Chapter 16: Persuasive Public Speaking
Chapter 16: Persuasive Public SpeakingChapter 16: Persuasive Public Speaking
Chapter 16: Persuasive Public Speakingguestfdfd3a
 

Andere mochten auch (15)

Adreso - Yapc::Asia Tokyo 2012 LTソン
Adreso - Yapc::Asia Tokyo 2012 LTソンAdreso - Yapc::Asia Tokyo 2012 LTソン
Adreso - Yapc::Asia Tokyo 2012 LTソン
 
Sarbatorile Pascale
Sarbatorile PascaleSarbatorile Pascale
Sarbatorile Pascale
 
Poluare
PoluarePoluare
Poluare
 
Flori
FloriFlori
Flori
 
Chapter 12 and 13 - Public Speaking Developing And Structuring The Message
Chapter 12 and 13 - Public Speaking Developing And Structuring The MessageChapter 12 and 13 - Public Speaking Developing And Structuring The Message
Chapter 12 and 13 - Public Speaking Developing And Structuring The Message
 
Chapter 9 And 10: Groups (Members)
Chapter 9 And 10: Groups (Members)Chapter 9 And 10: Groups (Members)
Chapter 9 And 10: Groups (Members)
 
Tc 09-tokyo-summit-2015
Tc 09-tokyo-summit-2015Tc 09-tokyo-summit-2015
Tc 09-tokyo-summit-2015
 
Paste
PastePaste
Paste
 
Moda
ModaModa
Moda
 
Hachiojipm21
Hachiojipm21Hachiojipm21
Hachiojipm21
 
Chapter 15: Informative Public Speaking
Chapter 15: Informative Public SpeakingChapter 15: Informative Public Speaking
Chapter 15: Informative Public Speaking
 
New Microsoft Office Power Point Presentation
New Microsoft Office Power Point PresentationNew Microsoft Office Power Point Presentation
New Microsoft Office Power Point Presentation
 
Chapter 11 - Public Speaking Planning The Message
Chapter 11 - Public Speaking Planning The MessageChapter 11 - Public Speaking Planning The Message
Chapter 11 - Public Speaking Planning The Message
 
Chapter 16: Persuasive Public Speaking
Chapter 16: Persuasive Public SpeakingChapter 16: Persuasive Public Speaking
Chapter 16: Persuasive Public Speaking
 
Poluare
PoluarePoluare
Poluare
 

Ähnlich wie Hachiojipm31

#phpmatsuri LT大会システムの中身
#phpmatsuri LT大会システムの中身#phpmatsuri LT大会システムの中身
#phpmatsuri LT大会システムの中身Hisateru Tanaka
 
Elasticsearch for Hackadoll
Elasticsearch for HackadollElasticsearch for Hackadoll
Elasticsearch for Hackadollmosa siru
 
ブラウザ自動化ツール カオスマップ風 - STAC2018 LT
ブラウザ自動化ツール カオスマップ風 - STAC2018 LTブラウザ自動化ツール カオスマップ風 - STAC2018 LT
ブラウザ自動化ツール カオスマップ風 - STAC2018 LThnisiji
 
PythonとRによるデータ分析環境の構築と機械学習によるデータ認識
PythonとRによるデータ分析環境の構築と機械学習によるデータ認識PythonとRによるデータ分析環境の構築と機械学習によるデータ認識
PythonとRによるデータ分析環境の構築と機械学習によるデータ認識Katsuhiro Morishita
 
Python札幌201406
Python札幌201406Python札幌201406
Python札幌201406Shinya Okano
 
インドのインターネット環境 との戦い方
インドのインターネット環境との戦い方インドのインターネット環境との戦い方
インドのインターネット環境 との戦い方健一 辰濱
 
Caffeでお手軽本格ディープラーニングアプリ @potatotips
Caffeでお手軽本格ディープラーニングアプリ @potatotipsCaffeでお手軽本格ディープラーニングアプリ @potatotips
Caffeでお手軽本格ディープラーニングアプリ @potatotipsTakuya Matsuyama
 
20190531 「運用自動化」のモデルを考える
20190531 「運用自動化」のモデルを考える20190531 「運用自動化」のモデルを考える
20190531 「運用自動化」のモデルを考えるYoshikazu GOTO
 
Pythonでジョブキューシステムを作った
Pythonでジョブキューシステムを作ったPythonでジョブキューシステムを作った
Pythonでジョブキューシステムを作ったRyota Suenaga
 
SaCSS vol.63 動的なサイトの開発でgulpとBrowserSyncを使ってみる
SaCSS vol.63 動的なサイトの開発でgulpとBrowserSyncを使ってみるSaCSS vol.63 動的なサイトの開発でgulpとBrowserSyncを使ってみる
SaCSS vol.63 動的なサイトの開発でgulpとBrowserSyncを使ってみるMasashi Murakami
 
2018年度オフシーズンにやったこと
2018年度オフシーズンにやったこと2018年度オフシーズンにやったこと
2018年度オフシーズンにやったことRyogaSato2
 
20150808 osc関西@京都
20150808 osc関西@京都20150808 osc関西@京都
20150808 osc関西@京都Takayuki Gondoh
 
Infrastructure as code ~ ツールスタック / ヌーラボの事例 ~
Infrastructure as code ~ ツールスタック / ヌーラボの事例 ~Infrastructure as code ~ ツールスタック / ヌーラボの事例 ~
Infrastructure as code ~ ツールスタック / ヌーラボの事例 ~ikikko
 
Pythonではじめる野球プログラミング PyCon JP 2014 9/14 Talk Session
Pythonではじめる野球プログラミング PyCon JP 2014 9/14 Talk SessionPythonではじめる野球プログラミング PyCon JP 2014 9/14 Talk Session
Pythonではじめる野球プログラミング PyCon JP 2014 9/14 Talk SessionShinichi Nakagawa
 
地球地図を利用した地図タイルの作成 - FOSS4G TOKYO 2014 全体セッション2
地球地図を利用した地図タイルの作成 - FOSS4G TOKYO 2014 全体セッション2地球地図を利用した地図タイルの作成 - FOSS4G TOKYO 2014 全体セッション2
地球地図を利用した地図タイルの作成 - FOSS4G TOKYO 2014 全体セッション2Taro Matsuzawa
 
composer-scriptsについて
composer-scriptsについてcomposer-scriptsについて
composer-scriptsについてHiraku Nakano
 
PythonとRによるデータ分析環境の構築と機械学習によるデータ認識 第3版
PythonとRによるデータ分析環境の構築と機械学習によるデータ認識 第3版PythonとRによるデータ分析環境の構築と機械学習によるデータ認識 第3版
PythonとRによるデータ分析環境の構築と機械学習によるデータ認識 第3版Katsuhiro Morishita
 
人が神姫ん感(原文ママ)を感じるコンピュータ
人が神姫ん感(原文ママ)を感じるコンピュータ人が神姫ん感(原文ママ)を感じるコンピュータ
人が神姫ん感(原文ママ)を感じるコンピュータharu2036
 
イベント企画運営の経験と実際 / The history of organizing events by me
イベント企画運営の経験と実際 / The history of organizing events by meイベント企画運営の経験と実際 / The history of organizing events by me
イベント企画運営の経験と実際 / The history of organizing events by mewhywaita
 

Ähnlich wie Hachiojipm31 (20)

#phpmatsuri LT大会システムの中身
#phpmatsuri LT大会システムの中身#phpmatsuri LT大会システムの中身
#phpmatsuri LT大会システムの中身
 
Elasticsearch for Hackadoll
Elasticsearch for HackadollElasticsearch for Hackadoll
Elasticsearch for Hackadoll
 
ブラウザ自動化ツール カオスマップ風 - STAC2018 LT
ブラウザ自動化ツール カオスマップ風 - STAC2018 LTブラウザ自動化ツール カオスマップ風 - STAC2018 LT
ブラウザ自動化ツール カオスマップ風 - STAC2018 LT
 
PythonとRによるデータ分析環境の構築と機械学習によるデータ認識
PythonとRによるデータ分析環境の構築と機械学習によるデータ認識PythonとRによるデータ分析環境の構築と機械学習によるデータ認識
PythonとRによるデータ分析環境の構築と機械学習によるデータ認識
 
Python札幌201406
Python札幌201406Python札幌201406
Python札幌201406
 
インドのインターネット環境 との戦い方
インドのインターネット環境との戦い方インドのインターネット環境との戦い方
インドのインターネット環境 との戦い方
 
Caffeでお手軽本格ディープラーニングアプリ @potatotips
Caffeでお手軽本格ディープラーニングアプリ @potatotipsCaffeでお手軽本格ディープラーニングアプリ @potatotips
Caffeでお手軽本格ディープラーニングアプリ @potatotips
 
20190531 「運用自動化」のモデルを考える
20190531 「運用自動化」のモデルを考える20190531 「運用自動化」のモデルを考える
20190531 「運用自動化」のモデルを考える
 
Pythonでジョブキューシステムを作った
Pythonでジョブキューシステムを作ったPythonでジョブキューシステムを作った
Pythonでジョブキューシステムを作った
 
SaCSS vol.63 動的なサイトの開発でgulpとBrowserSyncを使ってみる
SaCSS vol.63 動的なサイトの開発でgulpとBrowserSyncを使ってみるSaCSS vol.63 動的なサイトの開発でgulpとBrowserSyncを使ってみる
SaCSS vol.63 動的なサイトの開発でgulpとBrowserSyncを使ってみる
 
2018年度オフシーズンにやったこと
2018年度オフシーズンにやったこと2018年度オフシーズンにやったこと
2018年度オフシーズンにやったこと
 
圏論walker
圏論walker圏論walker
圏論walker
 
20150808 osc関西@京都
20150808 osc関西@京都20150808 osc関西@京都
20150808 osc関西@京都
 
Infrastructure as code ~ ツールスタック / ヌーラボの事例 ~
Infrastructure as code ~ ツールスタック / ヌーラボの事例 ~Infrastructure as code ~ ツールスタック / ヌーラボの事例 ~
Infrastructure as code ~ ツールスタック / ヌーラボの事例 ~
 
Pythonではじめる野球プログラミング PyCon JP 2014 9/14 Talk Session
Pythonではじめる野球プログラミング PyCon JP 2014 9/14 Talk SessionPythonではじめる野球プログラミング PyCon JP 2014 9/14 Talk Session
Pythonではじめる野球プログラミング PyCon JP 2014 9/14 Talk Session
 
地球地図を利用した地図タイルの作成 - FOSS4G TOKYO 2014 全体セッション2
地球地図を利用した地図タイルの作成 - FOSS4G TOKYO 2014 全体セッション2地球地図を利用した地図タイルの作成 - FOSS4G TOKYO 2014 全体セッション2
地球地図を利用した地図タイルの作成 - FOSS4G TOKYO 2014 全体セッション2
 
composer-scriptsについて
composer-scriptsについてcomposer-scriptsについて
composer-scriptsについて
 
PythonとRによるデータ分析環境の構築と機械学習によるデータ認識 第3版
PythonとRによるデータ分析環境の構築と機械学習によるデータ認識 第3版PythonとRによるデータ分析環境の構築と機械学習によるデータ認識 第3版
PythonとRによるデータ分析環境の構築と機械学習によるデータ認識 第3版
 
人が神姫ん感(原文ママ)を感じるコンピュータ
人が神姫ん感(原文ママ)を感じるコンピュータ人が神姫ん感(原文ママ)を感じるコンピュータ
人が神姫ん感(原文ママ)を感じるコンピュータ
 
イベント企画運営の経験と実際 / The history of organizing events by me
イベント企画運営の経験と実際 / The history of organizing events by meイベント企画運営の経験と実際 / The history of organizing events by me
イベント企画運営の経験と実際 / The history of organizing events by me
 

Hachiojipm31