stacksondeck 1.1.4 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.md +12 -5
- data/VERSION +1 -1
- data/lib/stacksondeck/app.rb +15 -14
- data/lib/stacksondeck/main.rb +5 -5
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15986bb862a807230480fa8c0ce5fcc356739f17
|
4
|
+
data.tar.gz: d8489c25579af8b858444691e038dd7de9506241
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e56c4f63a984b02ecc2a51756762a7f7eeedc3e96b5a27eb25ede66aaa054f203941023507cf6ceff4889f7a95659ae2f3f0d8ddf05603850f59e4d21934a3fb
|
7
|
+
data.tar.gz: 3176dd765e2447b7c113013920c6111a3490ce87d71053d737030945a78d3729b7d530b5047b2ec6c114903b848b72a2c4fbc3f253e9bf47406bd0235b052b5b
|
data/Readme.md
CHANGED
@@ -9,9 +9,8 @@ for a configurable amount of time (`--refresh`). You may also wish to override
|
|
9
9
|
the Rundeck user name to suit your environment (`--username`).
|
10
10
|
|
11
11
|
SOD merges a Chef node's environments, roles, and tags into Rundeck tags. This
|
12
|
-
behavior is not currently configurable, but you may use the `--
|
13
|
-
(introduced in v1.
|
14
|
-
will be merged with the information discovered via Chef Search.
|
12
|
+
behavior is not currently configurable, but you may use the `--hints` feature
|
13
|
+
(introduced in v1.2.0) to override information discovered via Chef Search.
|
15
14
|
|
16
15
|
|
17
16
|
## Usage
|
@@ -42,7 +41,7 @@ You're most likely inteterested in the `server` command:
|
|
42
41
|
# Default: ${job.username}
|
43
42
|
-r, [--refresh=N] # Refresh interval in seconds
|
44
43
|
# Default: 900
|
45
|
-
-
|
44
|
+
-h, [--hints=HINTS] # JSON file with node hints
|
46
45
|
-l, [--log=LOG] # Log to file instead of STDOUT
|
47
46
|
-v, [--debug], [--no-debug] # Enable DEBUG-level logging
|
48
47
|
-z, [--trace], [--no-trace] # Enable TRACE-level logging
|
@@ -80,7 +79,7 @@ command line.
|
|
80
79
|
|
81
80
|
Return the application version:
|
82
81
|
|
83
|
-
1.
|
82
|
+
1.2.0
|
84
83
|
|
85
84
|
(Yeah I lied when I said only one endpoint. Sue me.)
|
86
85
|
|
@@ -88,6 +87,14 @@ Return the application version:
|
|
88
87
|
|
89
88
|
## Changelog
|
90
89
|
|
90
|
+
#### v1.2.0
|
91
|
+
|
92
|
+
- Replace `tagfile` with more general `hints`
|
93
|
+
|
94
|
+
#### v1.1.4
|
95
|
+
|
96
|
+
- When no groups defined, report empty mapping rather than nothing
|
97
|
+
|
91
98
|
#### v1.1.3
|
92
99
|
|
93
100
|
- Added new `tagfile` feature
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.2.0
|
data/lib/stacksondeck/app.rb
CHANGED
@@ -5,6 +5,7 @@ require 'yaml'
|
|
5
5
|
|
6
6
|
require 'ridley'
|
7
7
|
require 'sinatra/base'
|
8
|
+
require 'deep_merge'
|
8
9
|
|
9
10
|
require_relative 'metadata'
|
10
11
|
|
@@ -59,16 +60,17 @@ module StacksOnDeck
|
|
59
60
|
def log ; settings.log end
|
60
61
|
|
61
62
|
|
62
|
-
def self.
|
63
|
-
return {} if settings.
|
64
|
-
|
63
|
+
def self.refresh_hints!
|
64
|
+
return {} if settings.hints.nil?
|
65
|
+
return {} unless File.exist? settings.hints
|
66
|
+
JSON.parse File.read(settings.hints)
|
65
67
|
end
|
66
68
|
|
67
69
|
def self.refresh!
|
68
70
|
log.info event: 'refresh!'
|
69
71
|
started = Time.now
|
70
72
|
|
71
|
-
|
73
|
+
hints = refresh_hints!
|
72
74
|
|
73
75
|
nodes = @@ridley.partial_search :node, 'name:*', %w[
|
74
76
|
name
|
@@ -88,19 +90,18 @@ module StacksOnDeck
|
|
88
90
|
nodes.each do |n|
|
89
91
|
name = n.name
|
90
92
|
n = n.automatic
|
93
|
+
next if n.hostname.nil?
|
91
94
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
+
node_hints = hints[name] || {}
|
96
|
+
username = settings.username
|
97
|
+
remote_url = File.join @@ridley.server_url, 'nodes', name
|
98
|
+
edit_url = File.join remote_url, 'edit'
|
95
99
|
|
96
100
|
tags = n.tags || []
|
97
101
|
tags += n.roles || []
|
98
102
|
tags << n.chef_environment
|
99
|
-
tags += node_tags[name] if node_tags.include? name
|
100
103
|
tags = tags.uniq.compact
|
101
104
|
|
102
|
-
next if n.hostname.nil?
|
103
|
-
|
104
105
|
@@db[name] = {
|
105
106
|
'hostname' => n.hostname,
|
106
107
|
'description' => n.fqdn,
|
@@ -109,10 +110,10 @@ module StacksOnDeck
|
|
109
110
|
'osFamily' => n.platform_family,
|
110
111
|
'osName' => n.platform,
|
111
112
|
'username' => username,
|
112
|
-
'remoteUrl' =>
|
113
|
-
'editUrl' =>
|
114
|
-
'tags' => tags
|
115
|
-
}
|
113
|
+
'remoteUrl' => remote_url,
|
114
|
+
'editUrl' => edit_url,
|
115
|
+
'tags' => tags
|
116
|
+
}.deep_merge!(node_hints)
|
116
117
|
end
|
117
118
|
|
118
119
|
@@db_dump = YAML.dump @@db
|
data/lib/stacksondeck/main.rb
CHANGED
@@ -55,7 +55,7 @@ module StacksOnDeck
|
|
55
55
|
aliases: %w[ -c ],
|
56
56
|
desc: 'Location of Chef configuration',
|
57
57
|
default: DEFAULT_KNIFE,
|
58
|
-
required:
|
58
|
+
required: DEFAULT_KNIFE.nil?
|
59
59
|
option :username, \
|
60
60
|
type: :string,
|
61
61
|
aliases: %w[ -u ],
|
@@ -66,10 +66,10 @@ module StacksOnDeck
|
|
66
66
|
aliases: %w[ -r ],
|
67
67
|
desc: 'Refresh interval in seconds',
|
68
68
|
default: 900
|
69
|
-
option :
|
69
|
+
option :hints, \
|
70
70
|
type: :string,
|
71
|
-
aliases: %w[ -
|
72
|
-
desc: 'JSON file with node
|
71
|
+
aliases: %w[ -h ],
|
72
|
+
desc: 'JSON file with node hints',
|
73
73
|
required: false
|
74
74
|
include_common_options
|
75
75
|
def server
|
@@ -80,7 +80,7 @@ module StacksOnDeck
|
|
80
80
|
App.set :refresh, options.refresh
|
81
81
|
App.set :username, options.username
|
82
82
|
App.set :environment, options.environment
|
83
|
-
App.set :
|
83
|
+
App.set :hints, options.hints
|
84
84
|
|
85
85
|
if options.debug?
|
86
86
|
App.set :raise_errors, true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stacksondeck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Clemmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '4.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: deep_merge
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: eventmachine
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|