kontena-plugin-vagrant 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NmM4MzJlOTNjZjUzMDNmMjM2YzM2OTliNDA2ZDhjNmYwOWE2YzJhZA==
4
+ ZDU5MzU3OGMzOGRiODNlNmExMzFlMDg2MmUwNjYzYWQxMzM1OGY1NQ==
5
5
  data.tar.gz: !binary |-
6
- ZjMxYzAyNzEzOTE4OGU4MmRjZDA0YTY5ZjZmMWY1NTM5NDY3MDYyNg==
6
+ ZDJhMzRiOWUzNTM0MWI4NzE5MDQ5NDE2ZDQ0MDM2N2FkZmIyNTk1Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjRhMDg5NzRmNzI5ZjgzNjg4NzY0YjBhZGVmMzM2NDQ2ZTFjMjQ3YzQ5MzFh
10
- NTI3NmY1OTk5MGI0MWJlZWQ0OWMwM2EwODYyZjNlYmM2NmEzMDlmYzJjYjU1
11
- NzgxNmRjNGUxZmVjOTM4MTg0YTNlNmNlOTlhYTlmZmYzN2JkNjc=
9
+ ODZiYTFkOTZjZWI0OGJlM2IzYmQ2OWZhMmI0YzVhMzZhMmY0YmY1MDk4MThh
10
+ M2RjZDhjZmQxZGEzMjZiN2QyZGFiMTNlNTJkOWRjZDNjODNhMDAwMWU5NGNh
11
+ N2Y5OWI1OWQzNzJmYTgzMjU2YjJiNDc2ZGQwZWZkOWNiZGM1OTI=
12
12
  data.tar.gz: !binary |-
13
- NGVmN2M5NWFhZTFmYmNiMmU4MzJiYjc3MGQwNjRjZWQ1NTEwN2EwMDcyYTYw
14
- MjZjZTk0MThlYTk2MTllYzUwNWEyYzU3ZTdkNTI4NGZhYzFmMWZhYjAyZWZm
15
- OTVhMjkwY2ExODkzNGI2NjIxNzgxNjU0MGM3ZmQ2MDYxMWQ4Y2I=
13
+ ZTIyMzQwZjBlMDI4MWMzMmEyZjc3NjUwMTU1MzZmMTJlZDI1NzdjNDcwZTI1
14
+ MDJhM2Y1Mzk2MWQ3ZWQ0YThkYWIwODU5OGZlNDkzMmFiNTA1ZWMzOGY5ZjFi
15
+ ZmI4MTI5MjFmZTg4MzkyNDkzMzhiNzVlNDI4YzNmMjkxMGIwOWM=
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ # 0.1.2 (2016-08-31)
4
+
5
+ - add provider labeling for nodes (#4)
6
+ - add ExecStop to systemd units (#2)
7
+
3
8
  # 0.1.1 (2016-08-10)
4
9
 
5
10
  - first release as a plugin
@@ -41,6 +41,7 @@ coreos:
41
41
  ExecStart=/usr/bin/docker run --name=kontena-server-mongo \
42
42
  --volumes-from=kontena-server-mongo-data \
43
43
  mongo:3.0 mongod --smallfiles
44
+ ExecStop=/usr/bin/docker stop kontena-server-mongo
44
45
 
45
46
  - name: kontena-server-api.service
46
47
  command: start
@@ -71,6 +72,7 @@ coreos:
71
72
  <% if auth_server %>-e AUTH_API_URL=<%= auth_server %><% end %> \
72
73
  -p 8080:9292 \
73
74
  kontena/server:${KONTENA_VERSION}
75
+ ExecStop=/usr/bin/docker stop kontena-server-api
74
76
  INIT
75
77
 
76
78
  cloud_init_file = Tempfile.new('kontena-master')
@@ -72,3 +72,4 @@ coreos:
72
72
  -v=/etc/kontena-agent.env:/etc/kontena.env \
73
73
  --net=host \
74
74
  kontena/agent:${KONTENA_VERSION}
75
+ ExecStop=/usr/bin/docker stop kontena-agent
@@ -41,6 +41,7 @@ module Kontena
41
41
  cloudinit = erb(File.read(cloudinit_template), vars)
42
42
  File.write("#{vagrant_path}/Vagrantfile", vagrant_data)
43
43
  File.write("#{vagrant_path}/cloudinit.yml", cloudinit)
44
+ node = nil
44
45
  Dir.chdir(vagrant_path) do
45
46
  ShellSpinner "Creating Vagrant machine #{name.colorize(:cyan)} " do
46
47
  Open3.popen2('vagrant up') do |stdin, output, wait|
@@ -50,9 +51,15 @@ module Kontena
50
51
  end
51
52
  end
52
53
  ShellSpinner "Waiting for node #{name.colorize(:cyan)} join to grid #{grid.colorize(:cyan)} " do
53
- sleep 1 until node_exists_in_grid?(grid, name)
54
+ sleep 1 until node = node_exists_in_grid?(grid, name)
54
55
  end
55
56
  end
57
+ set_labels(
58
+ node,
59
+ [
60
+ "provider=vagrant"
61
+ ]
62
+ )
56
63
  end
57
64
 
58
65
  def generate_name
@@ -66,6 +73,11 @@ module Kontena
66
73
  def node_exists_in_grid?(grid, name)
67
74
  api_client.get("grids/#{grid}/nodes")['nodes'].find{|n| n['name'] == name}
68
75
  end
76
+
77
+ def set_labels(node, labels)
78
+ data = {labels: labels}
79
+ api_client.put("nodes/#{node['id']}", data, {}, {'Kontena-Grid-Token' => node['grid']['token']})
80
+ end
69
81
  end
70
82
  end
71
83
  end
@@ -1,7 +1,7 @@
1
1
  module Kontena
2
2
  module Plugin
3
3
  module Vagrant
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kontena-plugin-vagrant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kontena, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-10 00:00:00.000000000 Z
11
+ date: 2016-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kontena-cli