devops 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/host/default.rb +0 -4
- data/lib/tasks/ec2.rb +18 -6
- data/lib/version.rb +1 -1
- metadata +106 -98
data/lib/host/default.rb
CHANGED
data/lib/tasks/ec2.rb
CHANGED
@@ -14,26 +14,38 @@ namespace "hosts" do
|
|
14
14
|
# used if no name is given
|
15
15
|
count = 0
|
16
16
|
|
17
|
-
ec2.
|
18
|
-
|
17
|
+
response = ec2.client.describe_instances
|
18
|
+
|
19
|
+
response[:instance_index].each do | instance |
|
20
|
+
|
21
|
+
h = instance[1]
|
22
|
+
|
23
|
+
tags = {}
|
24
|
+
h[:tag_set].each { |tag|
|
25
|
+
tags[tag[:key]] = tag[:value]
|
26
|
+
}
|
27
|
+
|
28
|
+
name = tags["Name"]
|
19
29
|
|
20
30
|
if name.nil? || name.empty?
|
21
31
|
name = "noname-#{ count }"
|
22
32
|
count += 1
|
23
33
|
end
|
24
34
|
|
25
|
-
ip = h
|
35
|
+
ip = h[:dns_name] || "stopped"
|
26
36
|
|
27
37
|
puts "Discovered: #{ name } -> #{ ip }"
|
28
38
|
|
29
39
|
hosts[ name ] = {
|
30
40
|
"HostName" => ip,
|
31
|
-
"User" =>
|
32
|
-
"IdentityFile" => h
|
33
|
-
"Tags" =>
|
41
|
+
"User" => tags["User"],
|
42
|
+
"IdentityFile" => h[:key_name],
|
43
|
+
"Tags" => tags,
|
34
44
|
"Type" => "EC2" }
|
35
45
|
end
|
36
46
|
|
47
|
+
puts "Synced #{hosts.count} instances"
|
48
|
+
|
37
49
|
tmp_dir = File.join( Ops::pwd_dir, 'tmp' )
|
38
50
|
Dir.mkdir( tmp_dir ) unless File.directory? tmp_dir
|
39
51
|
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,120 +1,117 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: devops
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Hardeep Shoker
|
9
14
|
- Ryan Willoughby
|
10
15
|
autorequire:
|
11
16
|
bindir: bin
|
12
17
|
cert_chain: []
|
13
|
-
|
14
|
-
|
15
|
-
|
18
|
+
|
19
|
+
date: 2014-02-06 00:00:00 +00:00
|
20
|
+
default_executable:
|
21
|
+
dependencies:
|
22
|
+
- !ruby/object:Gem::Dependency
|
16
23
|
name: bundler
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
|
-
requirements:
|
20
|
-
- - ! '>='
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '0'
|
23
|
-
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
26
|
none: false
|
27
|
-
requirements:
|
28
|
-
- -
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
none: false
|
35
|
-
requirements:
|
36
|
-
- - ! '>='
|
37
|
-
- !ruby/object:Gem::Version
|
38
|
-
version: '0'
|
27
|
+
requirements:
|
28
|
+
- - ">="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
hash: 3
|
31
|
+
segments:
|
32
|
+
- 0
|
33
|
+
version: "0"
|
39
34
|
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: i18n
|
40
38
|
prerelease: false
|
41
|
-
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
42
40
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
none: false
|
51
|
-
requirements:
|
52
|
-
- - ! '>='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 3
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
version: "0"
|
55
48
|
type: :runtime
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: aws-sdk
|
56
52
|
prerelease: false
|
57
|
-
|
58
|
-
none: false
|
59
|
-
requirements:
|
60
|
-
- - ! '>='
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '0'
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
|
-
name: net-ssh
|
65
|
-
requirement: !ruby/object:Gem::Requirement
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
66
54
|
none: false
|
67
|
-
requirements:
|
68
|
-
- -
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
71
62
|
type: :runtime
|
63
|
+
version_requirements: *id003
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
name: net-ssh
|
72
66
|
prerelease: false
|
73
|
-
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
74
68
|
none: false
|
75
|
-
requirements:
|
76
|
-
- -
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
none: false
|
83
|
-
requirements:
|
84
|
-
- - ! '>='
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: '0'
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 3
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
version: "0"
|
87
76
|
type: :runtime
|
77
|
+
version_requirements: *id004
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: json
|
88
80
|
prerelease: false
|
89
|
-
|
81
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
90
82
|
none: false
|
91
|
-
requirements:
|
92
|
-
- -
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
none: false
|
99
|
-
requirements:
|
100
|
-
- - ! '>='
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '0'
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
hash: 3
|
87
|
+
segments:
|
88
|
+
- 0
|
89
|
+
version: "0"
|
103
90
|
type: :runtime
|
91
|
+
version_requirements: *id005
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: rake
|
104
94
|
prerelease: false
|
105
|
-
|
95
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
106
96
|
none: false
|
107
|
-
requirements:
|
108
|
-
- -
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
hash: 3
|
101
|
+
segments:
|
102
|
+
- 0
|
103
|
+
version: "0"
|
104
|
+
type: :runtime
|
105
|
+
version_requirements: *id006
|
111
106
|
description: Ops tool for remote servers
|
112
107
|
email: hardeepshoker@gmail.com
|
113
|
-
executables:
|
108
|
+
executables:
|
114
109
|
- ops
|
115
110
|
extensions: []
|
111
|
+
|
116
112
|
extra_rdoc_files: []
|
117
|
-
|
113
|
+
|
114
|
+
files:
|
118
115
|
- .gitignore
|
119
116
|
- .rspec
|
120
117
|
- Gemfile
|
@@ -142,28 +139,39 @@ files:
|
|
142
139
|
- spec/lib/host/default_spec.rb
|
143
140
|
- spec/lib/host/list_spec.rb
|
144
141
|
- spec/spec_helper.rb
|
142
|
+
has_rdoc: true
|
145
143
|
homepage: https://github.com/hardeep/ops
|
146
144
|
licenses: []
|
145
|
+
|
147
146
|
post_install_message:
|
148
147
|
rdoc_options: []
|
149
|
-
|
148
|
+
|
149
|
+
require_paths:
|
150
150
|
- lib
|
151
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
151
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
152
152
|
none: false
|
153
|
-
requirements:
|
154
|
-
- -
|
155
|
-
- !ruby/object:Gem::Version
|
156
|
-
|
157
|
-
|
153
|
+
requirements:
|
154
|
+
- - ">="
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
hash: 3
|
157
|
+
segments:
|
158
|
+
- 0
|
159
|
+
version: "0"
|
160
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
161
|
none: false
|
159
|
-
requirements:
|
160
|
-
- -
|
161
|
-
- !ruby/object:Gem::Version
|
162
|
-
|
162
|
+
requirements:
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
hash: 3
|
166
|
+
segments:
|
167
|
+
- 0
|
168
|
+
version: "0"
|
163
169
|
requirements: []
|
170
|
+
|
164
171
|
rubyforge_project:
|
165
|
-
rubygems_version: 1.
|
172
|
+
rubygems_version: 1.6.2
|
166
173
|
signing_key:
|
167
174
|
specification_version: 3
|
168
175
|
summary: Ops tool for remote servers
|
169
176
|
test_files: []
|
177
|
+
|