etcds 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/etcds/version.rb +1 -1
- data/lib/etcds.rb +12 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 354d9bb8e06d2f23e2e36b721a9340b99e12f730
|
4
|
+
data.tar.gz: 521dfaa11926d4f9104b053ecdbf1773254ffb55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9e977d14f4586a66f02c061bfd4e95556c3bd5d7c290dc7cfa3156fe1c7515e4e66917ee1623d6f55aacd7c93b7523f107790736a0958b39ad0852368958233
|
7
|
+
data.tar.gz: 3a6fef3d543269357902ee897c2bc6988b3d4cf01bd3c0ae00ef8074bc21612efb0f711bc2b1029be2aa04944718c1f9d522735453fa87ed401b6055f0e4c201
|
data/lib/etcds/version.rb
CHANGED
data/lib/etcds.rb
CHANGED
@@ -38,12 +38,12 @@ class Etcds
|
|
38
38
|
end
|
39
39
|
|
40
40
|
H[:init] = 'prepare ca files for all nodes'
|
41
|
-
def init
|
41
|
+
def init(domain = 'etcd')
|
42
42
|
etcd_ca "init --passphrase ''"
|
43
43
|
@nodes.each do |k, v|
|
44
44
|
ip = v['ip']
|
45
45
|
name = k
|
46
|
-
etcd_ca "new-cert --passphrase '' --ip #{ip} #{name}"
|
46
|
+
etcd_ca "new-cert --passphrase '' --ip #{ip} --domain #{domain} #{name}"
|
47
47
|
etcd_ca "sign --passphrase '' #{name}"
|
48
48
|
etcd_ca "export --insecure --passphrase '' #{name}" +
|
49
49
|
" | tar -C ./certs -xvf -"
|
@@ -57,11 +57,13 @@ class Etcds
|
|
57
57
|
H[:install] = "[names...]\tinstall ca files to the host"
|
58
58
|
def install(*hosts)
|
59
59
|
hosts.each do |to|
|
60
|
-
%
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
60
|
+
%W[
|
61
|
+
#{to}.ca.crt #{to}.crt #{to}.key.insecure
|
62
|
+
ca.crt client.crt client.key.insecure
|
63
|
+
].each do |what|
|
64
|
+
scp "./certs/#{what} #{to}:/tmp/"
|
65
|
+
ssh to, "mv /tmp/#{what} /etc/docker/certs.d"
|
66
|
+
ssh to, "chown root:root /etc/docker/certs.d/#{what}"
|
65
67
|
end
|
66
68
|
end
|
67
69
|
end
|
@@ -131,10 +133,10 @@ class Etcds
|
|
131
133
|
end
|
132
134
|
|
133
135
|
H[:health] = 'show cluster health for all nodes'
|
134
|
-
def health;
|
136
|
+
def health; for_all{|n| ctl n, 'cluster-health'} end
|
135
137
|
|
136
138
|
H[:member] = 'show member list for all nodes'
|
137
|
-
def member;
|
139
|
+
def member; for_all{|n| ctl n, 'member list'} end
|
138
140
|
|
139
141
|
H[:ctl] = "[name] commands\tpass commands to etcdctl"
|
140
142
|
def ctl(n, *args)
|
@@ -160,7 +162,7 @@ private
|
|
160
162
|
IO.popen({'DOCKER_HOST' => "tcp://#{ip}:2376"}, "docker #{cmd}").read
|
161
163
|
end
|
162
164
|
|
163
|
-
def
|
165
|
+
def for_all(&block)
|
164
166
|
@nodes.keys.each do |n|
|
165
167
|
if run?(n)
|
166
168
|
puts "Node #{n}:".on_blue
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etcds
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Takiuchi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|