我是很新廚師和一個新鮮的vm的Ubuntu 12我玩弄廚師獨奏。在關於這個主題的一些博客教程之後,我決定在我的虛擬機上通過配方安裝ntp服務。在經歷了讓vm安裝ruby,rubygems和最後的廚師的引導過程之後,初始的ntp運行似乎運行正常。在運行之前,pgrep ntpd會返回空白,運行後同樣的命令會返回一個進程id。但仔細檢查/etc/ntp.conf文件後,我意識到它並未使用我的配方中定義的此文件的模板版本。經過進一步的調查,我開始測試這個理論,即我的ntp配方在廚師獨奏中沒有被提及。我將我的cookbooks/ntp目錄改名爲cookbooks/ntp_foo。然而,引用它的基本配方完全滿足於此,並着手安裝ntp服務。是否有某些服務在「核心」廚師安裝中定義了食譜?這是我設置的佈局:廚師獨奏是否安裝ntp而沒有配方?
solo.rb
root = File.absolute_path(File.dirname(__FILE__))
data_bag_path root + '/data-bags'
file_cache_path root
cookbook_path [root + '/cookbooks', root + '/site-cookbooks']
solo.json
"run_list": [
"recipe[base]"
]
站點食譜/食譜/基/ default.rb
package 'ntp'
的cookbooks/ntp
食譜不是自己創建的,但似乎是有效的,它只是沒有被調用。
編輯
添加日誌:
[Sat, 02 Jun 2012 22:25:13 -0700] INFO: *** Chef 0.10.10 ***
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: Building node object for mike-VirtualBox
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: Extracting run list from JSON attributes provided on command line
[Sat, 02 Jun 2012 22:25:14 -0700] INFO: Setting the run_list to ["recipe[base]"] from JSON
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: Applying attributes from json file
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: Platform is ubuntu version 12.04
[Sat, 02 Jun 2012 22:25:14 -0700] INFO: Run List is [recipe[base]]
[Sat, 02 Jun 2012 22:25:14 -0700] INFO: Run List expands to [base]
[Sat, 02 Jun 2012 22:25:14 -0700] INFO: Starting Chef Run for mike-VirtualBox
[Sat, 02 Jun 2012 22:25:14 -0700] INFO: Running start handlers
[Sat, 02 Jun 2012 22:25:14 -0700] INFO: Start handlers complete.
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: No chefignore file found at /tmp/chef/site-cookbooks/chefignore no files will be ignored
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: Loading Recipe base via include_recipe
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: Found recipe default in cookbook base
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: Platform ubuntu not found, using all defaults. (Unsupported platform?)
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: Loading from cookbook_path: /tmp/chef/site-cookbooks
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: Converging node mike-VirtualBox
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: Processing package[ntp] on mike-VirtualBox
[Sat, 02 Jun 2012 22:25:14 -0700] INFO: Processing package[ntp] action install (base::default line 3)
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: package[ntp] checking package status for ntp
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: package[ntp] current version is nil
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: package[ntp] candidate version is 1:4.2.6.p3+dfsg-1ubuntu3
[Sat, 02 Jun 2012 22:25:14 -0700] DEBUG: Executing apt-get -q -y install ntp=1:4.2.6.p3+dfsg-1ubuntu3
[Sat, 02 Jun 2012 22:25:21 -0700] DEBUG: ---- Begin output of apt-get -q -y install ntp=1:4.2.6.p3+dfsg-1ubuntu3 ----
[Sat, 02 Jun 2012 22:25:21 -0700] DEBUG: STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
ntp-doc
The following NEW packages will be installed:
ntp
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/570 kB of archives.
After this operation, 1,368 kB of additional disk space will be used.
Selecting previously unselected package ntp.
(Reading database ... 171196 files and directories currently installed.)
Unpacking ntp (from .../ntp_1%3a4.2.6.p3+dfsg-1ubuntu3_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up ntp (1:4.2.6.p3+dfsg-1ubuntu3) ...
* Starting NTP server ntpd
...done.
上什麼可能會在任何想法?謝謝!
希望你仍然收到這個。你如何運行廚師獨奏?我已經設置了自己,我的命令仍然找不到我的食譜。我正在使用與您的類似的solo.rb文件,現在我正在使用與您的文件完全相同的文件,但出現錯誤,說它找不到運行列表中第一項的食譜。我需要一個基本配方嗎?我應該把它放在哪裏?我只有cookbooks目錄,沒有site_cookbooks目錄。 – nroose