LoginSignup
5
5

More than 5 years have passed since last update.

ChefでPearパッケージをインストールする話(まずそんなニーズ無い)(社内環境でよくある話)

Last updated at Posted at 2014-06-25

これは何?

社内環境(Proxy環境下)のサーバにChefでPearパッケージをインストールする話。
Composerあるんだから滅多にニーズの無い話なんだけど、たまたまやる機会があったので忘れないようにメモ。

結論:pear config-set http_proxyでProxyを刺してあげましょう。

recipeの中でコマンド発行してあげればOK。

recipe/default.rb
execute 'install-pearなんたら' do
  command 'pear config-set http_proxy http://${USER}:${PASSWORD}@${PROXY_HOST}:${PROXY_PORT}'
  command 'pear config-set auto_discover 1 && pear install hoge/fuga'
  not_if  { File.exists?('/usr/bin/phpfuga') }
end
5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5