fabric parallel modeでsudoを使うとき
2月 5th, 2013
Fatal error: Needed to prompt for a connection or sudo password, but input would be ambiguous in parallel mode パラレルモードだと、どっちのパスワードかわからなくなるよ。と オプションでパスワードを付ける fab production init_deploy -p pass
fabric 環境切替
11月 29th, 2012
こんな感じで env.roledefs={} env.roledefs_dev = { ‘proxy':['192.168.0.100'] } env.roledefs_prod = { ‘proxy':['192.168.1.99'] } env.development = True def dev(): env.roledefs = env.roledefs_dev def production(): env.development = False env.roledefs = env.roledefs_prod @roles(‘proxy’) def print_proxy(): print env.host で $ fab dev print_proxy 192.168.0.100 こんな感じで、ちゃんとrolesが反映されました。
fabric でデプロイ&システム設定
11月 20th, 2012
fabricでデプロイ http://docs.fabfile.org/en/1.5/ 関係ないけど、スクリプトをpythonで書く方針にしたので fabricを使ってみます。 python 2.6.6 Fabric is a Python (2.5 or higher) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks. と書いてあるので、現在シェルで書いてある部分の設定などもfabricにしてしまおうと思います。 インストール http://docs.fabfile.org/en/1.5/installation.html $ sudo pip-python install fabric Successfully installed fabric paramiko pycrypto Cleaning up… warningいっぱい出たけど・・・ チュートリアル http://docs.fabfile.org/en/1.5/tutorial.html fabfile.py def hello(): print(“hello world”) $ fab hello hello […]