How to make sure order of receipts in chef

0

I want to create a user at first and then let the user create several directories and templates.

I created a cookbook for user like this, knife cookbook create user -o site-cookbooks.

How to make it sure that this user cookbook will be cooked before others?

ironsand

Posted 2014-03-04T06:01:10.503

Reputation: 1 757

Answers

1

I realized that I only need to write user cookbook at first in runlist array.

ironsand

Posted 2014-03-04T06:01:10.503

Reputation: 1 757

0

Another answer to this question is to use the default recipe of a wrapper cookbook which contains the list of the necessary cookbooks. This is also considered to be a good development pattern (Sources below). This is an example:

#
# Cookbook Name:: wrapper-cookbook
# Recipe:: base
#
include_recipe "ntp"
include_recipe "nagios::windows_client"
include_recipe "web_server::web_sites",
include_recipe "base_server::ssl_certs"

Julian Dunn of Opscode suggests this is a valid solution in point 6. Run List in Roles (Time ~ 15:30) in the presentation. https://www.youtube.com/watch?v=IJCY2cEr6Rw

Also, demonstrated in the linked blog. http://dougireton.com/blog/2013/02/16/chef-cookbook-anti-patterns/

TheEavesofIT

Posted 2014-03-04T06:01:10.503

Reputation: 1