Information Technology Reference
In-Depth Information
Motd-Attributes Cookbook
Let's experiment with attributes in a cookbook called
motd-cookbook
. This is an attribute-
cookbook creation steps quickly in this chapter. If you need a refresher on what each of these
First, generate the
motd-attributes
cookbook using either the
chef generate cookbook
command in the Chef Development Kit or the
knife cookbook create
command in Chef
Client, depending on which is installed on your Chef Development workstation.
Chef Development Kit:
$
chef generate cookbook motd-attributes
$
cd motd-attributes
Chef Client:
$
knife cookbook create motd-attributes --cookbook-path .
$
cd motd-attributes
$
kitchen init --create-gemfile
$
bundle install
Next, modify the
.kitchen.yml
file to use our favorite box image, as shown in
Example 8-1
.
Example 8-1. chefdk/motd-attributes/.kitchen.yml
---
driver
:
name
:
vagrant
provisioner
:
name
:
chef_zero
platforms
:
-
name
:
centos65
driver
:
box
:
learningchef
/
centos65
box_url
:
learningchef
/
centos65
suites
:
-
name
:
default
run_list
: