sistero 0.8.0 → 0.8.1

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
- SHA1:
3
- metadata.gz: 60c3c0cce22325698cd6ada1765e6e771f700a52
4
- data.tar.gz: 772c3c63c9a2d22b0fb956f419611eba03465a5d
2
+ SHA256:
3
+ metadata.gz: f235e9d54734e98384ab4f4cc22e09c6b90db8b9cd788da9a240448245c5fc98
4
+ data.tar.gz: a435ca3f77f729d317e44e029d6f2c7df0857b5374b38ee948410a7a939229e8
5
5
  SHA512:
6
- metadata.gz: 2604863ec2d2c06d905172ac59964f7b19ea9317e8dd9856a635d469a26474134684585797bc8f02880748fed640276970c10ed94a31e8ad99f1743d9209a73f
7
- data.tar.gz: ddc8a02f965185ca02af3d0b5ad3a0d06c5da1d2a1a8f17ed722645fc2b817af24000c1e3c286b0ab989ef46991fb24f8f6a3dae409d787c30b7204ed82c0e00
6
+ metadata.gz: 21a7e25013fac34584e0bfabd3f0ffd3e24e11f26d61744b7ef3c30f3971f3b8a799a99a8cf4f727a03867e3e13045465e893386ddfb5013d3eff57c9ab379d1
7
+ data.tar.gz: c37a09b748bc6b9c38e78e817b60e8f5bc0e2ca87d9fcaa1af51c82c398e12c69200167b5d63a59f1fb6b294e7e46be8f49be6bc25eebe20993e4b18eac4cd7a
@@ -64,7 +64,7 @@ module Sistero::Command
64
64
  when 'create'
65
65
  vms = command_cfg.vms
66
66
  vms.push nil if vms.empty?
67
- vms.each &sistero.method(:create_vm)
67
+ vms.each &sistero.method(:create_droplet_from_vm)
68
68
  when 'create-all'
69
69
  sistero.create_all()
70
70
  when 'destroy'
@@ -144,14 +144,19 @@ module Sistero
144
144
  end
145
145
  end
146
146
 
147
+ private
148
+ def find_public_network droplet
149
+ droplet&.networks.v4.find { |network| network.type == 'public' }
150
+ end
151
+
147
152
  private
148
153
  def get_public_ip droplet
149
- public_network = droplet.networks.v4.find { |network| network.type == 'public' }
154
+ public_network = find_public_network droplet
150
155
  until public_network
151
156
  puts "no public interfaces, trying again in a second"
152
157
  sleep 1
153
158
  droplet = find_droplet(droplet.name)
154
- public_network = droplet.networks.v4.find { |network| network.type == 'public' }
159
+ public_network = find_public_network droplet
155
160
  end
156
161
  public_network.ip_address
157
162
  end
@@ -1,3 +1,3 @@
1
1
  module Sistero
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  end
data/readme.md CHANGED
@@ -8,33 +8,35 @@ sistero is a profile based tool to manage a digital ocean cluster.
8
8
 
9
9
  ## Configuration
10
10
 
11
- The configuration file lives at `.config/sistero`, an example looks like this:
11
+ First sistero looks for a file called `sistero.yaml` in the current directory or a parent of the current directory. If it is not found the default configuration is loaded from `.config/sistero`. Here is an example:
12
12
 
13
13
  ```
14
14
  defaults:
15
- vm_name: default-vm
15
+ name: default-vm
16
16
  ssh_keys:
17
17
  - 1234567
18
18
  ssh_options: -D1080 -A
19
19
  access_token: f788fffffffffffff8ffffffffffffffffffffff8fffffffffffffffffffffff
20
- vm_size: 512mb
21
- vm_region: nyc3
22
- vm_image: ubuntu-14-04-x64
23
- profiles:
20
+ size: 512mb
21
+ region: nyc3
22
+ image: ubuntu-14-04-x64
23
+ vms:
24
24
  -
25
- vm_name: london-vm
26
- vm_region: lon1
25
+ name: default-vm
27
26
  -
28
- vm_name: london-bigger-vm
29
- vm_region: lon1
30
- vm_size: 1gb
27
+ name: london-vm
28
+ region: lon1
29
+ -
30
+ name: london-bigger-vm
31
+ region: lon1
32
+ size: 1gb
31
33
  ```
32
34
 
33
- Any values not specified in a profile are taken from `defaults`. If the `defaults` entry specifies a `vm_name` then it becomes the default VM for the `create`, `ssh` and `destroy` commands.
35
+ Any values not specified in a profile are taken from `defaults`. If the `defaults` entry specifies a `name` then it becomes the default VM for the `create`, `ssh` and `destroy` commands but is not inherited by vm configuration items.
34
36
 
35
37
  The `ssh_keys` is a list of ID numbers (rather than names) of ssh keys, these can be found by running `sistero ssh-keys`.
36
38
 
37
- The valid options for `region`, `vm_size` and `vm_image` can be found by running `sistero regions`, `sistero sizes` and `sistero images` respectively.
39
+ The valid options for `region`, `size` and `image` can be found by running `sistero regions`, `sistero sizes` and `sistero images` respectively.
38
40
 
39
41
  ## Running
40
42
 
@@ -47,3 +49,58 @@ Or to create a VM called `london-vm` in london:
47
49
  ```
48
50
  sistero create london-vm
49
51
  ```
52
+
53
+ The command `sistero create-all` can be used to create all VMs listed in the configuration file.
54
+
55
+ ## More advanced configurations
56
+
57
+ This config that shows how to create a CoreOS cluster:
58
+
59
+ ```
60
+ defaults:
61
+ ssh_user: core
62
+ ssh_keys:
63
+ - 1234567
64
+ - 1234568
65
+ ssh_options: -D1080 -A
66
+ access_token:
67
+ file: ./secrets/digital-ocean.access-token
68
+ region: lon1
69
+ image: coreos-stable
70
+ name: vm1
71
+ private_networking: true
72
+ user_data: |
73
+ #cloud-config
74
+ coreos:
75
+ etcd2:
76
+ # y$@" :r !curl -s -w "\n" "https://discovery.etcd.io/new?size=2"
77
+ discovery: https://discovery.etcd.io/af66d811fc9b5b9b0989009f849cc37a
78
+ # use $public_ipv4 for multi-cloud/region:
79
+ advertise-client-urls: http://$private_ipv4:2379
80
+ initial-advertise-peer-urls: http://$private_ipv4:2380
81
+ listen-client-urls: http://0.0.0.0:2379
82
+ listen-peer-urls: http://$private_ipv4:2380
83
+ fleet:
84
+ public-ip: $private_ipv4 # used for fleetctl ssh command
85
+ metadata: "size=#{size},name=#{name}"
86
+ units:
87
+ - name: etcd2.service
88
+ command: start
89
+ - name: fleet.service
90
+ command: start
91
+ vms:
92
+ -
93
+ name: vm1
94
+ size: 1gb
95
+ -
96
+ name: vm2
97
+ size: 512mb
98
+ -
99
+ name: vm3
100
+ size: 512mb
101
+ ```
102
+
103
+ This demonstrates a few more things:
104
+
105
+ 1. The config can be split over multiple files using `file:`, in this config file the digital ocean access token is specified in a different file.
106
+ 2. In `user_data` vm configuration variables can be substituted, see `#{size}` and `#{name}` in the metadata.
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.name
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_development_dependency "bundler", "~> 1.10"
29
+ spec.add_development_dependency "bundler", "~> 2.0"
30
30
  spec.add_development_dependency "rake", "~> 10.0"
31
31
  spec.add_development_dependency "rspec"
32
32
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sistero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Pike
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-19 00:00:00.000000000 Z
11
+ date: 2020-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.10'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.10'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -105,7 +105,7 @@ homepage: http://github.com/ohjames/sistero
105
105
  licenses: []
106
106
  metadata:
107
107
  allowed_push_host: https://rubygems.org
108
- post_install_message:
108
+ post_install_message:
109
109
  rdoc_options: []
110
110
  require_paths:
111
111
  - lib
@@ -120,9 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubyforge_project:
124
- rubygems_version: 2.5.1
125
- signing_key:
123
+ rubygems_version: 3.1.4
124
+ signing_key:
126
125
  specification_version: 4
127
126
  summary: Profile based digital ocean cluster management command line tool.
128
127
  test_files: []