LoginSignup
1

More than 5 years have passed since last update.

オブジェクトをChef Serverにアップロードする

Posted at

差分確認

Chefサーバとのdiffを確認する。

$ knife diff roles/sample-role.json
diff --knife roles/sample-role.json roles/sample-role.json
--- roles/sample-role.json  2014-09-29 16:55:35.000000000 +0900
+++ roles/sample-role.json  2014-09-29 16:55:35.000000000 +0900
@@ -1,5 +1,6 @@
 {
   "name": "sample-role",
+  "description": "sample role",
   "run_list": [
     "recipe[sample]"
   ]

Dry Runで確認

$ knife upload roles/sample-role.json --dry-run
Would update roles/sample-role.json

Chefサーバにアップロード

$ knife upload roles/sample-role.json
Updated roles/sample-role.json

変更が適用されていることを確認

ここでは「description: sample role」が追加された。

$ knife role show sample-role
chef_type:           role
default_attributes:
description:         sample role
env_run_lists:
json_class:          Chef::Role
name:                sample-role
override_attributes:
run_list:            recipe[sample]

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1