kytoon 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc DELETED
@@ -1,102 +0,0 @@
1
- = Kytoon
2
-
3
- Create small virtual server groups
4
-
5
- == Description
6
-
7
- 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.
8
-
9
- Inspired by and based on the Chef VPC Toolkit.
10
-
11
- == Supports
12
-
13
- - Libvirt: manage instances on local machine w/ libvirt, virt-clone, and libguestfs
14
- - XenServer: manage instances on a remote XenServer box (via ssh)
15
- - Cloud Servers VPC: API driven. Supports Rackspace Cloud and OpenStack.
16
-
17
- == Installation
18
-
19
- 1) Gem install kytoon.
20
-
21
- 2) Add Kytoon tasks to your projects Rakefile:
22
-
23
- KYTOON_PROJECT = "#{File.dirname(__FILE__)}" unless defined?(KYTOON_PROJECT)
24
- require 'rubygems'
25
- require 'kytoon'
26
- include Kytoon
27
-
28
- 3) Create a .kytoon.conf file in your HOME directory that contains the following:
29
-
30
- For libvirt:
31
-
32
- # The default group type. Override with GROUP_TYPE
33
- group_type: libvirt
34
-
35
- # Whether commands to create local group should use sudo
36
- libvirt_use_sudo: False
37
-
38
- For XenServer:
39
-
40
- # The default group type. Override with GROUP_TYPE
41
- group_type: xenserver
42
-
43
- For Cloud Servers VPC:
44
-
45
- # The default group type. Override with GROUP_TYPE
46
- group_type: cloud_servers_vpc
47
-
48
- # Cloud Servers VPC credentials
49
- cloud_servers_vpc_url: https://your.vpc.url/
50
- cloud_servers_vpc_username: <username>
51
- cloud_servers_vpc_password: <password>
52
-
53
- == Examples
54
-
55
- Example commands:
56
-
57
- - Create a new server group.
58
-
59
- $ rake group:create
60
-
61
- - List your currently running server groups.
62
-
63
- $ rake group:list
64
-
65
- - SSH into the current (most recently created) server group
66
-
67
- $ rake ssh
68
-
69
- - SSH into a server group with an ID of 3
70
-
71
- $ rake ssh GROUP_ID=3
72
-
73
- - Delete the server group with an ID of 3
74
-
75
- $ rake group:delete GROUP_ID=3
76
-
77
-
78
- == Bash Automation Script
79
-
80
- The following is an example bash script to spin up a group and run commands via SSH.
81
-
82
- #!/bin/bash
83
- # override the group type specified in .kytoon.conf
84
- export GROUP_TYPE=libvirt
85
-
86
- trap "rake group:delete" INT TERM EXIT # cleanup the group on exit
87
-
88
- # create a server group (uses config/server_group.json)
89
- rake group:create
90
-
91
- # create a server group with alternate json file
92
- rake group:create SERVER_GROUP_JSON=config/my_group.json
93
-
94
- # Run some scripts on the login server
95
- rake ssh bash <<-EOF_BASH
96
- echo 'It works!'
97
- EOF_BASH
98
-
99
-
100
- == Copyright
101
-
102
- Copyright (c) 2012 Red Hat Inc. See LICENSE.txt for further details.
@@ -1,41 +0,0 @@
1
- $:.unshift File.dirname(__FILE__)
2
- require 'test_helper'
3
-
4
- require 'tempfile'
5
- require 'kytoon/providers/cloud_servers_vpc'
6
-
7
- module Kytoon
8
- module Vpn
9
-
10
- class VpnNetworkManagerTest < Test::Unit::TestCase
11
-
12
- include Kytoon::Providers::CloudServersVPC
13
-
14
- def setup
15
- @group=ServerGroup.from_xml(SERVER_GROUP_XML)
16
- @client=Client.from_xml(CLIENT_XML)
17
- tmpdir=TmpDir.new_tmp_dir
18
- File.open(File.join(tmpdir, "gconftool-2"), 'w') do |f|
19
- f.write("#!/bin/bash\nexit 0")
20
- f.chmod(0755)
21
- end
22
- ENV['PATH']=tmpdir+":"+ENV['PATH']
23
- @vpn_net_man = VpnNetworkManager.new(@group, @client)
24
- end
25
-
26
- def teardown
27
- @vpn_net_man.delete_certs
28
- end
29
-
30
- def test_configure_gconf
31
- assert @vpn_net_man.configure_gconf
32
- end
33
-
34
- def test_ip_to_integer
35
- assert_equal 16782252, @vpn_net_man.ip_to_integer("172.19.0.1")
36
- end
37
-
38
- end
39
-
40
- end
41
- end