teamd-installer 0.0.25 → 0.0.26

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: 822755aa8e6d57c9d4588ff8063dcdbd4a6c9ea6
4
- data.tar.gz: 9025f1ee8217d95721891a735a0832278406d678
3
+ metadata.gz: b560c3202d3b69f0062d285d1d6b9e7238f8f7fa
4
+ data.tar.gz: 8631fa83bb302b90448c0c7aabd3a0032931b623
5
5
  SHA512:
6
- metadata.gz: a13481fa1eedf51879a75c5db9719fe126ca570bb73e727d1c955625c2951298c3a5bfc0ae8b0d8d27391b665fd850a1102464385da69104182759762b1541a0
7
- data.tar.gz: 1c5c3038309b042e602d0af76cfb0fe2ab75bf5405d51ae74abe3148f4b1a436e58d8938d5474c8e297ebad122a96d3750904a439b8be6530b5428acdca9ca66
6
+ metadata.gz: 898b05ed9f8a2d9c83564486053ce33756bbcdf58557b0214d6ccacc2d609d8ad8c7c4187a891d3b2bf0837ccd066683dfe788cbce872da8d16f8f48c44e40f8
7
+ data.tar.gz: 0f7c0c168267dc921f1cfd89f27bcce46fa691f74da51ab247e3cd3209e6a37a46252e92fb8eba4d547ed50c545530ad298d76c15977b1f043cbb58fbf26f154
@@ -26,14 +26,14 @@ module Teamd
26
26
  if inspect_etcd
27
27
  puts "Create Unit for publishing discovery token"
28
28
  output["coreos"]["units"] << {
29
- "name" => "teamd-etcd-cloudinit-reuse.service",
29
+ "name" => "teamd-cloudinit-etcd.service",
30
30
  "command" => "start",
31
- "content" => "[Unit]\nDescription=Teamd Etcd Unit Reuse\nDocumentation=https://teamd.stei.gr/discover\nConditionPathExists=/run/systemd/system/etcd.service.d\n\n[Service]\nType=oneshot\nExecStart=/usr/bin/ln -s /run/systemd/system/etcd.service.d /etc/systemd/system/teamd-discover.service.d",
31
+ "conetnt" => Unit.insert("teamd-cloudinit-etcd.service"),
32
32
  }
33
33
  output["coreos"]["units"] << {
34
- "name" => "teamd-etcd2-cloudinit-reuse.service",
34
+ "name" => "teamd-cloudinit-etcd2.service",
35
35
  "command" => "start",
36
- "content" => "[Unit]\nDescription=Teamd Etcd2 Unit Reuse\nDocumentation=https://teamd.stei.gr/discover\nConditionPathExists=/run/systemd/system/etcd2.service.d\n\n[Service]\nType=oneshot\nExecStart=/usr/bin/ln -s /run/systemd/system/etcd2.service.d /etc/systemd/system/teamd-discover.service.d",
36
+ "content" => Unit.insert("teamd-cloudinit-etcd2.service"),
37
37
  }
38
38
  else
39
39
  puts "Create Unit for publishing discovery token"
@@ -49,7 +49,7 @@ module Teamd
49
49
  output["coreos"]["units"] << {
50
50
  "name" => "teamd-discover.service",
51
51
  "command" => "start",
52
- "content" => "[Unit]\nDescription=Teamd Local Discover Publisher\nDocumentation=https://teamd.stei.gr/discover\nAfter=early-docker.service\nRequires=early-docker.service\nBefore=early-docker.target\n\n[Service]\nRestart=always\nRestartSec=5\nEnvironment=\"DOCKER_HOST=unix:///var/run/early-docker.sock\"\nEnvironmentFile=-/run/teamd/etcd.env\nExecStartPre=/usr/bin/docker pull steigr/teamd-discover\nExecStart=/usr/bin/docker run -t --rm --net=host \\\n --env=\"ETCD_DISCOVERY=${ETCD_DISCOVERY}\" \\\n steigr/teamd-discover",
52
+ "content" => Unit.insert("teamd-discover.service"),
53
53
  }
54
54
  puts "Start Etcd2 at startup"
55
55
  output["coreos"]["units"] << {
@@ -63,8 +63,8 @@ module Teamd
63
63
  }
64
64
  puts "Adding SSH-Public-Key from proc command line"
65
65
  output["ssh_authorized_keys"] = [
66
- File.read("/proc/cmdline").scan(/sshkey="([^"]+)"/).first.first
67
- ]
66
+ (File.read("/proc/cmdline").scan(/sshkey="([^"]+)"/).first.first rescue nil)
67
+ ].compact
68
68
  if @sshd_port
69
69
  puts "Move SSHd out of the way (#{@sshd_port})"
70
70
  output["coreos"]["units"] << {
@@ -74,7 +74,7 @@ module Teamd
74
74
  }
75
75
  output["coreos"]["units"] << {
76
76
  "name" => "remove-sshd-socket.service",
77
- "content" => "[Unit]\nDescription=Remove SSHd Socket before reboot\nBefore=shutdown.target reboot.target halt.target\nDefaultDependencies=no\n\n[Service]\nType=oneshot\nExecStart=/usr/bin/rm /etc/systemd/system/sshd.socket",
77
+ "content" => Unit.insert("remove-sshd-socket.service"),
78
78
  }
79
79
  end
80
80
  unless @dynamic_environment
@@ -96,7 +96,7 @@ module Teamd
96
96
  output["coreos"]["units"] << {
97
97
  "name" => "dynamic-environment.service",
98
98
  "command" => "start",
99
- "content" => "[Unit]\nDescription=Teamd Dynamic Environment File\nDocumentation=https://teamd.stei.gr/environment\nAfter=network-online.target\nBefore=etcd.service etcd2.service\n\n[Service]\nType=oneshot\nExecStart=/bin/sh -c 'a(){ ip -f inet -4 -o addr | grep -v -e \": lo\" -e \": docker\" -e \": flannel\" | awk \"{print \\$4}\" | cut -f1 -d/ | $1 -1;}; echo -n COREOS_PRIVATE_IPV4= > /tmp/ip_env; a tail >> /tmp/ip_env; grep $(a head) /tmp/ip_env >/dev/null || (echo -n COREOS_PUBLIC_IPV4= >> /tmp/ip_env; a head >> /tmp/ip_env); cat /etc/environment 2>/dev/null | grep -v -e COREOS_PUBLIC_IPV4= -e COREOS_PRIVATE_IPV4= >> /tmp/ip_env; cat /tmp/ip_env > /etc/environment'",
99
+ "content" => Unit.insert("dynamic-environment.service"),
100
100
  }
101
101
  end
102
102
  if @use_flannel
@@ -116,7 +116,7 @@ module Teamd
116
116
  "name" => "docker-tcp.socket",
117
117
  "command" => "start",
118
118
  "enable" => true,
119
- "content" => "[Unit]\nDescription=Docker Socket for the API\n[Socket]\nListenStream=2375\nBindIPv6Only=both\nService=docker.service\n\n[Install]\nWantedBy=sockets.target"
119
+ "content" => Unit.insert("docker-tcp.socket")
120
120
  }
121
121
  end
122
122
  output
@@ -0,0 +1,9 @@
1
+ module Teamd
2
+ module Installer
3
+ class Unit
4
+ def self.insert name
5
+ File.read File.expand_path File.join(File.expand_path(__FILE__), "..","..","..","..","shared",name)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  module Teamd
2
2
  module Installer
3
- VERSION = "0.0.25"
3
+ VERSION = "0.0.26"
4
4
  end
5
5
  end
@@ -11,5 +11,6 @@ require "teamd/installer/disk"
11
11
 
12
12
  require "teamd/installer/reboot"
13
13
 
14
+ require "teamd/installer/unit"
14
15
  require "teamd/installer/template_config"
15
16
  require "teamd/installer/cloud_config"
@@ -0,0 +1,9 @@
1
+ [Unit]
2
+ Description=Docker Socket for the API
3
+ [Socket]
4
+ ListenStream=2375
5
+ BindIPv6Only=both
6
+ Service=docker.service
7
+
8
+ [Install]
9
+ WantedBy=sockets.target
@@ -1,8 +1,10 @@
1
1
  [Unit]
2
2
  Description=Remove SSHd Socket before reboot
3
- Before=shutdown.target reboot.target halt.target
4
3
  DefaultDependencies=no
5
4
 
6
5
  [Service]
7
6
  Type=oneshot
8
- ExecStart=/usr/bin/rm /etc/systemd/system/sshd.socket
7
+ ExecStart=/usr/bin/rm /etc/systemd/system/sshd.socket
8
+
9
+ [Install]
10
+ WantedBy=shutdown.target reboot.target halt.target
@@ -2,8 +2,6 @@
2
2
  Description=Teamd Etcd2 Unit Reuse
3
3
  Documentation=https://teamd.stei.gr/discover
4
4
  ConditionPathExists=/run/systemd/system/etcd2.service.d
5
- Requires=etcd2.service
6
- After=etcd2.service
7
5
 
8
6
  [Service]
9
7
  Type=oneshot
@@ -0,0 +1,8 @@
1
+ [Unit]
2
+ Description=Teamd Etcd Unit Reuse
3
+ Documentation=https://teamd.stei.gr/discover
4
+ ConditionPathExists=/run/systemd/system/etcd.service.d
5
+
6
+ [Service]
7
+ Type=oneshot
8
+ ExecStart=/usr/bin/ln -s /run/systemd/system/etcd.service.d /etc/systemd/system/teamd-discover.service.d
@@ -1,15 +1,16 @@
1
1
  [Unit]
2
2
  Description=Teamd Local Discover Publisher
3
3
  Documentation=https://teamd.stei.gr/discover
4
- ConditionPathExists=/run/teamd/etcd.env
4
+ After=early-docker.service
5
5
  Requires=early-docker.service
6
- After=etcd.service etcd2.service early-docker.service
7
6
  Before=early-docker.target
8
7
 
9
8
  [Service]
10
9
  Restart=always
11
10
  RestartSec=5
12
11
  Environment="DOCKER_HOST=unix:///var/run/early-docker.sock"
13
- ExecStart=/usr/bin/docker run --net=host --privileged=true --rm \
14
- --env-file=/run/teamd/etcd.env \
15
- registry.hub.docker.com/steigr/teamd-discover
12
+ EnvironmentFile=-/run/teamd/etcd.env
13
+ ExecStartPre=/usr/bin/docker pull steigr/teamd-discover
14
+ ExecStart=/usr/bin/docker run -t --rm --net=host \
15
+ --env="ETCD_DISCOVERY=${ETCD_DISCOVERY}" \
16
+ steigr/teamd-discover
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.description = %q{Discovers local cluster ID, build coreos-cloudinit file and install CoreOS to disk.}
14
14
  spec.homepage = "https://teamd.stei.gr/installer"
15
15
 
16
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|docker)/}) }
17
17
  spec.bindir = "exe"
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
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.25
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mathias Kaufmann
@@ -110,7 +110,6 @@ files:
110
110
  - Rakefile
111
111
  - bin/console
112
112
  - bin/setup
113
- - docker/Dockerfile
114
113
  - exe/teamd-installer
115
114
  - lib/teamd/installer.rb
116
115
  - lib/teamd/installer/cli.rb
@@ -123,11 +122,14 @@ files:
123
122
  - lib/teamd/installer/teamd_token_provider.rb
124
123
  - lib/teamd/installer/template_config.rb
125
124
  - lib/teamd/installer/token_provider.rb
125
+ - lib/teamd/installer/unit.rb
126
126
  - lib/teamd/installer/version.rb
127
+ - shared/docker-tcp.socket
127
128
  - shared/dynamic-environment.service
128
129
  - shared/remove-sshd-socket.service
130
+ - shared/teamd-cloudinit-etcd.service
131
+ - shared/teamd-cloudinit-etcd2.service
129
132
  - shared/teamd-discover.service
130
- - shared/teamd-etcd2-cloudinit-reuse.service
131
133
  - teamd-installer.gemspec
132
134
  homepage: https://teamd.stei.gr/installer
133
135
  licenses: []
data/docker/Dockerfile DELETED
@@ -1,9 +0,0 @@
1
- FROM steigr/teamd-ruby
2
- MAINTAINER Mathias Kaufmann <me@stei.gr>
3
-
4
- RUN apk update && \
5
- apk add bash wget gnupg util-linux coreutils bzip2 && \
6
- gem update --system --no-ri --no-rdoc
7
- RUN gem install --no-ri --no-rdoc --version 0.0.25 teamd-installer
8
-
9
- ENTRYPOINT ["/usr/bin/teamd-installer"]