LoginSignup
0
0

More than 5 years have passed since last update.

Chef リポジトリ作成

Posted at

Chef リポジトリ作成

ワークステーションにて「chef generate repo」コマンドで chef-repo を作成し、以降の作業ディレクトリとします。

$ chef generate repo chef-repo

chef-repo を生成すると下記のようなディレクトリ構成になります。

chef-repo
├── .gitignore
├── LICENSE
├── README.md
├── chefignore
├── cookbooks
│   └── README.md
├── data_bags
│   └── README.md
├── environments
│   └── README.md
└── roles
    └── README.md

git init されている状態なのでコミットをしておきましょう。

$ git add .
$ git commit -m 'initial commit'

Knife Zero の設定ファイル作成

chef-repo 直下に knife.rb を配置します。

local_mode true
chef_repo_path File.expand_path('../', __FILE__)

knife[:ssh_attribute] = "knife_zero.host"
knife[:use_sudo] = true

knife[:automatic_attribute_whitelist] = %w[
  chef_packages
  hostname
  ipaddress
  os
  os_version
  platform
  platform_version
]
0
0
0

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
0
0