teamd-installer 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/teamd/installer/cli.rb +35 -17
- data/lib/teamd/installer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bab5987ad9a3df1d311e4003aab003dab547e117
|
4
|
+
data.tar.gz: 79fc9ff02829d266d682cd052fb96091da58fdb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 319dd584e8df49bc400d8c8a0ecd44f538db1b5568327dfa0ac528dae700f58d3ea50019c6a79723f72144f4a2b2e8172f11bd10dea510334c4d95b5d39ee89d
|
7
|
+
data.tar.gz: da50ce9288ee2ed7d84fa64ef2bb12623e777f26d045d13653ec261eec938cf17e4b69dcfcb758966b1e3cfdafb7fcbd696c365e37b4c4ec4deb846eb949072d
|
data/lib/teamd/installer/cli.rb
CHANGED
@@ -4,7 +4,30 @@ require "teamd/installer"
|
|
4
4
|
module Teamd
|
5
5
|
module Installer
|
6
6
|
class Cli < Thor
|
7
|
+
class << self
|
8
|
+
def build_cloud_config options
|
9
|
+
@token ||= options[:etcd_discovery_id]
|
10
|
+
@token ||= TeamdTokenProvider.token
|
11
|
+
@token ||= EtcdTokenProvider.token
|
12
|
+
puts "Using Token #{@token}"
|
13
|
+
@public_ipv4 ||= Interfaces.public_ipv4
|
14
|
+
@private_ipv4 ||= Interfaces.internal_ipv4 except: ["127.0.0.1",@public_ipv4]
|
15
|
+
@config = TemplateConfig.new
|
16
|
+
@config.etcd_discovery_id = @token
|
17
|
+
@config.public_ipv4 = @public_ipv4
|
18
|
+
@config.private_ipv4 = @private_ipv4
|
19
|
+
@config.use_flannel = true
|
20
|
+
@config.docker_tcp = true
|
21
|
+
@config.sshd_port = 2220
|
22
|
+
@config.dynamic_environment = true
|
23
|
+
@config.inspect_etcd = true
|
24
|
+
@config = CloudConfig.new @config.to_h
|
25
|
+
File.write(options[:cloud_config],@config.to_yaml)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
7
29
|
default_task :install
|
30
|
+
|
8
31
|
desc "install","Install CoreOS"
|
9
32
|
method_option :etcd_discovery_id, type: :string
|
10
33
|
method_option :private_interface, type: :string, default: "eth0"
|
@@ -16,23 +39,7 @@ module Teamd
|
|
16
39
|
method_option :installer_script, type: :string, default: "/tmp/installer"
|
17
40
|
method_option :reboot, type: :boolean, default: :true
|
18
41
|
def install
|
19
|
-
|
20
|
-
@token ||= TeamdTokenProvider.token
|
21
|
-
@token ||= EtcdTokenProvider.token
|
22
|
-
puts "Using Token #{@token}"
|
23
|
-
@public_ipv4 ||= Interfaces.public_ipv4
|
24
|
-
@private_ipv4 ||= Interfaces.internal_ipv4 except: ["127.0.0.1",@public_ipv4]
|
25
|
-
@config = TemplateConfig.new
|
26
|
-
@config.etcd_discovery_id = @token
|
27
|
-
@config.public_ipv4 = @public_ipv4
|
28
|
-
@config.private_ipv4 = @private_ipv4
|
29
|
-
@config.use_flannel = true
|
30
|
-
@config.docker_tcp = true
|
31
|
-
@config.sshd_port = 2220
|
32
|
-
@config.dynamic_environment = true
|
33
|
-
# @config.inspect_etcd = true
|
34
|
-
@config = CloudConfig.new @config.to_h
|
35
|
-
File.write(options[:cloud_config],@config.to_yaml)
|
42
|
+
build_cloud_config options
|
36
43
|
@installer = Script.download options[:installer_url]
|
37
44
|
@disk,@major,@minor = Disk.default
|
38
45
|
Disk.create @disk, @major, @minor
|
@@ -40,6 +47,17 @@ module Teamd
|
|
40
47
|
Script.run options[:installer_script],"-d",@disk,"-C",(ENV["GROUP"] || "stable"),"-c",options[:cloud_config]
|
41
48
|
Reboot.hard! if options[:reboot]
|
42
49
|
end
|
50
|
+
|
51
|
+
desc "prepare", "Write cloud-config to linked file and exit"
|
52
|
+
method_option :etcd_discovery_id, type: :string
|
53
|
+
method_option :private_interface, type: :string, default: "eth0"
|
54
|
+
method_option :public_interface, type: :string, default: "eth1"
|
55
|
+
method_option :etcd_initialize_cluster, type: :boolean, default: :false
|
56
|
+
method_option :etcd_cluster_size, type: :numeric, default: 3
|
57
|
+
method_option :cloud_config, type: :string, default: "/tmp/user_data"
|
58
|
+
def prepare
|
59
|
+
build_cloud_config options
|
60
|
+
end
|
43
61
|
end
|
44
62
|
end
|
45
63
|
end
|