teamd-installer 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f71a2bd3afc34f077161a117eddb3b26dcd7a9e3
|
4
|
+
data.tar.gz: 6eefbaf923af21ad08f9414b74826647a5ef33cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40cf7277188a7e488bb6629426594fe0ada82ec2b5bce6d4ed3b867025e1369678a1750692168d8fa1a807b89487429fba7e2a33980ba3543a1c70d5e1a98a3e
|
7
|
+
data.tar.gz: f06f1fa09ef58fcd6d1bb5810d9308ee2742ec909de221cb19239d7a6d1d667af8bd21da7ff3035e8491fc75e5b8ca234f438d930ffd41294862444fa4c03ec8
|
File without changes
|
data/lib/teamd/installer/cli.rb
CHANGED
@@ -18,6 +18,7 @@ module Teamd
|
|
18
18
|
@token ||= options[:etcd_discovery_id]
|
19
19
|
@token ||= TeamdTokenProvider.token
|
20
20
|
@token ||= EtcdTokenProvider.token
|
21
|
+
puts "Using Token #{@token}"
|
21
22
|
@public_ipv4 ||= Interfaces.public_ipv4
|
22
23
|
@private_ipv4 ||= Interfaces.internal_ipv4 except: ["127.0.0.1",@public_ipv4]
|
23
24
|
@config = TemplateConfig.new
|
@@ -20,7 +20,10 @@ module Teamd
|
|
20
20
|
end
|
21
21
|
def public_ipv4
|
22
22
|
address = default_ipv4
|
23
|
-
|
23
|
+
unless is_private? address
|
24
|
+
puts "Public IPv4 is #{address}"
|
25
|
+
return address
|
26
|
+
end
|
24
27
|
nil
|
25
28
|
end
|
26
29
|
def is_private? address
|
@@ -31,13 +34,15 @@ module Teamd
|
|
31
34
|
end
|
32
35
|
def internal_ipv4 except:[]
|
33
36
|
except = except.compact
|
34
|
-
Socket.getifaddrs.select do |ia|
|
37
|
+
address = Socket.getifaddrs.select do |ia|
|
35
38
|
ia.addr.pfamily == Socket::AF_INET
|
36
39
|
end.collect do |ia|
|
37
40
|
ia.addr.ip_address
|
38
41
|
end.reject do |ip|
|
39
42
|
except.include? ip
|
40
43
|
end.first
|
44
|
+
puts "Private IPv4 is #{address}"
|
45
|
+
address
|
41
46
|
end
|
42
47
|
end
|
43
48
|
end
|
@@ -7,6 +7,7 @@ module Teamd
|
|
7
7
|
:public_ipv6, :private_ipv6, :use_flannel, :docker_tcp,
|
8
8
|
:sshd_port, :dynamic_environment
|
9
9
|
def to_h
|
10
|
+
puts "Set discovery token, hostname and manage_etc_hosts"
|
10
11
|
output = {
|
11
12
|
"coreos" => {
|
12
13
|
"etcd" => {
|
@@ -18,25 +19,30 @@ module Teamd
|
|
18
19
|
"hostname" => SecureRandom.hex(8),
|
19
20
|
"manage_etc_hosts" => "localhost",
|
20
21
|
}
|
22
|
+
puts "Create Unit for publishing discovery token"
|
21
23
|
output["write_files"] << {
|
22
24
|
"path" => "/run/teamd/etcd.env",
|
23
25
|
"permissions" => "0444",
|
24
26
|
"owner" => "root",
|
25
27
|
"content" => "ETCD_DISCOVERY=https://discovery.etcd.io/#{@etcd_discovery_id}\n"
|
26
28
|
}
|
29
|
+
puts "Create Unit for zookeeper node"
|
27
30
|
output["coreos"]["units"] << {
|
28
31
|
"name" => "teamd-zookeeper.service",
|
29
32
|
"command" => "start",
|
30
33
|
"content" => "[Unit]\nDescription=Teamd Local Discover Publisher\nDocumentation=https://teamd.stei.gr/discover\nConditionPathExists=/run/teamd/etcd.env\nRequires=early-docker.service\nAfter=etcd.service etcd2.service early-docker.service\nBefore=early-docker.target\n\n[Service]\nRestart=always\nRestartSec=5\nEnvironment=\"DOCKER_HOST=unix:///var/run/early-docker.sock\"\nExecStart=/usr/bin/docker run --net=host --privileged=true --rm \\\n --env-file=/run/teamd/etcd.env \\\n registry.hub.docker.com/steigr/teamd-discover",
|
31
34
|
}
|
35
|
+
puts "Start Docker at startup"
|
32
36
|
output["coreos"]["units"] << {
|
33
37
|
"name" => "docker.service",
|
34
38
|
"command" => "start"
|
35
39
|
}
|
40
|
+
puts "Adding SSH-Public-Key from proc command line"
|
36
41
|
output["ssh_authorized_keys"] = [
|
37
42
|
File.read("/proc/cmdline").scan(/sshkey="([^"]+)"/).first.first
|
38
43
|
]
|
39
44
|
if @sshd_port
|
45
|
+
puts "Move SSHd out of the way (#{@sshd_port})"
|
40
46
|
output["coreos"]["units"] << {
|
41
47
|
"name" => "sshd.socket",
|
42
48
|
"command" => "restart",
|
@@ -44,6 +50,7 @@ module Teamd
|
|
44
50
|
}
|
45
51
|
end
|
46
52
|
unless @dynamic_environment
|
53
|
+
puts "Writing static /etc/environment"
|
47
54
|
if @public_ipv4 or @private_ipv4
|
48
55
|
content = ""
|
49
56
|
content << "COREOS_PUBLIC_IPV4=#{@public_ipv4}\n" if @public_ipv4
|
@@ -56,6 +63,7 @@ module Teamd
|
|
56
63
|
}
|
57
64
|
end
|
58
65
|
else
|
66
|
+
puts "Adding dynamic environment unit"
|
59
67
|
output["coreos"]["units"] << {
|
60
68
|
"name" => "dynamic-environment.service",
|
61
69
|
"command" => "start",
|
@@ -63,12 +71,14 @@ module Teamd
|
|
63
71
|
}
|
64
72
|
end
|
65
73
|
if @use_flannel
|
74
|
+
puts "Enable flannel"
|
66
75
|
output["coreos"]["units"] << {
|
67
76
|
"name" => "flanneld.service",
|
68
77
|
"command" => "start"
|
69
78
|
}
|
70
79
|
end
|
71
80
|
if @docker_tcp
|
81
|
+
puts "Bind Docker to TCP-Socket"
|
72
82
|
output["coreos"]["units"] << {
|
73
83
|
"name" => "docker-tcp.socket",
|
74
84
|
"command" => "start",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teamd-installer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathias Kaufmann
|
@@ -105,12 +105,12 @@ extra_rdoc_files: []
|
|
105
105
|
files:
|
106
106
|
- ".gitignore"
|
107
107
|
- ".travis.yml"
|
108
|
-
- Dockerfile
|
109
108
|
- Gemfile
|
110
109
|
- README.md
|
111
110
|
- Rakefile
|
112
111
|
- bin/console
|
113
112
|
- bin/setup
|
113
|
+
- docker/Dockerfile
|
114
114
|
- exe/teamd-installer
|
115
115
|
- lib/teamd/installer.rb
|
116
116
|
- lib/teamd/installer/cli.rb
|