Skip to content

kclinux/chef-aws-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

chef-aws-example

This is a working example of Chef provisioning using the AWS driver.

Chef-Provisioning was launched in early 2015 and currently leaves a lot to be desired in terms of documentation (as of mid-August, 2015). This serves as a working example using this new methodology and is aimed at making it easier (copy/paste even) for exploration into this new deployment process that represents "Infrastructure as Code". It is a more efficient way of standing up new environments across many different Cloud and other hosting platforms without using the former knife commands to stand up servers individually though this particular example is aimed at AWS. It is particularly useful for very large environments where running knife commands was previously required to bring up new environments.

Pre-requisites:

  • Working Chef environment with ChefDK
  • Chef Server or a Managed Chef account at https://manage.chef.io/
  • AWS CLI installed and configured with your AWS USER access_key and access_secret_key configured
  • Steps:

  • Provided in this example is also a custom 'all_users' cookbook that gets added to each server by definition in the servers example data_bag. To use this example cookbook, be sure to review and make appropriate changes to the cookbook.
  • Create a data bag:
    knife data bag create servers
  • Put your server definition json files in the data bag and add as many as you need. See data_bags/servers for example
  • Upload data bags to server
    knife data bag from file servers data_bags/servers/*
    knife data bag from file users data_bags/users/*
  • Modify the provision.rb script to change the Chef Server, Client and SSH Key. See comments in script.
  • Run the provision script with chef-client to build the environment
    chef-client -z scripts/provision.rb
  • Outstanding pieces:

  • Define network topology in data bag and adjust provision script to use those variables (currently requires that Security Groups, VPCs, Subnets, etc. already exists.
  • Adjust provision script to account for empty run_list. Currently it must be populated with at least a role or recipe
  • About

    This is a working example of Chef provisioning using the AWS driver.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages