neuhalfen.name

A random collection of posts

Installing Chef-Server in SmartOS

Permalink

Recently Joyent provided a Chef Server image for SmartOS.

Installing the image on a SmartOS system not managed by the joyent cloud does not work out of the box. The following steps will walk you through the installation of Chef Server on SmartOS.

Install the image

All work is done in the Global Zone. To create the zone we first need to install the image. From the image we then create the zone chef with the ip 172.20.1.35.

Install image
imgadm avail|grep chef
# d2fc0a96-61d1-11e2-8701-c7c137935369 chefserver 1.0.0 smartos 2013-02-04T19:30:16Z
imgadm install d2fc0a96-61d1-11e2-8701-c7c137935369
# image is downloaded
# Check if everything worked:
imgadm list |grep chef
# d2fc0a96-61d1-11e2-8701-c7c137935369 chefserver 1.0.0 smartos 2013-02-04T19:30:16Z

Fix the image

The setup scripts contained in the image need to be fixed, before the installation can proceed:

Fix chef image
cd /zones/d2fc0a96-61d1-11e2-8701-c7c137935369/root/var/zoneinit/includes
echo 'NET0_IP=${PUBLIC_IP}' >> 02-config.sh

Install the zone

Install the zone
vmadm create <<EOF
{
"brand": "joyent",
"dns_domain": "local.neuhalfen.name",
"resolvers": [
"172.20.1.14"
],
"alias": "chef",
"hostname": "chef",
"max_physical_memory": 2048,
"quota": 15,
"dataset_uuid": "d2fc0a96-61d1-11e2-8701-c7c137935369",
"delegate_dataset": true,
"autoboot": true,
"nics": [
{
"nic_tag": "external",
"ip": "172.20.1.35",
"netmask": "255.255.255.0",
"gateway": "172.20.1.14",
"primary": true
}
]
}
EOF

The UUID of the new zone will be used as ZONE_UUID.

Using knife

User admin in the new zone gets pre-configured for the new installation. Log into the new zone, and test:

Testdrive
zlogin $ZONE_UUID
# ...
svcs -xv
# hopefully no broken services
svcs '*chef*'
# STATE STIME FMRI
# online 22:38:01 svc:/pkgsrc/chef-expander:default
# online 22:38:02 svc:/pkgsrc/chef-solr:default
# online 22:38:03 svc:/pkgsrc/chef-server-webui:default
# online 22:38:03 svc:/pkgsrc/chef-server:default
su - admin
knife client list
# admin
# chef-validator
# chef-webui
exit
exit

Using the Web Console

Browse to http://YOUR-IP:4040 and log in with chef/dbpass123.

Comments