2012-01-20 10 views
5

Mac OS X 10.7.2でUbuntu 11.04を実行しています。ランニングシェフサーバー。私の基本的な役割は次のようになりますにもかかわらず、PostgreSQLのコミュニティシェフレシピをインストールしようとするとシェフがapt(apt-get update)レシピを実行していません。 Aptが返信100

、私は次のエラーを取得する、(私はapt-getを更新しようとする傾向のレシピを追加しました):

name "base" 
description "The base role for systems" 
run_list(
     "recipe[apt]", 
     "recipe[vim]" 
) 

私は手動でシェフ・クライアントは問題なくpostgresのインストールの別の実行を行うと、サーバ内部からの$須藤はapt-getの更新を行う場合

$ vagrant reload db1dev 
[db1dev] Attempting graceful shutdown of linux... 
[db1dev] Preparing host only network... 
[db1dev] Clearing any previously set forwarded ports... 
[db1dev] Forwarding ports... 
[db1dev] -- ssh: 22 => 2222 (adapter 1) 
[db1dev] Cleaning previously set shared folders... 
[db1dev] Creating shared folders metadata... 
[db1dev] Running any VM customizations... 
[db1dev] Booting VM... 
[db1dev] Waiting for VM to boot. This can take a few minutes. 
[db1dev] VM booted and ready for use! 
[db1dev] Enabling host only network... 
[db1dev] Mounting shared folders... 
[db1dev] -- v-root: /vagrant 
[db1dev] Running provisioner: Vagrant::Provisioners::ChefClient... 
[db1dev] Creating folder to hold client key... 
[db1dev] Uploading chef client validation key... 
[db1dev] Generating chef JSON and uploading... 
[db1dev] Running chef-client... 
[db1dev] stdin: is not a tty 
: stderr 
[db1dev] [Thu, 19 Jan 2012 21:44:45 -0800] INFO: *** Chef 0.10.2 *** 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:46 -0800] INFO: Client key /etc/chef/client.pem is not present - registering 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:46 -0800] INFO: HTTP Request Returned 404 Not Found: Cannot load node dev-vagrant-db1-andres 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Setting the run_list to ["role[base]", "role[db_master]"] from JSON 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Run List is [role[base], role[db_master]] 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Run List expands to [base_server, vim, postgresql::server] 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Starting Chef Run for dev-vagrant-db1-andres 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Loading cookbooks [base_server, openssl, postgresql, vim] 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/resources/repository.rb from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/metadata.rb from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/providers/repository.rb from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/recipes/cacher.rb from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/recipes/cacher-client.rb from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/recipes/default.rb from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/metadata.json from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Removing cookbooks/apt/README.md from the cache; its cookbook is no longer needed on this client. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Storing updated cookbooks/base_server/recipes/default.rb in the cache. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Storing updated cookbooks/base_server/README.rdoc in the cache. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Storing updated cookbooks/base_server/metadata.rb in the cache. 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:47 -0800] INFO: Processing package[postgresql-client] action install (postgresql::client line 37) 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:48 -0800] ERROR: package[postgresql-client] (postgresql::client line 37) has had an error 
[Thu, 19 Jan 2012 21:44:48 -0800] ERROR: Running exception handlers 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:48 -0800] FATAL: Saving node information to /srv/chef/file_store/failed-run-data.json 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:48 -0800] ERROR: Exception handlers complete 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:48 -0800] FATAL: Stacktrace dumped to /srv/chef/file_store/chef-stacktrace.out 
: stdout 
[db1dev] [Thu, 19 Jan 2012 21:44:48 -0800] FATAL: Chef::Exceptions::Exec: package[postgresql-client] (postgresql::client line 37) had an error: apt-get -q -y install postgresql-client=8.4.8-0ubuntu0.10.04 returned 100, expected 0 
: stdout 
The following SSH command responded with a non-zero exit status. 
Vagrant assumes that this means the command failed! 

chef-client -c /etc/chef/client.rb -j /etc/chef/dna.json 

The output of the command prior to failing is outputted below: 

[no output] 

:シェフの実行を行うことをしようとしています。 aptレシピが実行されていない理由に関するアイデアはありますか? (私は、apt-getのタイムスタンプファイルがubuntuで作られていないため、実行していないことも知っています)。どんな助けでも大歓迎です。

答えて

6

だから、あなたが印刷されたエラーから、

apt-get -q -y install postgresql-client=8.4.8-0ubuntu0.10.04 

コマンドを実行しているが失敗しているようです。

は、しかし、あなたは

apt-get update 

まず実行し、その後、再プロビジョニングた場合、それが正常に動作することを言いましたか?

あなたがシェフを初めて実行するとき、あなたがリクエストしているpostgresqlクライアントのバージョンは、ダウンロードしたaptパッケージのリストにはないが、apt-get updateを実行するとそのバージョンが見つかります。

まず、base_serverレシピが実行されていることがわかります。リストにaptリポジトリを追加していますか?

ポストグルレシピを実行する前にapt-get updateを実行することをお勧めしますが、これはおそらく私が考えると思われるbase_serverレシピに入れるのに適していると思われます。

+5

おかげさまで、それは適切なレシピがするはずです。質問は「適切なレシピがそれをやっているにもかかわらず更新されないのはなぜですか?」 – Andres

+0

https://github.com/opscode/cookbooks/blob/master/apt/のレシピを使用していますか?レシピ/ default.rb?もしそうなら、これは他のレシピからapt-get-updateを呼び出す機能を設定します(29行目のコメントに注意してください)。しかし、このレシピが33行目の 'action:nothing'に対して実行されたときにはコールを実行しません。 –

+2

レシピ実行後にapt-get updateを実行する例は、https://github.com/opscode/cookbooks/blob/master/rsyslog/recipes/default.rb#L28 –

関連する問題