Skip to content
huxoll edited this page Aug 17, 2013 · 13 revisions

TopStack makes heavy use of Chef during operation. You'll need any standard Chef server, with some additional cookbooks provided in the TopStackChefRepo project.

Here are some sample steps to set up Chef for TopStack.

  1. Obtain a chef package.

  2. Run normal installation.

  3. Unzip the cookbooks from the TopStack Chef repository.

    Perform the following steps on your deployment instance. (If you're not installing Chef on your deployment instance, you'll need to obtain credentials such as the "webui.pem" described below and transfer them to the instance.)

    mkdir -p /etc/ChefRepo/cookbooks
    mkdir -p /etc/ChefRepo/roles
    cd /etc/ChefRepo && tar -zxvf ${TOPSTACK_DIR}/TopStackChefRepo/dist/topstack-chef.tar.gz
    cat <<-EOC > /etc/chef/knife.rb
    log_level            :info
    log_location         STDOUT
    node_name           'chef-webui'
    cache_type          'BasicFile'
    cache_options( :path => "/root/.chef/checksums" )
    client_key             "/etc/chef/webui.pem"
    
    cookbook_path      [ "/etc/ChefRepo/cookbooks" ]
    cookbook_copyright "transcendcomputing com"
    cookbook_email     "[email protected]"
    cookbook_license   "apachev2"
    
    chef_server_url    "http://localhost:4000"
    
    validation_key      "/etc/chef/validation.pem"
    validation_client_name "chef-validator"
    EOC
    
    knife role from file /etc/ChefRepo/roles/transcend_defaultrole.rb -c /etc/chef/knife.rb
    knife role from file /etc/ChefRepo/roles/transcend_loadbalancer.rb -c /etc/chef/knife.rb
    knife role from file /etc/ChefRepo/roles/Transcend_RDS_mysql.rb -c /etc/chef/knife.rb
    knife role from file /etc/ChefRepo/roles/transcend_memcached_1_4.rb -c /etc/chef/knife.rb
    knife role from file /etc/ChefRepo/roles/transcend_memcached_1_4_5.rb -c /etc/chef/knife.rb
    
    # Ensure the TopStack instanc is a chef admin
    EDITOR="sed -i 's/\\"admin\": false/\\"admin\\": true/g'" knife client edit ${HOSTNAME} -c /etc/chef/knife.rb
    # Upload cookbooks
    knife cookbook upload /etc/ChefRepo/cookbooks/* -a -c /etc/chef/knife.rb
    
    knife environment from file /etc/ChefRepo/environments/transcend_production.json -c /etc/chef/knife.rb
  4. Configure your TopStack deployment instance, as described in Deployment Instance Setup.

Clone this wiki locally