knife-clodo 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
1
  *~
2
+ *.gem
data/README ADDED
@@ -0,0 +1,49 @@
1
+ knife-clodo is a knife plugin for Clodo.Ru API.
2
+
3
+ It uses fog library to interact with API.
4
+
5
+ At this time fog's provider for clodo is not in upstream Git,
6
+ so you need to manually download the sources of patched to
7
+ support clodo fog source tree, build and install gem from it.
8
+
9
+
10
+ Usage is simple as:
11
+
12
+ Write authorization data in your knife.rb as below:
13
+ knife[:clodo_username] = 'your@registration.email.net' # Your email used to authorise in clodo.ru billing.
14
+ knife[:clodo_api_key] = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' # Your API key
15
+ knife[:clodo_api_auth_url] = 'testapi.kh.clodo.ru' # Domain name of API server.
16
+
17
+ Next type in command line:
18
+
19
+ knife clodo server
20
+ (to list available commands)
21
+
22
+ knife clodo server list
23
+ (To list your virtual servers)
24
+
25
+ knife clodo server start --server=10474
26
+ (where 10474 in --server=10474 is an ID of virtual server to
27
+ start)
28
+
29
+ knife clodo server start --all
30
+ (that will request start for all the servers that is not in
31
+ "is_running" or "is_request" state)
32
+
33
+ knife clodo server create -d debian6apt -r "recipe[vds-performance-tests]" --server-disk=5 --server-memory=256 --server-memory-max=512 -I 541
34
+ (where:
35
+ -d debian6apt - is a bootstrap template to setup newly installed server for your current chef environment
36
+ At now only Debian 6 with chef's (0.10) installation with apt-get supported
37
+
38
+ -r "recipe[vds-performance-tests]" - is runlist, that in this example includes default recipe from "vds-performance-tests" cookbook
39
+
40
+ --server-disk=5 - disk size of 5 gigabytes for newly created server (default is 10Gb)
41
+
42
+ --server-memory=256 - low limit of memory scaling in megabytes
43
+
44
+ --server-memory-max=512 - high limit of memory scaling in megabytes
45
+
46
+ -I 541 - OS image to install (Debian 6 amd64) (OS images list will be added to knife-clodo in next version)
47
+
48
+ --server-type here is in it's default value (scale). You can also set it to static.
49
+ )
data/knife-clodo.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'knife-clodo'
3
- spec.version = '0.1.2'
3
+ spec.version = '0.1.3'
4
4
  spec.summary = 'Clodo.Ru knife plugin'
5
5
  spec.add_dependency('fog', '>= 0.10.0')
6
6
  spec.description = <<-EOF
@@ -1,6 +1,11 @@
1
1
  bash -c '
2
2
  <%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
3
3
 
4
+ while [ -e /var/adm/autoinstall/init.d/* ] do
5
+ echo "Autoinstallation still in progress. Waiting 5sec...";
6
+ sleep 5;
7
+ done
8
+
4
9
  if [ ! -f /usr/bin/chef-client ]; then
5
10
  echo "chef chef/chef_server_url string <%= @chef_config[:chef_server_url] %>" | debconf-set-selections
6
11
  [ -f /etc/apt/sources.list.d/opscode.list ] || echo "deb http://apt.opscode.com <%= chef_version.to_f == 0.10 ? "squeeze-0.10" : "squeeze" %> main" > /etc/apt/sources.list.d/opscode.list
@@ -86,6 +86,12 @@ class Chef
86
86
  :long => "--bootstrap-version VERSION",
87
87
  :description => "The version of Chef to install",
88
88
  :proc => Proc.new { |v| Chef::Config[:knife][:bootstrap_version] = v }
89
+
90
+ option :bootstrap_delay,
91
+ :long => "--bootstrap-delay SEC",
92
+ :description => "Delay in seconds between SSH is available and bootstrap begin. (Default is 15 sec.)",
93
+ :default => 15
94
+
89
95
  option :prerelease,
90
96
  :long => "--prerelease",
91
97
  :description => "Install the pre-release chef gems"
@@ -180,7 +186,7 @@ class Chef
180
186
 
181
187
  print "\n#{ui.color("Waiting for sshd", :magenta)}"
182
188
 
183
- print(".") until tcp_test_ssh(server.public_ip_address) { sleep @initial_sleep_delay ||= 10; puts("done") }
189
+ print(".") until tcp_test_ssh(server.public_ip_address) { sleep @initial_sleep_delay ||= config[:bootstrap_delay].to_i; puts("done") }
184
190
 
185
191
  bootstrap_for_node(server).run
186
192
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-clodo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stepan G. Fedorov
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-29 00:00:00 +04:00
18
+ date: 2011-10-06 00:00:00 +04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -44,6 +44,7 @@ extra_rdoc_files: []
44
44
 
45
45
  files:
46
46
  - .gitignore
47
+ - README
47
48
  - knife-clodo.gemspec
48
49
  - lib/chef/knife/bootstrap/debian6apt.erb
49
50
  - lib/chef/knife/clodo_base.rb