teamd-installer 0.0.9 → 0.0.10

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: ded9fb87ebc538d5d1d8948d39f896a9c9c97f32
4
- data.tar.gz: 5267354623480da5813f16d276da7dd4ee4179ac
3
+ metadata.gz: bab5987ad9a3df1d311e4003aab003dab547e117
4
+ data.tar.gz: 79fc9ff02829d266d682cd052fb96091da58fdb5
5
5
  SHA512:
6
- metadata.gz: bf6a68bcb7b230601399606911b84b2a0203e14dae3844b434ea57d01df17459cb036936a1ba57d21c832091bf80e92cb734740d3c1e8970f96d969851d39de1
7
- data.tar.gz: c7e541bd3f8bf98e0b870ea36088ca8cabf7180c3403679fa4abee036952d82a3b7ece820e645b37f71db2214b266c0a581bbe14d77dc22e2b3e63fe7bf3309c
6
+ metadata.gz: 319dd584e8df49bc400d8c8a0ecd44f538db1b5568327dfa0ac528dae700f58d3ea50019c6a79723f72144f4a2b2e8172f11bd10dea510334c4d95b5d39ee89d
7
+ data.tar.gz: da50ce9288ee2ed7d84fa64ef2bb12623e777f26d045d13653ec261eec938cf17e4b69dcfcb758966b1e3cfdafb7fcbd696c365e37b4c4ec4deb846eb949072d
@@ -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
- @token ||= options[:etcd_discovery_id]
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
@@ -1,5 +1,5 @@
1
1
  module Teamd
2
2
  module Installer
3
- VERSION = "0.0.9"
3
+ VERSION = "0.0.10"
4
4
  end
5
5
  end
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.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathias Kaufmann