Information Technology Reference
In-Depth Information
- [
"private_network"
, {
ip
:
"192.168.33.34"
}
]
customize
:
memory
:
1536
suites
:
-
name
:
default
run_list
:
-
recipe
[
enterprise
-
chef
:
:default
]
attributes
:
Generate a default attributes file in
attributes/default.rb
.
Chef Development Kit:
$
chef generate attribute default
Chef Client:
$
touch attributes/default.rb
Add an attribute specifying the download URL for the Chef Server package that you ob-
tained from the Enterprise Chef download link page. We recommend using the 11.1.8 version
URL as shown in
Example 9-2
, as we wrote the examples for this chapter for this version of
Chef.
Example 9-2. chefdk/chef-repo/cookbooks/enterprise-chef/attributes/default.rb
default
[
'enterprise-chef'
][
'url'
] =
\
'https://s3.amazonaws.com/opscode-private-chef/el/6/x86_64/'
\
'private-chef-11.1.8-1.el6.x86_64.rpm'
Let's take an initial stab at coding a recipe to replicate the manual steps to install Chef Server
outlined in
How to Install Enterprise Chef Server Manually
. Enter in the first version of the
code as shown in
Example 9-3
.
Let's go over some of the highlights of the code in the fol-
lowing paragraphs.
Rather than typing in long variable names like
node['enterprise-chef']['url']
, feel
free to use temporary local variables in a recipe with shorter names, such as:
package_url
=
node
[
'enterprise-chef'
][
'url'
]