Your SlideShare is downloading. ×
Hachiojipm31
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Hachiojipm31

278
views

Published on


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
278
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. fabric Hachioji.pm #31 @equinox79 1
  • 2. 自己紹介 •@equinox79 •位置情報系のシステムやってます •GPS測位データの分析システム •スマホアプリも少々 2
  • 3. ある日 •「Zabbixのエージェントを入れて欲し いんですけどー」 •「いいですよーどのサーバですか?」 •「これですーズラズラ、、(30台ぐら い)」 •「え」 3
  • 4. めんどい •「あ、あれだ、、、最近流行りのアレ を使おう、、」 4
  • 5. chefを調べる 5
  • 6. •凄く良く出来てるけど、こういうのに 興味ない人にまで使わせるにはちょっ と厳しい・・・ 感想 6
  • 7. http://hozumi.github.io/2013/03/chef-fabric-ja.html 7
  • 8. fabric •python製のデプロイツール •https://github.com/fabric/fabric •http://docs.fabfile.org/en/1.7/ 8
  • 9. 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
  • 10. •run() ... コマンド実行 •local() ... ローカルで実行 •put() / get() ... scp •with構文 とりあえず 10
  • 11. 実行時 $ fab develop hello_fab 11
  • 12. 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
  • 13. 関連ツール • cuisine • fabricにchefライクな機能を追加 • https://github.com/sebastien/cuisine • envassert • fabricでserverspecみたいな事ができるみたい • http://tdoc.info/blog/2013/05/14/envassert.html 13