[root@CentOS7 chef]# chef generate cookbook cookbooks/hello
Generating cookbook hello
[2020-06-07T20:22:43+09:00] INFO: The plugin path /etc/chef/ohai/plugins does not exist. Skipping…
– Ensuring correct cookbook file content
– Ensuring delivery configuration
– Ensuring correct delivery build cookbook content
Your cookbook is ready. Type `cd cookbooks/hello` to enter it.
There are several commands you can run to get started locally developing and testing your cookbook.
Type `delivery local –help` to see a full list.
Why not start by writing a test? Tests for the default recipe are stored at:
test/smoke/default/default_test.rb
If you’d prefer to dive right in, the default recipe can be found at:
recipes/default.rb
[root@CentOS7 chef]#
デフォルトのレシピ(recipe)(default.rb)があるディレクトリに移動します。
[root@CentOS7 chef]# cd cookbooks/hello/recipes/
[root@CentOS7 recipes]# ls
default.rb
レシピ(recipe)を作成します。
[root@CentOS7 recipes]# vi default.rb
#
# Cookbook:: hello
# Recipe:: default
#
# Copyright:: 2020, The Authors, All Rights Reserved.
log “Hello World!” ← この1行を追加します。
作成したレシピを chef-solo コマンドで実行する
作成したレシピを chef-solo コマンドで実行します。
[root@CentOS7 recipes]# chef-solo -o hello
[2020-06-07T20:24:42+09:00] WARN: *****************************************
[2020-06-07T20:24:42+09:00] WARN: Did not find config file: /etc/chef/solo.rb, using command line options.
[2020-06-07T20:24:42+09:00] WARN: *****************************************
[2020-06-07T20:24:42+09:00] WARN: *****************************************
[2020-06-07T20:24:42+09:00] WARN: Did not find config file: /etc/chef/client.rb, using command line options.
[2020-06-07T20:24:42+09:00] WARN: *****************************************
[2020-06-07T20:24:42+09:00] INFO: Forking chef instance to converge…
Starting Chef Client, version 12.21.2
[2020-06-07T20:24:43+09:00] INFO: *** Chef 12.21.2 ***
[2020-06-07T20:24:43+09:00] INFO: Platform: x86_64-linux
[2020-06-07T20:24:43+09:00] INFO: Chef-client pid: 6284
[2020-06-07T20:24:43+09:00] INFO: The plugin path /etc/chef/ohai/plugins does not exist. Skipping…
[2020-06-07T20:24:45+09:00] WARN: Run List override has been provided.
[2020-06-07T20:24:45+09:00] WARN: Original Run List: []
[2020-06-07T20:24:45+09:00] WARN: Overridden Run List: [recipe[hello]]
[2020-06-07T20:24:45+09:00] INFO: Run List is [recipe[hello]]
[2020-06-07T20:24:45+09:00] INFO: Run List expands to [hello]
[2020-06-07T20:24:45+09:00] INFO: Starting Chef Run for CentOS7
[2020-06-07T20:24:45+09:00] INFO: Running start handlers
[2020-06-07T20:24:45+09:00] INFO: Start handlers complete.
[2020-06-07T20:24:45+09:00] INFO: HTTP Request Returned 404 Not Found: Object not found:
resolving cookbooks for run list: [“hello”]
[2020-06-07T20:24:45+09:00] INFO: Loading cookbooks [hello@0.1.0]
[2020-06-07T20:24:45+09:00] INFO: Skipping removal of obsoleted cookbooks from the cache
Synchronizing Cookbooks:
[2020-06-07T20:24:45+09:00] INFO: Storing updated cookbooks/hello/metadata.rb in the cache.
[2020-06-07T20:24:45+09:00] INFO: Storing updated cookbooks/hello/recipes/default.rb in the cache.
[2020-06-07T20:24:45+09:00] INFO: Storing updated cookbooks/hello/Berksfile in the cache.
[2020-06-07T20:24:45+09:00] INFO: Storing updated cookbooks/hello/chefignore in the cache.
[2020-06-07T20:24:45+09:00] INFO: Storing updated cookbooks/hello/.kitchen.yml in the cache.
[2020-06-07T20:24:45+09:00] INFO: Storing updated cookbooks/hello/.gitignore in the cache.
– hello (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks…
[2020-06-07T20:24:45+09:00] INFO: HTTP Request Returned 404 Not Found: Object not found:
Converging 1 resources
Recipe: hello::default
* log[Hello World!] action write[2020-06-07T20:24:45+09:00] INFO: Processing log[Hello World!] action write (hello::default line 7)
[2020-06-07T20:24:45+09:00] INFO: Hello World! ← Hello World! のログが出力されています。
[2020-06-07T20:24:45+09:00] WARN: Skipping final node save because override_runlist was given
[2020-06-07T20:24:45+09:00] INFO: Chef Run complete in 0.057830797 seconds
[2020-06-07T20:24:45+09:00] INFO: Skipping removal of unused files from the cache
[root@CentOS7 chef]# chef generate cookbook cookbooks/bind-utils
Hyphens are discouraged in cookbook names as they may cause problems with custom resources. See https://docs.chef.io/ctl_chef.html#chef-generate-cookbook for more information.
Generating cookbook bind-utils
[2020-06-07T20:29:16+09:00] INFO: The plugin path /etc/chef/ohai/plugins does not exist. Skipping…
– Ensuring correct cookbook file content
– Ensuring delivery configuration
– Ensuring correct delivery build cookbook content
Your cookbook is ready. Type `cd cookbooks/bind-utils` to enter it.
There are several commands you can run to get started locally developing and testing your cookbook.
Type `delivery local –help` to see a full list.
Why not start by writing a test? Tests for the default recipe are stored at:
test/smoke/default/default_test.rb
If you’d prefer to dive right in, the default recipe can be found at:
recipes/default.rb
[root@CentOS7 chef]#
レシピを編集します。
[root@CentOS7 chef]# cd cookbooks/bind-utils/recipes/
[root@CentOS7 recipes]# vi default.rb
#
# Cookbook:: bind-utils
# Recipe:: default
#
# Copyright:: 2020, The Authors, All Rights Reserved.
package “bind-utils” do ← 以下、追加します。 action :install end
chef-solo コマンドを実行します。
[root@CentOS7 recipes]# chef-solo -o bind-utils
[2020-06-07T20:31:55+09:00] WARN: *****************************************
[2020-06-07T20:31:55+09:00] WARN: Did not find config file: /etc/chef/solo.rb, using command line options.
[2020-06-07T20:31:55+09:00] WARN: *****************************************
[2020-06-07T20:31:55+09:00] WARN: *****************************************
[2020-06-07T20:31:55+09:00] WARN: Did not find config file: /etc/chef/client.rb, using command line options.
[2020-06-07T20:31:55+09:00] WARN: *****************************************
[2020-06-07T20:31:55+09:00] INFO: Forking chef instance to converge…
Starting Chef Client, version 12.21.2
[2020-06-07T20:31:55+09:00] INFO: *** Chef 12.21.2 ***
[2020-06-07T20:31:55+09:00] INFO: Platform: x86_64-linux
[2020-06-07T20:31:55+09:00] INFO: Chef-client pid: 6670
[2020-06-07T20:31:55+09:00] INFO: The plugin path /etc/chef/ohai/plugins does not exist. Skipping…
[2020-06-07T20:31:57+09:00] WARN: Run List override has been provided.
[2020-06-07T20:31:57+09:00] WARN: Original Run List: []
[2020-06-07T20:31:57+09:00] WARN: Overridden Run List: [recipe[bind-utils]]
[2020-06-07T20:31:57+09:00] INFO: Run List is [recipe[bind-utils]]
[2020-06-07T20:31:57+09:00] INFO: Run List expands to [bind-utils]
[2020-06-07T20:31:57+09:00] INFO: Starting Chef Run for CentOS7
[2020-06-07T20:31:57+09:00] INFO: Running start handlers
[2020-06-07T20:31:57+09:00] INFO: Start handlers complete.
[2020-06-07T20:31:57+09:00] INFO: HTTP Request Returned 404 Not Found: Object not found:
resolving cookbooks for run list: [“bind-utils”]
[2020-06-07T20:31:57+09:00] INFO: Loading cookbooks [bind-utils@0.1.0]
[2020-06-07T20:31:57+09:00] INFO: Skipping removal of obsoleted cookbooks from the cache
Synchronizing Cookbooks:
[2020-06-07T20:31:57+09:00] INFO: Storing updated cookbooks/bind-utils/metadata.rb in the cache.
[2020-06-07T20:31:57+09:00] INFO: Storing updated cookbooks/bind-utils/Berksfile in the cache.
[2020-06-07T20:31:57+09:00] INFO: Storing updated cookbooks/bind-utils/chefignore in the cache.
[2020-06-07T20:31:57+09:00] INFO: Storing updated cookbooks/bind-utils/.kitchen.yml in the cache.
[2020-06-07T20:31:57+09:00] INFO: Storing updated cookbooks/bind-utils/.gitignore in the cache.
– bind-utils (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks…
[2020-06-07T20:31:57+09:00] INFO: HTTP Request Returned 404 Not Found: Object not found:
Converging 1 resources
Recipe: bind-utils::default
* yum_package[bind-utils] action install[2020-06-07T20:31:57+09:00] INFO: Processing yum_package[bind-utils] action install (bind-utils::default line 7)
[2020-06-07T20:32:06+09:00] INFO: yum_package[bind-utils] installing bind-utils-9.11.4-16.P2.el7_8.6 from updates repository
[2020-06-07T20:32:10+09:00] INFO: yum_package[bind-utils] installed bind-utils at 9.11.4-16.P2.el7_8.6
– install version 9.11.4-16.P2.el7_8.6 of package bind-utils
[2020-06-07T20:32:10+09:00] WARN: Skipping final node save because override_runlist was given
[2020-06-07T20:32:10+09:00] INFO: Chef Run complete in 12.937875698 seconds
[2020-06-07T20:32:10+09:00] INFO: Skipping removal of unused files from the cache
Instance: tl11
Stack: TestStack01
Layer:
TestLayer01
Type: update_custom_cookbooks
Created at: 2020-06-07 07:22:48 UTC Download log file
1 [2020-06-07T07:23:03+00:00] INFO: AWS OpsWorks instance 7617c965-d94c-4bc5-9c67-fc6717a134d9, Agent version 4039-20200430042739, Command: update_custom_cookbooks with id 6dd35faf-f165-4934-b7ad-42de1867deb3
2 [2020-06-07T07:23:04+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /opt/aws/opsworks/current
3 One version per cookbook
4 data_bags at /var/lib/aws/opsworks/data.internal/data_bags
5 nodes at /
6
7 [2020-06-07T07:23:04+00:00] INFO: Forking chef instance to converge…
8 [2020-06-07T07:23:04+00:00] INFO: *** Chef 12.13.37 ***
9 [2020-06-07T07:23:04+00:00] INFO: Platform: x86_64-linux
10 [2020-06-07T07:23:04+00:00] INFO: Chef-client pid: 2748
11 [2020-06-07T07:23:04+00:00] WARN: The plugin path /opt/aws/opsworks/current/plugins does not exist. Skipping…
12 [2020-06-07T07:23:05+00:00] WARN: Run List override has been provided.
13 [2020-06-07T07:23:05+00:00] WARN: Original Run List: []
14 [2020-06-07T07:23:05+00:00] WARN: Overridden Run List: [recipe[aws_opsworks_agent]]
15 [2020-06-07T07:23:05+00:00] INFO: Run List is [recipe[aws_opsworks_agent]]
16 [2020-06-07T07:23:05+00:00] INFO: Run List expands to [aws_opsworks_agent]
17 [2020-06-07T07:23:05+00:00] INFO: Starting Chef Run for tl11.localdomain
18 [2020-06-07T07:23:05+00:00] INFO: Running start handlers
19 [2020-06-07T07:23:05+00:00] INFO: Start handlers complete.
20 [2020-06-07T07:23:05+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found:
21 [2020-06-07T07:23:06+00:00] INFO: Loading cookbooks [aws_opsworks_agent@0.1.0, aws_opsworks_helpers@0.1.0, aws_opsworks_agent_version@1.0.0, aws_opsworks_ebs@2.0.0, aws_opsworks_users@1.0.0, aws_opsworks_system@0.1.0, aws_opsworks_custom_cookbooks@1.0.0, aws_opsworks_custom_run@0.1.0, aws_opsworks_ecs@1.0.0, aws_opsworks_cloudwatchlogs@1.0.0, s3_file@2.6.6]
22 [2020-06-07T07:23:06+00:00] INFO: Skipping removal of obsoleted cookbooks from the cache
23 [2020-06-07T07:23:06+00:00] INFO: Cleaning up 0 from /var/lib/aws/opsworks/chef/
24 [2020-06-07T07:23:06+00:00] INFO: Processing directory[default /var/chef/cookbooks] action delete (aws_opsworks_custom_cookbooks::default line 8)
25 [2020-06-07T07:23:06+00:00] INFO: directory[default /var/chef/cookbooks] deleted /var/chef/cookbooks recursively
26 [2020-06-07T07:23:06+00:00] INFO: Processing directory[/var/chef] action create (aws_opsworks_custom_cookbooks::checkout line 4)
27 [2020-06-07T07:23:06+00:00] INFO: Processing yum_package[git] action install (aws_opsworks_custom_cookbooks::checkout_git line 3)
28 [2020-06-07T07:23:07+00:00] INFO: Processing git[Download Custom Cookbooks] action checkout (aws_opsworks_custom_cookbooks::checkout_git line 32)
29 [2020-06-07T07:23:08+00:00] INFO: git[Download Custom Cookbooks] cloning repo https://github.com/xxxx/test1.git to /var/chef/cookbooks
30 [2020-06-07T07:23:09+00:00] INFO: git[Download Custom Cookbooks] checked out branch: HEAD onto: deploy reference: cc61c5de38339ce8caa56680d0114ef4a16d8c22
31 [2020-06-07T07:23:09+00:00] INFO: git[Download Custom Cookbooks] sending run action to execute[Update custom cookbook Git submodules] (immediate)
32 [2020-06-07T07:23:09+00:00] INFO: Processing execute[Update custom cookbook Git submodules] action run (aws_opsworks_custom_cookbooks::checkout_git line 56)
33 [2020-06-07T07:23:09+00:00] INFO: execute[Update custom cookbook Git submodules] ran successfully
34 [2020-06-07T07:23:09+00:00] INFO: Processing execute[Update custom cookbook Git submodules] action nothing (aws_opsworks_custom_cookbooks::checkout_git line 56)
35 [2020-06-07T07:23:09+00:00] INFO: Processing ruby_block[Move single cookbook contents into appropriate subdirectory] action run (aws_opsworks_custom_cookbooks::checkout line 20)
36 [2020-06-07T07:23:09+00:00] INFO: Processing execute[ensure correct permissions of custom cookbooks] action run (aws_opsworks_custom_cookbooks::checkout line 37)
37 [2020-06-07T07:23:09+00:00] INFO: execute[ensure correct permissions of custom cookbooks] ran successfully
38 [2020-06-07T07:23:09+00:00] INFO: Processing template[/etc/hosts] action create (aws_opsworks_system::hosts line 1)
39 [2020-06-07T07:23:09+00:00] INFO: Processing template[/etc/motd.opsworks-static] action create (aws_opsworks_system::motd line 1)
40 [2020-06-07T07:23:09+00:00] INFO: Processing remote_file[/var/lib/aws/opsworks/cache.internal/chef-12.18.31-1.el7.x86_64.rpm] action create (aws_opsworks_system::chef line 17)
41 [2020-06-07T07:23:10+00:00] INFO: Processing yum_package[chef-client] action upgrade (aws_opsworks_system::chef line 24)
42 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/etc/chef/ohai/hints] action create (aws_opsworks_system::chef line 32)
43 [2020-06-07T07:23:14+00:00] INFO: Processing file[/etc/chef/ohai/hints/ec2.json] action touch (aws_opsworks_system::chef line 37)
44 [2020-06-07T07:23:14+00:00] INFO: file[/etc/chef/ohai/hints/ec2.json] updated atime and mtime to 2020-06-07 07:23:14 +0000
45 [2020-06-07T07:23:14+00:00] INFO: Processing ruby_block[patch ohai platform] action run (aws_opsworks_system::chef line 43)
46 [2020-06-07T07:23:14+00:00] INFO: ruby_block[patch ohai platform] called
47 [2020-06-07T07:23:14+00:00] INFO: Processing log[Cleaning up 0 from /var/chef/runs/] action write (aws_opsworks_system::cleanup line 35)
48 [2020-06-07T07:23:14+00:00] INFO: Cleaning up 0 from /var/chef/runs/
49 [2020-06-07T07:23:14+00:00] INFO: Processing aws_opsworks_custom_run[6dd35faf-f165-4934-b7ad-42de1867deb3] action prepare (aws_opsworks_custom_run::default line 3)
50 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/var/chef] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 75)
51 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/var/chef/runs] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 82)
52 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 87)
53 [2020-06-07T07:23:14+00:00] INFO: directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3] created directory /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3
54 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 92)
55 [2020-06-07T07:23:14+00:00] INFO: directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags] created directory /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags
56 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/nodes] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 97)
57 [2020-06-07T07:23:14+00:00] INFO: directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/nodes] created directory /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/nodes
58 [2020-06-07T07:23:14+00:00] INFO: Processing template[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/client.rb] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 106)
59 [2020-06-07T07:23:14+00:00] INFO: template[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/client.rb] created file /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/client.rb
60 [2020-06-07T07:23:14+00:00] INFO: template[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/client.rb] updated file contents /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/client.rb
61 [2020-06-07T07:23:14+00:00] INFO: Processing file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/attribs.json] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 114)
62 [2020-06-07T07:23:14+00:00] INFO: file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/attribs.json] created file /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/attribs.json
63 [2020-06-07T07:23:14+00:00] INFO: file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/attribs.json] updated file contents /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/attribs.json
64 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_app] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
65 [2020-06-07T07:23:14+00:00] INFO: directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_app] created directory /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_app
66 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_instance] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
67 [2020-06-07T07:23:14+00:00] INFO: directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_instance] created directory /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_instance
68 [2020-06-07T07:23:14+00:00] INFO: Processing file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_instance/tl11.json] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 208)
69 [2020-06-07T07:23:14+00:00] INFO: file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_instance/tl11.json] created file /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_instance/tl11.json
70 [2020-06-07T07:23:14+00:00] INFO: file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_instance/tl11.json] updated file contents /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_instance/tl11.json
71 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_layer] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
72 [2020-06-07T07:23:14+00:00] INFO: directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_layer] created directory /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_layer
73 [2020-06-07T07:23:14+00:00] INFO: Processing file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_layer/tl1.json] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 208)
74 [2020-06-07T07:23:14+00:00] INFO: file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_layer/tl1.json] created file /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_layer/tl1.json
75 [2020-06-07T07:23:14+00:00] INFO: file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_layer/tl1.json] updated file contents /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_layer/tl1.json
76 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_stack] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
77 [2020-06-07T07:23:14+00:00] INFO: directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_stack] created directory /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_stack
78 [2020-06-07T07:23:14+00:00] INFO: Processing file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_stack/662d14dc-a696-4fdb-8944-3d68cb19b50c.json] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 208)
79 [2020-06-07T07:23:14+00:00] INFO: file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_stack/662d14dc-a696-4fdb-8944-3d68cb19b50c.json] created file /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_stack/662d14dc-a696-4fdb-8944-3d68cb19b50c.json
80 [2020-06-07T07:23:14+00:00] INFO: file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_stack/662d14dc-a696-4fdb-8944-3d68cb19b50c.json] updated file contents /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_stack/662d14dc-a696-4fdb-8944-3d68cb19b50c.json
81 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_command] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
82 [2020-06-07T07:23:14+00:00] INFO: directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_command] created directory /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_command
83 [2020-06-07T07:23:14+00:00] INFO: Processing file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_command/6dd35faf-f165-4934-b7ad-42de1867deb3.json] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 208)
84 [2020-06-07T07:23:14+00:00] INFO: file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_command/6dd35faf-f165-4934-b7ad-42de1867deb3.json] created file /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_command/6dd35faf-f165-4934-b7ad-42de1867deb3.json
85 [2020-06-07T07:23:14+00:00] INFO: file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_command/6dd35faf-f165-4934-b7ad-42de1867deb3.json] updated file contents /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_command/6dd35faf-f165-4934-b7ad-42de1867deb3.json
86 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_user] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
87 [2020-06-07T07:23:14+00:00] INFO: directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_user] created directory /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_user
88 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_elastic_load_balancer] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
89 [2020-06-07T07:23:14+00:00] INFO: directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_elastic_load_balancer] created directory /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_elastic_load_balancer
90 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_rds_db_instance] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
91 [2020-06-07T07:23:14+00:00] INFO: directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_rds_db_instance] created directory /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_rds_db_instance
92 [2020-06-07T07:23:14+00:00] INFO: Processing directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_ecs_cluster] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 124)
93 [2020-06-07T07:23:14+00:00] INFO: directory[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_ecs_cluster] created directory /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags/aws_opsworks_ecs_cluster
94 [2020-06-07T07:23:14+00:00] INFO: Processing file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/nodes/tl11.localdomain.json] action create (/var/lib/aws/opsworks/cache.internal/cookbooks/aws_opsworks_custom_run/providers/default.rb line 178)
95 [2020-06-07T07:23:14+00:00] INFO: file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/nodes/tl11.localdomain.json] created file /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/nodes/tl11.localdomain.json
96 [2020-06-07T07:23:14+00:00] INFO: file[/var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/nodes/tl11.localdomain.json] updated file contents /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/nodes/tl11.localdomain.json
97 [2020-06-07T07:23:14+00:00] WARN: Skipping final node save because override_runlist was given
98 [2020-06-07T07:23:14+00:00] INFO: Chef Run complete in 8.875570674 seconds
99 [2020-06-07T07:23:14+00:00] INFO: Skipping removal of unused files from the cache
100 [2020-06-07T07:23:14+00:00] INFO: Running report handlers
101 [2020-06-07T07:23:14+00:00] INFO: Report handlers complete
102
103 [2020-06-07T07:23:15+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /var/chef
104 One version per cookbook
105 data_bags at /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/data_bags
106 nodes at /var/chef/runs/6dd35faf-f165-4934-b7ad-42de1867deb3/nodes
107
108 [2020-06-07T07:23:15+00:00] INFO: Forking chef instance to converge…
109 [2020-06-07T07:23:15+00:00] INFO: *** Chef 12.18.31 ***
110 [2020-06-07T07:23:15+00:00] INFO: Platform: x86_64-linux
111 [2020-06-07T07:23:15+00:00] INFO: Chef-client pid: 3101
112 [2020-06-07T07:23:17+00:00] INFO: Setting the run_list to [] from CLI options
113 [2020-06-07T07:23:17+00:00] INFO: Run List is []
114 [2020-06-07T07:23:17+00:00] INFO: Run List expands to []
115 [2020-06-07T07:23:17+00:00] INFO: Starting Chef Run for tl11
116 [2020-06-07T07:23:17+00:00] INFO: Running start handlers
117 [2020-06-07T07:23:17+00:00] INFO: Start handlers complete.
118 [2020-06-07T07:23:17+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found:
119 [2020-06-07T07:23:17+00:00] INFO: Loading cookbooks []
120 [2020-06-07T07:23:17+00:00] WARN: Node tl11.localdomain has an empty run list.
121 [2020-06-07T07:23:17+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/tl11
122 [2020-06-07T07:23:17+00:00] INFO: Chef Run complete in 0.05625041 seconds
123 [2020-06-07T07:23:17+00:00] INFO: Running report handlers
124 [2020-06-07T07:23:17+00:00] INFO: Report handlers complete
Cookbook 名が hello のレシピを実行する
次に特定のレシピを実行します。
再度「Stack」をクリックします。
「Run Command」ボタンをクリックします。
「Run Command」画面で以下のように設定します。
Command ← Excute Recipes を選択します。
Recipes to execute ← hello::default を記入します。(helloのCookbookのdefaultのレシピを実行します。)
設定が終わったら「Execute Recipes」ボタンをクリックします。
「Status」が「successful」になったら「show」をクリックします。
ログの内容を確認します。
Cookbook 名が bind-utils のレシピを実行する
今度は別の Cookbook(bind-utils)のレシピを試してみます。
「Repeat」ボタンをクリックします。
「Run Command」画面で以下のように設定します。
Recipes to execute ← bind-utils::default を記入します。(bind-utilsのCookbookのdefaultのレシピを実行します。)
設定が終わったら「Execute Recipes」ボタンをクリックします。
レシピの実行が完了したら「show」をクリックします。
ログの内容を確認します。
[2020-06-07T12:26:05+00:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /var/chef
One version per cookbook
data_bags at /var/chef/runs/c642222a-c3ac-4d08-a1df-4228dc7a1a4e/data_bags
nodes at /var/chef/runs/c642222a-c3ac-4d08-a1df-4228dc7a1a4e/nodes
[2020-06-07T12:26:05+00:00] INFO: Forking chef instance to converge…
[2020-06-07T12:26:05+00:00] INFO: *** Chef 12.18.31 ***
[2020-06-07T12:26:05+00:00] INFO: Platform: x86_64-linux
[2020-06-07T12:26:05+00:00] INFO: Chef-client pid: 4542
[2020-06-07T12:26:06+00:00] INFO: Setting the run_list to [“recipe[bind-utils::default]”] from CLI options
[2020-06-07T12:26:06+00:00] INFO: Run List is [recipe[bind-utils::default]]
[2020-06-07T12:26:06+00:00] INFO: Run List expands to [bind-utils::default]
[2020-06-07T12:26:06+00:00] INFO: Starting Chef Run for tl11
[2020-06-07T12:26:06+00:00] INFO: Running start handlers
[2020-06-07T12:26:06+00:00] INFO: Start handlers complete.
[2020-06-07T12:26:06+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found:
[2020-06-07T12:26:06+00:00] INFO: Loading cookbooks [bind-utils@0.1.0]
[2020-06-07T12:26:07+00:00] INFO: Storing updated cookbooks/bind-utils/recipes/default.rb in the cache.
[2020-06-07T12:26:07+00:00] INFO: Storing updated cookbooks/bind-utils/metadata.rb in the cache.
[2020-06-07T12:26:07+00:00] INFO: Storing updated cookbooks/bind-utils/.gitignore in the cache.
[2020-06-07T12:26:07+00:00] INFO: Storing updated cookbooks/bind-utils/.kitchen.yml in the cache.
[2020-06-07T12:26:07+00:00] INFO: Storing updated cookbooks/bind-utils/Berksfile in the cache.
[2020-06-07T12:26:07+00:00] INFO: Storing updated cookbooks/bind-utils/CHANGELOG.md in the cache.
[2020-06-07T12:26:07+00:00] INFO: Storing updated cookbooks/bind-utils/LICENSE in the cache.
[2020-06-07T12:26:07+00:00] INFO: Storing updated cookbooks/bind-utils/Policyfile.rb in the cache.
[2020-06-07T12:26:07+00:00] INFO: Storing updated cookbooks/bind-utils/README.md in the cache.
[2020-06-07T12:26:07+00:00] INFO: Storing updated cookbooks/bind-utils/chefignore in the cache.
[2020-06-07T12:26:07+00:00] INFO: Storing updated cookbooks/bind-utils/kitchen.yml in the cache.
[2020-06-07T12:26:07+00:00] INFO: Processing yum_package[bind-utils] action install (bind-utils::default line 7)
[2020-06-07T12:26:08+00:00] INFO: yum_package[bind-utils] installing bind-utils-9.11.4-16.P2.el7_8.6 from updates repository
[2020-06-07T12:26:10+00:00] INFO: yum_package[bind-utils] installed bind-utils at 9.11.4-16.P2.el7_8.6
[2020-06-07T12:26:10+00:00] INFO: HTTP Request Returned 404 Not Found: Object not found: chefzero://localhost:8889/nodes/tl11
[2020-06-07T12:26:10+00:00] INFO: Chef Run complete in 3.401298042 seconds
[2020-06-07T12:26:10+00:00] INFO: Running report handlers
[2020-06-07T12:26:10+00:00] INFO: Report handlers complete
コメント