0
私は今、非常に基本的なレシピを持っています。シェフのレシピが2回実行されるのはなぜですか?
include_recipe 'apache2'
Chef::Log.info(node[:inewebapp][:apache]);
node[:inewebapp][:apache].each do |vhost|
Chef::Log.info("Currently on host #{vhost['docroot_dir']}");
end
私が把握しようとしている - テストキッチンでこれを構築しながら - 私は私のレシピが複数回実行されているように、ログメッセージを得るのですか?
この
は私が持っているkitchen converge server
Installing Cookbook Gems:
Compiling Cookbooks...
/tmp/kitchen/cache/cookbooks/hostsfile/resources/entry.rb:35: warning: constant ::Fixnum is deprecated
[2017-07-19T15:36:05+00:00] INFO: [{"docroot_dir"=>"/var/www/host1", "server_name"=>"host1"}, {"docroot_dir"=>"/var/www/host2", "server_name"=>"host2"}]
[2017-07-19T15:36:05+00:00] INFO: [{"docroot_dir"=>"/var/www/host1", "server_name"=>"host1"}, {"docroot_dir"=>"/var/www/host2", "server_name"=>"host2"}]
[2017-07-19T15:36:05+00:00] INFO: Currently on host /var/www/host1
[2017-07-19T15:36:05+00:00] INFO: Currently on host /var/www/host1
[2017-07-19T15:36:05+00:00] INFO: Currently on host /var/www/host2
[2017-07-19T15:36:05+00:00] INFO: Currently on host /var/www/host2
の出力である無
attributes/default.rb
ファイルが空でないと、私の
.kitchen.yml
は、私は私のレシピが冪等する必要があります知っているこの
---
driver:
name: vagrant
provisioner:
name: chef_zero
product_name: chef
product_version: 13.0.118
log_level: info
verifier:
name: inspec
platforms:
- name: ubuntu-16.04
suites:
- name: server
run_list:
- recipe[apt]
- recipe[ine-webapp::apache]
verifier:
inspec_tests:
- test/integration/server
attributes:
inewebapp:
user: 'vagrant'
apache:
- docroot_dir: /var/www/host1
server_name: host1
- docroot_dir: /var/www/host2
server_name: host2
のように見えますが、私はありませんよなぜ私のレシピが2回実行されているのでしょうか?
更新
より慎重に私のkitchen converge server
それはシェフ・クライアントの複数のインスタンスのように見えますが実行されているの出力を調べた後?それでも理解していないのですか?
Transferring files to <server-ubuntu-1604>
[2017-07-19T15:58:59+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /tmp/kitchen, /tmp/kitchen
One version per cookbook
[2017-07-19T15:58:59+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /tmp/kitchen, /tmp/kitchen
One version per cookbook
[2017-07-19T15:58:59+00:00] INFO: Forking chef instance to converge...
[2017-07-19T15:58:59+00:00] INFO: Forking chef instance to converge...
Starting Chef Client, version 13.0.118
[2017-07-19T15:58:59+00:00] INFO: *** Chef 13.0.118 ***
[2017-07-19T15:58:59+00:00] INFO: *** Chef 13.0.118 ***
[2017-07-19T15:58:59+00:00] INFO: Platform: x86_64-linux
[2017-07-19T15:58:59+00:00] INFO: Platform: x86_64-linux
[2017-07-19T15:58:59+00:00] INFO: Chef-client pid: 14491
[2017-07-19T15:58:59+00:00] INFO: Chef-client pid: 14491
[2017-07-19T15:58:59+00:00] INFO: The plugin path /etc/chef/ohai/plugins does not exist. Skipping...
[2017-07-19T15:58:59+00:00] INFO: The plugin path /etc/chef/ohai/plugins does not exist. Skipping...
[2017-07-19T15:59:00+00:00] INFO: Setting the run_list to ["recipe[apt]", "recipe[ine-webapp::apache]"] from CLI options
[2017-07-19T15:59:00+00:00] INFO: Setting the run_list to ["recipe[apt]", "recipe[ine-webapp::apache]"] from CLI options
[2017-07-19T15:59:00+00:00] INFO: Run List is [recipe[apt], recipe[ine-webapp::apache]]
[2017-07-19T15:59:00+00:00] INFO: Run List is [recipe[apt], recipe[ine-webapp::apache]]
[2017-07-19T15:59:00+00:00] INFO: Run List expands to [apt, ine-webapp::apache]
[2017-07-19T15:59:00+00:00] INFO: Run List expands to [apt, ine-webapp::apache]
[2017-07-19T15:59:00+00:00] INFO: Starting Chef Run for server-ubuntu-1604
[2017-07-19T15:59:00+00:00] INFO: Starting Chef Run for server-ubuntu-1604
[2017-07-19T15:59:00+00:00] INFO: Running start handlers
[2017-07-19T15:59:00+00:00] INFO: Running start handlers
[2017-07-19T15:59:00+00:00] INFO: Start handlers complete.
[2017-07-19T15:59:00+00:00] INFO: Start handlers complete.
resolving cookbooks for run list: ["apt", "ine-webapp::apache"]
インスタンスは1つだけ私たちは、デバッグに十分に一貫性がないように見えるだけであること、まだ二重の伐採の原因がわからない:(あなた場合私の台所リスト
chef-repo/cookbooks/ine-webapp$ kitchen list
Instance Driver Provisioner Verifier Transport Last Action Last Error
server-ubuntu-1604 Vagrant ChefZero Inspec Ssh Converged <None>