LoginSignup
0
0

More than 5 years have passed since last update.

Chefを使ってGCEでpostgresqlのインストールに失敗する時の対処方法

Last updated at Posted at 2015-01-16

Google Compute Engineでpostgresqlクックブックを使ってインストールしようとすると失敗する。
原因はapt-get updateの実行が抑制されていて、あらかじめapt-get updateを実行しておくとできる。

レシピファイルで何とかしたい場合は以下のようにする。

include_recipe 'postgresql::server'
execute('apt-get update').run_action(:run)

解説

クックブックをみていくとaptクックブックに定義されているexecute 'apt-get update'の実行を抑制する処理が入っている。

  if platform_family?('ubuntu', 'debian')
    e = execute 'apt-get update' do
      action :nothing
    end
    e.run_action(:run) unless ::File.exists?('/var/lib/apt/periodic/update-success-stamp')
  end

/var/lib/apt/periodic/update-success-stampがある場合、無条件でapt-get updateが実行されなくなってしまっている。
自分のレシピファイルで再度上書きすることで対処している。

0
0
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
0
0