The focus of this project is to have a canned solution for a solid infrastructure foundation using Chef and AWS. Browse the core_examples repo for example Chef environments, roles, data bags, CloudFormations templates and more. They are configured to use the Chef Core suite of cookbooks. It's a starting point to help jump into the Chef world fresh or refactor a better configuration infrastructure. The intent is to provide wrapper cookbooks for many common services that have overrides and providers to stand up your stack without having to make cookbook customizations. The goal of this project is aided at eliminating the need for writing dozens of wrapper cookbooks or repeating code. Most likely there may be the need to have some custom deployment cookbooks that piggyback the Chef Core suite, but it should drastically reduce the effort.
The design idea came to me one day after a couple years of repeatably writing wrapper cookbooks for several different development teams. I found the layout that was given to use was an inferior design that had numerous faults.
So, I decided to make a project that directly addressed these issues aims at simplifying stack setup and management.
I hope to help others by giving a Chef foundation that is solid, extensible and drives to dry up code.
I'm a long way from being finished. I hope that others will help me grow the project and continually improve it.
The idea is to not have to write tons of wrapper cookbooks, work with all major flavors of operating systems and to setup a stack for a development team is as simple as filling out a few JSON "configuration" files (Environment and Data Bags).
- Linux
- Windows (WIP)
Roles specify the generic service of the system. This is where the run list is setup.
Name | Packages |
---|---|
app | Mediawiki, Wordpress, WAR Deploy, Teamspeak3 |
ci | Go, Jenkins, Gitlab Ci |
database | MySQL, MsSQL, Postgres, MongoDB, Redis |
logs | Splunk |
media | Plex Server |
monitoring | Nagios, Sensu |
search | Solr, Sphinx, Elastic Search |
security | firewall, antivirus, Nessus |
version_control | Subversion, Git, Gitlab |
web | Apache, Nginx, Unicorn, Tomcat, IIS |
Use the examples provided to model your custom configurations.
- Linux
- Windows
- Mac
More in-depth instructions can be found HERE
- Install latest Virtualbox
- Virtualbox Download
- Enable VT in BIOS
- Install latest Vagrant
- Install Chef Development Kit
- Download This Project
- Create repo directory
mkdir -p ~/Development/chef/cookbooks/
git clone https://github.com/chefcore/config_examples.git ~/Development/chef/cookbooks/
- Create repo directory
- (Optional) Create .kitchen.local.yml file and add proxy or other custom settings like resources.
PowerShell Setup
- Create C:\Dev Folder (Shortens path as a workaround to 260 character limitation)
mkdir C:\Dev
- Create C:\Dev\github Folder
mkdir C:\Dev\chef
- Create C:\Dev\github\chefcore Folder
mkdir C:\Dev\chef\cookbooks
- Install git client
- Git Client Download
- Select to allow it to run from dos prompt
- Download This Project
git clone https://github.com/bonusbits/bonusbits_linux_base.git C:\Dev\chef\cookbooks
- Set User Profile Environment Variables Some of these settings deals with Home folders on Shares
HTTP_PROXY=http://username:password@proxy.domain.com:8000
HTTPS_PROXY=https://username:password@proxy.domain.com:8000
CHEFDK_PATH=C:\Dev\.chefdk
PATH=%PATH%;C:\Dev\.chefdk\gem\ruby\2.1.0\bin;C:\opscode\chefdk\embedded\bin"
VBOX_USER_HOME=C:\Dev\.VirtualBox
VAGRANT_HOME=C:\Dev\.vagrant.d
BERKSHELF_PATH=C:\Dev\.berkshelf
GEM_ROOT=C:\opscode\chefdk\embedded\lib\ruby\gems\2.1.0
GEM_HOME=C:\Dev\.chefdk\gem\ruby\2.1.0
GEM_PATH=C:\Dev\.chefdk\gem\ruby\2.1.0;C:\opscode\chefdk\embedded\lib\ruby\gem
- Set PowerShell execution policy
Set-ExecutionPolicy unrestricted
- Create WindowsPowerShell user directory
mkdir %USERPROFILE%\Documents\WindowsPowerShell
- Added ChefDK init to PowerShell user profile
"chef shell-init powershell | Invoke-Expression" >> $PROFILE
First change to the root directory of config_examples in a shell.
There are many OS flavors and more coming. So, first list whats available and pick which one you'd like to test out. If you don't specify a test suite it will try to set them all up and most likely run your system out of storage, memory or both.
kitchen list
Also used to run Chef Client again after making local cookbook changes
kitchen core-base-el-centos-66 converge
kitchen core-base-el-centos-66 verify
kitchen core-base-el-centos-66 destroy
- core_base
- core_web::apache