sistero 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 830149467db14928da4b414ded663c65a2d8aa69
4
- data.tar.gz: 41379a38cc1fc18e3a9d97b2abef3e2d89844c64
3
+ metadata.gz: 38f5511f4f294392cf8f402b743843753b9cb6f4
4
+ data.tar.gz: e482a41c9897c7d73d01983b9fef837d32f29e38
5
5
  SHA512:
6
- metadata.gz: 9272612e27c28eba9dbc4f2a8a65a7375c29bc6007ebca955b85e817a66082a1fe280bb2cc4669485e5c0d92832a7b57cf5c94408f6c166ae301a7a3cc0bc501
7
- data.tar.gz: 0dce93f8d28a487dcf9ef16381590a8d61cad96bcfc6915a68226a8677e0e1c163bdac0328f7ea2df940ab865331e7fe752e0ba34776ce0abcd74c6d97fb9d97
6
+ metadata.gz: ef5128eff74b37fd80d6606eba1df456c51a2edbd7012d884ad1d321456308c5e67b7509373f4746535eac515dddc74e06de54e9e1e61ea5859c0c64bc226852
7
+ data.tar.gz: e5583c776874bcd325987971ea3f0823e046532fa73201fd659e44dfbff242a4f3706553416ed716a6b523189b34c3e60d7b53b0eb0281e91c8509e9f609aa61
data/bin/sistero CHANGED
@@ -26,6 +26,7 @@ module Sistero::Command
26
26
  end
27
27
 
28
28
  op.subcommand 'create [*vms]', 'create vm'
29
+ op.subcommand 'create-all', 'create all vms in profile'
29
30
  op.subcommand 'destroy [*vms]', 'destroy vm'
30
31
  op.subcommand 'list', 'list vms'
31
32
  op.subcommand 'show-config', 'show configuration'
@@ -55,6 +56,8 @@ module Sistero::Command
55
56
  vms = command_cfg.vms
56
57
  vms.push nil if vms.empty?
57
58
  vms.each &sistero.method(:create_vm)
59
+ when 'create-all'
60
+ sistero.create_all()
58
61
  when 'destroy'
59
62
  vms = command_cfg.vms
60
63
  vms.push nil if vms.empty?
@@ -2,7 +2,8 @@ require "yaml"
2
2
  APP_NAME = "sistero"
3
3
 
4
4
  module Sistero
5
- PROFILE_KEYS = [:vm_name, :vm_size, :vm_region, :vm_image, :access_token, :ssh_keys, :ssh_options]
5
+ PROFILE_KEYS = [:vm_name, :vm_size, :vm_region, :vm_image, :access_token, :ssh_user,
6
+ :ssh_keys, :ssh_options, :user_data, :private_networking]
6
7
 
7
8
  Profile = Struct.new(*PROFILE_KEYS) do
8
9
  def to_s
@@ -1,3 +1,3 @@
1
1
  module Sistero
2
- VERSION = '0.5.1'
2
+ VERSION = '0.5.2'
3
3
  end
data/lib/sistero.rb CHANGED
@@ -34,13 +34,21 @@ module Sistero
34
34
  region: profile.vm_region,
35
35
  size: profile.vm_size,
36
36
  image: profile.vm_image,
37
- ssh_keys: profile.ssh_keys
37
+ ssh_keys: profile.ssh_keys,
38
+ user_data: profile.user_data,
39
+ private_networking: profile.private_networking
38
40
  )
39
41
  vm = @client.droplets.create(vm)
40
42
  puts "created: #{profile.to_s}"
41
43
  vm
42
44
  end
43
45
 
46
+ def create_all
47
+ @config.profiles.each do |profile|
48
+ create_vm profile.vm_name
49
+ end
50
+ end
51
+
44
52
  def is_port_open?(ip, port)
45
53
  begin
46
54
  Timeout::timeout(1) do
@@ -79,7 +87,7 @@ module Sistero
79
87
  end
80
88
  end
81
89
 
82
- cmd = "ssh -o 'StrictHostKeyChecking no' #{ssh_options} root@#{ip}"
90
+ cmd = "ssh -o 'StrictHostKeyChecking no' #{ssh_options} #{profile.ssh_user || 'root'}@#{ip}"
83
91
  puts cmd
84
92
  exec cmd
85
93
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sistero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Pike