$ mkdir /tmp/my_mysql
$ cd /tmp/my_mysql
$ chef generate cookbook .
Make it depend on the mysql cookbook and the apt cookbook (for Ubuntu/RHEL) and yum cookbook (for CentOS)
Add the depends lines to the metadata.rb to pull in the cookbooks:
name 'my_mysql'
maintainer ''
maintainer_email ''
license ''
description 'Installs/Configures my_mysql'
long_description 'Installs/Configures my_mysql'
version '0.1.0'
depends "mysql"
depends "apt"
depends "yum"
add include_recipe
statements to run the "apt" "yum" and "mysql::server"` recipes so it knows which of the recipes from the dependent cookbooks to run:
#
# Cookbook Name:: my_mysql
# Recipe:: default
#
# Copyright (C) 2014
#
#
#
include_recipe "apt" if node["platform_family"] == "debian"
include_recipe "yum" if node["platform_family"] == "rhel"
include_recipe "mysql::server"
in .kitchen.yml edit to replace the run list changing recipe[bar::default]
to recipe[my_mysql::default]
suites:
- name: default
run_list:
- recipe[my_mysql::default]
attributes:
$ cd /tmp/my_mysql
$ kitchen converge default-ubuntu-1204
$ cd /tmp/my_mysql
$ berks install
$ cd /tmp/my_mysql
$ berks upload
^^^ oops, this'll blow up because I wrote this using /tmp and you'll need to have ~/.chef/knife.rb configured to talk to your chef server, and you'll need to have the cookbook under your home directory somewhere (in your chef-repo).