[chef] Re: Re: More on Cookbook Design Patterns


Chronological Thread 
  • From: JayP < >
  • To:
  • Subject: [chef] Re: Re: More on Cookbook Design Patterns
  • Date: Wed, 2 Apr 2014 17:24:46 -0700 (PDT)

Thanks Tom for the slide deck and recommendation.  I think this could be a
viable solution and breaks up the different cookbooks nicely.  Would a wrapper
cookbook fall under application cookbook where the purpose is wrapping say a
java cookbook or an apache2 cookbook?  About the base cookbook being an
application cookbook currently our base cookbook is mainly used for defining a
base run list instead of using a role.  For example this is what our
base::default recipe looks like:

```
# Attributes
node.normal['chef_client']['cron']['minute'] = '0,15,30,45'
node.normal['chef_client']['cron']['hour'] = '*'
node.normal['chef_client']['cron']['log_file'] = '/dev/null'
node.normal['chef_client']['cron']['use_cron_d'] = false
node.normal['chef_client']['splay'] = 900
node.normal['chef_client']['log_file'] = 'client.log'

# Run List
include_recipe 'debug::before'
include_recipe 'chef_handler'
include_recipe 'chef_handler::register_handlers'
include_recipe 'chef-client::delete_validation'
include_recipe 'ohai'
include_recipe 'chef-client::config'
include_recipe 'chef_data_bags'
include_recipe 'chef_helpers'
include_recipe 'chef-client::cron'
include_recipe 'yum::client'
include_recipe 'cron'
include_recipe 'users::root'
include_recipe 'users::ubuntu'
include_recipe 'users::screen_session'
include_recipe 'users::scrub'
include_recipe 'users::pkg_action'
include_recipe 'openssh'
include_recipe 'apparmor::disable'
include_recipe 'sendmail::disable'
include_recipe 'dns::hosts' unless node.run_list.include?("role[oracle]")
include_recipe 'dns::resolv.conf'
include_recipe 'dns::nsupdate'
include_recipe 'hostname'
include_recipe 'motd'
include_recipe 'bash'
include_recipe 'pkgutil'
include_recipe 'ntp'
include_recipe 'openldap::client'
include_recipe 'python'
include_recipe 'python::common_modules'
include_recipe 'diamond'
include_recipe 'zip'
include_recipe 'sudoers'
include_recipe 'ulimit'
include_recipe 'acpi'
include_recipe 'nagios::nrpe'
include_recipe 'nagios::send_nsca'
include_recipe 'diamond::nrpe'
include_recipe 'genders'
include_recipe 'sysstat'
include_recipe 'syslog'
include_recipe 'xml'
include_recipe 'postfix'
include_recipe 'mail::client'
include_recipe 'tmpreaper'
include_recipe 'ncftp::client'
include_recipe 'bash-completion'
include_recipe 'chef-registration'
include_recipe 'chef-registration::client'
include_recipe 'debug::after'
include_recipe 'omnibus_updater'
```

I was also wondering with your layout is it okay if an application cookbook
depend on another application cookbook?  I guess what I'm asking if I had a
base cookbook would you include the recipe it in an application cookbook or
have it be part of a role run_list which is something we have avoided due to
roles being global.  Thanks in advance.

- Jay



Archive powered by MHonArc 2.6.16.

§