teamd-installer 0.0.11 → 0.0.12
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 +13 -6
- 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: d7674ff320d05b7dcf5a89a445b656050236e3ec
|
4
|
+
data.tar.gz: 6886982c245aec43fd20d3f29895017bc35d3a04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebc82a7306643605d5aa27dd1c4b9467249ccb8296df83530f6c03efca326aa7ccc5a0c93e06d5714b80f8c29fed8ab72f145afc1fc12794c364044a16da5f9d
|
7
|
+
data.tar.gz: 8dfb7f8b8e3c8d483e47fe0689ed31e08d54a17769648b1c9eec51b3d61f32562b676b6661ffb9b2e5aceb2aed72f5308bc5cc6bf45aa2ac46e09741bdf260f8
|
data/lib/teamd/installer/cli.rb
CHANGED
@@ -24,6 +24,13 @@ module Teamd
|
|
24
24
|
@config = CloudConfig.new @config.to_h
|
25
25
|
File.write(options[:cloud_config],@config.to_yaml)
|
26
26
|
end
|
27
|
+
def build_install_command options
|
28
|
+
@installer = Script.download options[:installer_url]
|
29
|
+
Script.store options[:installer_script],@installer
|
30
|
+
@disk,@major,@minor = Disk.default
|
31
|
+
Disk.create @disk, @major, @minor
|
32
|
+
File.write options[:command_file],[options[:installer_script],"-d",@disk,"-C",(ENV["GROUP"] || "stable"),"-c",options[:cloud_config]].join(" ")
|
33
|
+
end
|
27
34
|
end
|
28
35
|
|
29
36
|
default_task :install
|
@@ -38,13 +45,11 @@ module Teamd
|
|
38
45
|
method_option :cloud_config, type: :string, default: "/tmp/user_data"
|
39
46
|
method_option :installer_script, type: :string, default: "/tmp/installer"
|
40
47
|
method_option :reboot, type: :boolean, default: :true
|
48
|
+
method_option :command_file, type: :string, default: "/tmp/install_command"
|
41
49
|
def install
|
42
|
-
Cli.build_cloud_config
|
43
|
-
|
44
|
-
|
45
|
-
Disk.create @disk, @major, @minor
|
46
|
-
Script.store options[:installer_script],@installer
|
47
|
-
Script.run options[:installer_script],"-d",@disk,"-C",(ENV["GROUP"] || "stable"),"-c",options[:cloud_config]
|
50
|
+
Cli.build_cloud_config options
|
51
|
+
Cli.build_install_command options
|
52
|
+
Script.run [File.read(options[:command_file])]
|
48
53
|
Reboot.hard! if options[:reboot]
|
49
54
|
end
|
50
55
|
|
@@ -55,8 +60,10 @@ module Teamd
|
|
55
60
|
method_option :etcd_initialize_cluster, type: :boolean, default: :false
|
56
61
|
method_option :etcd_cluster_size, type: :numeric, default: 3
|
57
62
|
method_option :cloud_config, type: :string, default: "/tmp/user_data"
|
63
|
+
method_option :command_file, type: :string, default: "/tmp/install_command"
|
58
64
|
def prepare
|
59
65
|
Cli.build_cloud_config options
|
66
|
+
Cli.build_install_command options
|
60
67
|
end
|
61
68
|
end
|
62
69
|
end
|