= Kytoon Create small virtual server groups == Description A set of Rake tasks that provide a framework to help automate the creation and configuration of virtual server groups. Kytoon provides the ability to create projects that can be used by team members and continuous integration systems to create similar (if not identical) groups of servers for development and/or testing. Configuration information is stored in JSON and YAML formats which can be easily parsed, edited, and version controlled. Inspired by and based on the Chef VPC Toolkit. == Supports - Libvirt: manage instances on local machine w/ libvirt, virt-clone, and libguestfs - XenServer: manage instances on a remote XenServer box (via ssh) - Cloud Servers VPC: API driven. Supports Rackspace Cloud and OpenStack. == Installation 1) Gem install kytoon. 2) Add Kytoon tasks to your projects Rakefile: KYTOON_PROJECT = "#{File.dirname(__FILE__)}" unless defined?(KYTOON_PROJECT) require 'rubygems' require 'kytoon' include Kytoon 3) Create a .kytoon.conf file in your HOME directory that contains the following: For libvirt: # The default group type. Override with GROUP_TYPE group_type: libvirt # Whether commands to create local group should use sudo libvirt_use_sudo: False For XenServer: # The default group type. Override with GROUP_TYPE group_type: xenserver For Cloud Servers VPC: # The default group type. Override with GROUP_TYPE group_type: cloud_servers_vpc # Cloud Servers VPC credentials cloud_servers_vpc_url: https://your.vpc.url/ cloud_servers_vpc_username: cloud_servers_vpc_password: == Examples Example commands: - Create a new server group. $ rake group:create - List your currently running server groups. $ rake group:list - SSH into the current (most recently created) server group $ rake ssh - SSH into a server group with an ID of 3 $ rake ssh GROUP_ID=3 - Delete the server group with an ID of 3 $ rake group:delete GROUP_ID=3 == Bash Automation Script The following is an example bash script to spin up a group and run commands via SSH. #!/bin/bash # override the group type specified in .kytoon.conf export GROUP_TYPE=libvirt trap "rake group:delete" INT TERM EXIT # cleanup the group on exit # create a server group (uses config/server_group.json) rake group:create # create a server group with alternate json file rake group:create SERVER_GROUP_JSON=config/my_group.json # Run some scripts on the login server rake ssh bash <<-EOF_BASH echo 'It works!' EOF_BASH == Copyright Copyright (c) 2012 Red Hat Inc. See LICENSE.txt for further details.