2014-05-01 64 views
1

因此,我正在UBnuntu 12.04上用CheT-Solo在Linux上運行Linux操作系統。我的最終目標是使用廚師部署Islandora/Drupal的實例。但是,目前,我並沒有取得太大的成功。下面是我運行命令:刀獨奏廚師命令無法正常工作

knife solo prepare [user name]@[server name] 

,給了我這樣的輸出:

WARNING: No knife configuration file found 
Bootstrapping Chef... 
Enter the password for [email protected]: 
% Total % Received % Xferd Average Speed Time Time  Time Current 
          Dload Upload Total Spent Left Speed 
100 15934 100 15934 0  0 47449  0 --:--:-- --:--:-- --:--:-- 70504 

Downloading Chef 11.12.2 for ubuntu... 
downloading https://www.opscode.com  /chef/metadata?v=11.12.2&prerelease=false& 
nightlies=false&p=ubuntu&pv=12.04&m=x86_64 
    to file /tmp/install.sh.14381/metadata.txt 
trying wget... 
url  https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef_11.12.2-1_amd64.deb 
md5  cedd8a2df60a706e51f58adf8441971b 
sha256 af53e7ef602be6228dcbf68298e2613d3f37eb061975992abc6cd2d318e4a0c0 
downloaded metadata file looks valid... 
    downloading https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.0/x86_64/chef_11.12.2-1_amd64.deb 
    to file /tmp/install.sh.14381/chef_11.12.2-1_amd64.deb 
trying wget... 
Comparing checksum with sha256sum... 
Installing Chef 11.12.2 
installing with dpkg... 
(Reading database ... 72031 files and directories currently installed.) 
Preparing to replace chef 11.12.2-1 (using .../chef_11.12.2-1_amd64.deb) ... 
Unpacking replacement chef ... 
Setting up chef (11.12.2-1) ... 
Thank you for installing Chef! 
Generating node config 'nodes/giada.json'... 

後來,當我運行此:

knife solo cook [user name]@[server name] 

...我得到這個:

WARNING: No knife configuration file found 
WARNING: solo.rb found, but since knife-solo v0.3.0 it is not used any more 
WARNING: Please read the upgrade instructions: https://github.com/matschaffer/knife-solo/wiki/Upgrading-to-0.3.0 
Running Chef on [server name]... 
Checking Chef version... 
Enter the password for [user name]@[server name]: 
Uploading the kitchen... 
[user name]@[server name]'s password: 
WARNING: Local cookbook_path '/etc/chef/cookbooks' does not exist 
[user name]@[server name]'s password: 
[user name]@[server name]'s password: 
WARNING: Local role_path './roles' does not exist 
WARNING: Local data_bag_path './data_bags' does not exist 
WARNING: Local environment_path './environments' does not exist 
Generating solo config... 
[user name]@[server name]'s password: 
Running Chef... 

[2014-05-01T12:56:51-04:00] WARN: 
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
SSL validation of HTTPS requests is disabled. HTTPS connections are still 
encrypted, but chef is not able to detect forged replies or man in the middle 
attacks. 

To fix this issue add an entry like this to your configuration file: 

``` 
    # Verify all HTTPS connections (recommended) 
    ssl_verify_mode :verify_peer 

    # OR, Verify only connections to chef-server 
    verify_api_cert true 
``` 

To check your SSL configuration, or troubleshoot errors, you can use the 
`knife ssl check` command like so: 

``` 
    knife ssl check -c /home/biblio/chef-solo/solo.rb 
``` 

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 

Starting Chef Client, version 11.12.2 
Compiling Cookbooks... 
Converging 0 resources 

Running handlers: 
Running handlers complete 

Chef Client finished, 0/0 resources updated in 2.278793398 seconds 

在上述情況下,我操作的根。根據Opscode的文檔,所有東西都應該在這裏。但是按照我的想法,這些警告告訴我一些事情不該如此。有人可以告訴我我錯過了什麼嗎?謝謝!

回答

1

在您正在運行knife solo命令的文件夾中,您需要使用刀具配置文件創建另一個隱藏文件夾。又名

.chef/knife.rb - 這必須包括您的刀具設置。這是我的。正如你所看到的,我正在使用環境變量(ENV),所以我在不暴露祕密的情況下檢查這個版本控制。要在OSX或Linux中執行此操作,需要編輯〜/ .bash_profile和每個變量;

export AWS_ACCESS_KEY_ID=REAL_KEY_GOES_HERE 

然後通過運行source〜/ .bash_profile來源代碼。

另外一個有用的準備參數是--run-list'role [role-name]',因此它會在您運行cook時自動使用正確的角色。

0

我曾經有過這個錯誤,因爲我的dna.json是錯誤的。一些雙引號不匹配。所以我首先嚐試了他們的建議(將ssl_verify_mode:verify_peer添加到配置文件中),這並沒有什麼區別;那麼我知道這個消息只是誤導。