Skip to content

Instantly share code, notes, and snippets.

@donchan922
Last active September 24, 2019 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donchan922/e0236002bde2d23148c0774987892fef to your computer and use it in GitHub Desktop.
Save donchan922/e0236002bde2d23148c0774987892fef to your computer and use it in GitHub Desktop.
# クックブックを格納するディレクトリを作成する
$ mkdir cookbooks
# helloクックブックを作成する
$ chef generate cookbook cookbooks/hello
# レシピを作成する(ファイルの中身を、以下に書き換える)
$ vi cookbooks/hello/recipes/default.rb
log "Hello, World!"
# helloクックブックを実行する
$ chef-client --local-mode --override-runlist hello
[2019-09-24T11:26:37+00:00] WARN: No config file found or specified on command line. Using command line options instead.
Starting Chef Client, version 14.13.11
[2019-09-24T11:26:40+00:00] WARN: Run List override has been provided.
[2019-09-24T11:26:40+00:00] WARN: Original Run List: []
[2019-09-24T11:26:40+00:00] WARN: Overridden Run List: [recipe[hello]]
resolving cookbooks for run list: ["hello"]
Synchronizing Cookbooks:
- hello (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 1 resources
Recipe: hello::default
* log[Hello, World!] action write
[2019-09-24T11:26:40+00:00] WARN: Skipping final node save because override_runlist was given
Running handlers:
Running handlers complete
Chef Client finished, 1/1 resources updated in 02 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment