inspec 0.9.10 → 0.9.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -2
  3. data/Gemfile +1 -0
  4. data/README.md +2 -1
  5. data/bin/inspec +4 -1
  6. data/docs/dsl_resource.rst +2 -2
  7. data/docs/profiles.rst +5 -3
  8. data/examples/profile/README.md +1 -1
  9. data/inspec.gemspec +1 -1
  10. data/lib/inspec/version.rb +1 -1
  11. data/lib/resources/etc_group.rb +1 -1
  12. data/lib/resources/file.rb +5 -1
  13. data/lib/resources/package.rb +63 -9
  14. data/lib/resources/port.rb +47 -7
  15. data/lib/resources/service.rb +53 -15
  16. data/lib/resources/user.rb +42 -21
  17. data/lib/utils/parser.rb +85 -0
  18. data/test/helper.rb +8 -0
  19. data/test/integration/.kitchen.chef.yml +29 -0
  20. data/test/integration/.kitchen.ec2.yml +10 -4
  21. data/test/integration/.kitchen.shell.yml +19 -0
  22. data/test/integration/.kitchen/default-chef-solaris-1011.yml +6 -0
  23. data/test/integration/.kitchen/default-chef-windows-server-2008r2-standard.yml +7 -0
  24. data/test/integration/.kitchen/default-chef-windows-server-2012r2-standard.yml +7 -0
  25. data/test/integration/.kitchen/default-chris-rock-omnios-r151014.yml +6 -0
  26. data/test/integration/.kitchen/default-debian-81.yml +6 -0
  27. data/test/integration/.kitchen/default-omniti-omnios-r151014.yml +1 -0
  28. data/test/integration/.kitchen/default-windows-2008.yml +5 -0
  29. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-solaris-1011/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  30. data/test/integration/.kitchen/kitchen-vagrant/{kitchen-integration-default-fedora-22 → kitchen-integration-default-chef-solaris-1011}/.vagrant/machines/default/virtualbox/creator_uid +0 -0
  31. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-solaris-1011/.vagrant/machines/default/virtualbox/id +1 -0
  32. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-solaris-1011/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  33. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-solaris-1011/.vagrant/machines/default/virtualbox/private_key +27 -0
  34. data/test/integration/.kitchen/kitchen-vagrant/{kitchen-integration-default-fedora-22 → kitchen-integration-default-chef-solaris-1011}/.vagrant/machines/default/virtualbox/synced_folders +0 -0
  35. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-solaris-1011/Vagrantfile +8 -0
  36. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-windows-server-2008r2-standard/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  37. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-windows-server-2008r2-standard/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  38. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-windows-server-2008r2-standard/.vagrant/machines/default/virtualbox/id +1 -0
  39. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-windows-server-2008r2-standard/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  40. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-windows-server-2008r2-standard/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  41. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-windows-server-2008r2-standard/Vagrantfile +7 -0
  42. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-windows-server-2012r2-standard/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  43. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-windows-server-2012r2-standard/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  44. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-windows-server-2012r2-standard/.vagrant/machines/default/virtualbox/id +1 -0
  45. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-windows-server-2012r2-standard/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  46. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-windows-server-2012r2-standard/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  47. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chef-windows-server-2012r2-standard/Vagrantfile +8 -0
  48. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chris-rock-omnios-r151014/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  49. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chris-rock-omnios-r151014/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  50. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chris-rock-omnios-r151014/.vagrant/machines/default/virtualbox/id +1 -0
  51. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chris-rock-omnios-r151014/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  52. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chris-rock-omnios-r151014/.vagrant/machines/default/virtualbox/private_key +27 -0
  53. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chris-rock-omnios-r151014/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  54. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-chris-rock-omnios-r151014/Vagrantfile +8 -0
  55. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  56. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  57. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/id +1 -0
  58. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  59. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/private_key +27 -0
  60. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  61. data/test/integration/.kitchen/kitchen-vagrant/{kitchen-integration-default-fedora-22 → kitchen-integration-default-debian-81}/Vagrantfile +3 -3
  62. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-omniti-omnios-r151014/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  63. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-omniti-omnios-r151014/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  64. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-omniti-omnios-r151014/.vagrant/machines/default/virtualbox/id +1 -0
  65. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-omniti-omnios-r151014/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  66. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-omniti-omnios-r151014/.vagrant/machines/default/virtualbox/private_key +27 -0
  67. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-omniti-omnios-r151014/Vagrantfile +8 -0
  68. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/action_set_name +1 -1
  69. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/id +1 -1
  70. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/index_uuid +1 -1
  71. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/private_key +25 -25
  72. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/action_set_name +1 -1
  73. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/id +1 -1
  74. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/index_uuid +1 -1
  75. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key +25 -25
  76. data/test/integration/.kitchen/logs/default-aws-linux.log +3 -0
  77. data/test/integration/.kitchen/logs/default-centos-511-i386.log +0 -2
  78. data/test/integration/.kitchen/logs/default-centos-511.log +0 -2
  79. data/test/integration/.kitchen/logs/default-centos-67-i386.log +0 -2
  80. data/test/integration/.kitchen/logs/default-centos-67.log +0 -2
  81. data/test/integration/.kitchen/logs/default-centos-7.log +3 -0
  82. data/test/integration/.kitchen/logs/default-centos-71.log +0 -2
  83. data/test/integration/.kitchen/logs/default-chef-solaris-1011.log +0 -0
  84. data/test/integration/.kitchen/logs/default-chef-windows-server-2008r2-standard.log +0 -0
  85. data/test/integration/.kitchen/logs/default-chef-windows-server-2012r2-standard.log +0 -0
  86. data/test/integration/.kitchen/logs/default-chris-rock-omnios-r151014.log +23 -0
  87. data/test/integration/.kitchen/logs/default-debian-6010-i386.log +0 -2
  88. data/test/integration/.kitchen/logs/default-debian-6010.log +0 -2
  89. data/test/integration/.kitchen/logs/default-debian-78-i386.log +0 -2
  90. data/test/integration/.kitchen/logs/default-debian-78.log +0 -2
  91. data/test/integration/.kitchen/logs/default-debian-8.log +3 -0
  92. data/test/integration/.kitchen/logs/default-debian-81-i386.log +0 -2
  93. data/test/integration/.kitchen/logs/default-debian-81.log +240 -2
  94. data/test/integration/.kitchen/logs/default-dusank-oi-server.log +0 -0
  95. data/test/integration/.kitchen/logs/default-fedora-21-i386.log +0 -2
  96. data/test/integration/.kitchen/logs/default-fedora-21.log +0 -2
  97. data/test/integration/.kitchen/logs/default-fedora-22.log +3 -0
  98. data/test/integration/.kitchen/logs/default-freebsd-102.log +0 -2
  99. data/test/integration/.kitchen/logs/default-freebsd-93.log +0 -2
  100. data/test/integration/.kitchen/logs/default-livinginthepast-smartos-base64.log +0 -0
  101. data/test/integration/.kitchen/logs/default-mint-172-cinnamon.log +0 -2
  102. data/test/integration/.kitchen/logs/default-omniti-omnios-r151014.log +0 -0
  103. data/test/integration/.kitchen/logs/default-opensuse-132-i386.log +0 -2
  104. data/test/integration/.kitchen/logs/default-opensuse-132-x86-64.log +0 -2
  105. data/test/integration/.kitchen/logs/default-redhat-65.log +3 -0
  106. data/test/integration/.kitchen/logs/default-redhat-71.log +3 -0
  107. data/test/integration/.kitchen/logs/default-suse-11sp3.log +3 -0
  108. data/test/integration/.kitchen/logs/default-suse-12.log +3 -0
  109. data/test/integration/.kitchen/logs/default-ubuntu-1004-i386.log +0 -2
  110. data/test/integration/.kitchen/logs/default-ubuntu-1004.log +0 -2
  111. data/test/integration/.kitchen/logs/default-ubuntu-1204-i386.log +0 -2
  112. data/test/integration/.kitchen/logs/default-ubuntu-1204.log +3 -0
  113. data/test/integration/.kitchen/logs/default-ubuntu-1404-i386.log +0 -2
  114. data/test/integration/.kitchen/logs/default-ubuntu-1404.log +3 -0
  115. data/test/integration/.kitchen/logs/default-ubuntu-1510.log +3 -0
  116. data/test/integration/.kitchen/logs/default-windows-2012r2.log +2 -41
  117. data/test/integration/.kitchen/logs/default-winrm.log +0 -0
  118. data/test/integration/.kitchen/logs/kitchen.log +14 -0
  119. data/test/integration/bootstrap.sh +3 -0
  120. data/test/integration/cookbooks/os_prepare/recipes/file.rb +2 -0
  121. data/test/integration/cookbooks/os_prepare/recipes/json_yaml_csv_ini.rb +2 -0
  122. data/test/integration/cookbooks/os_prepare/recipes/mount.rb +24 -20
  123. data/test/integration/cookbooks/os_prepare/templates/default/sv-default-svlog-run.erb +1 -2
  124. data/test/integration/test/integration/default/_debug_spec.rb +1 -1
  125. data/test/integration/test/integration/default/compare_matcher_spec.rb +15 -13
  126. data/test/integration/test/integration/default/etc_group_spec.rb +9 -8
  127. data/test/integration/test/integration/default/file_spec.rb +14 -4
  128. data/test/integration/test/integration/default/group_spec.rb +17 -7
  129. data/test/integration/test/integration/default/mount_spec.rb +9 -7
  130. data/test/integration/test/integration/default/package_spec.rb +16 -0
  131. data/test/integration/test/integration/default/port_spec.rb +8 -2
  132. data/test/integration/test/integration/default/service_spec.rb +4 -1
  133. data/test/integration/test/integration/default/user_spec.rb +37 -14
  134. data/test/unit/mock/cmd/pkg-info-system-file-system-zfs +8 -0
  135. data/test/unit/mock/cmd/pkginfo-l-SUNWzfsr +7 -0
  136. data/test/unit/mock/cmd/s11-netstat-an-finet-finet6 +32 -0
  137. data/test/unit/resources/file_test.rb +1 -0
  138. data/test/unit/resources/package_test.rb +18 -0
  139. data/test/unit/resources/port_test.rb +10 -0
  140. data/test/unit/utils/passwd_parser_test.rb +2 -0
  141. data/test/unit/utils/solaris_netstat_parser.rb +124 -0
  142. metadata +127 -42
  143. data/lib/extras/compliance/README.md +0 -15
  144. data/lib/extras/compliance/compliance.rb +0 -245
  145. data/test/integration/.kitchen/default-aws-linux.yml +0 -4
  146. data/test/integration/.kitchen/default-centos-7.yml +0 -4
  147. data/test/integration/.kitchen/default-debian-8.yml +0 -4
  148. data/test/integration/.kitchen/default-fedora-22.yml +0 -4
  149. data/test/integration/.kitchen/default-redhat-65.yml +0 -4
  150. data/test/integration/.kitchen/default-redhat-71.yml +0 -4
  151. data/test/integration/.kitchen/default-suse-11sp3.yml +0 -4
  152. data/test/integration/.kitchen/default-suse-12.yml +0 -4
  153. data/test/integration/.kitchen/default-ubuntu-1204.yml +0 -3
  154. data/test/integration/.kitchen/default-ubuntu-1404.yml +0 -4
  155. data/test/integration/.kitchen/default-windows-2012r2.yml +0 -2
  156. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/action_set_name +0 -1
  157. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/id +0 -1
  158. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/index_uuid +0 -1
  159. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/private_key +0 -27
@@ -1,15 +0,0 @@
1
- # InSpec Extension for Chef Compliance
2
-
3
- This extensions offers the following features:
4
-
5
- - list profiles available in Chef Compliance
6
- - execute profiles from Chef Compliance
7
- - upload a local profile to Chef Compliance
8
-
9
- To use the CLI, this extra package adds the following commands:
10
-
11
- * `$ inspec compliance login user password` - retieves a authentication token from Chef Compliance
12
- * `$ inspec compliance list` - list all available profiles in Chef Compliance
13
- * `$ inspec exec profile` - runs a profile that is stored on Chef Compliance
14
- * `$ inspec compliance upload path/to/local/profile` - uploads a local command to Chef Compliance
15
- * `$ inspec compliance logout` - removes the authentication token from the local cache and logs out of the Chef Compliance server
@@ -1,245 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # encoding: utf-8
3
- # author: Christoph Hartmann
4
-
5
- require 'thor'
6
- require 'net/http'
7
- require 'uri'
8
-
9
- # TODO:
10
- # - invalidate token
11
- # - fix file upload and genereate tar if required
12
- # - hook into exec with a new target helper
13
-
14
- class ComplianceCLI < Thor
15
- namespace 'compliance'
16
-
17
- desc 'login SERVER', 'Log in to a Chef Compliance SERVER'
18
- options :username => :required, :password => :required
19
- def login(server)
20
- config = Compliance::Configuration.new
21
- config['server'] = server
22
- url = "#{server}/oauth/token"
23
-
24
- data = post(url, options['username'], options['password'])
25
- if !data.nil?
26
- tokendata = JSON.parse(data)
27
- if tokendata['access_token']
28
- config['token'] = tokendata['access_token']
29
- puts "Successfully authenticated"
30
- else
31
- puts 'Reponse does not include a token'
32
- end
33
- else
34
- puts "Authentication failed for Server: #{url}"
35
- end
36
- config.store
37
- end
38
-
39
- desc 'list', 'list all available profiles in Chef Compliance'
40
- def list
41
- profiles = get_profiles
42
- if !profiles.empty?
43
- # iterate over profiles
44
- puts "Available profiles: "
45
- profiles.each { |profile|
46
- puts " * #{profile[:org]}/#{profile[:name]}"
47
- }
48
- else
49
- puts "Could not reach server #{url}"
50
- end
51
- end
52
-
53
- desc 'exec PROFILE', 'executes a profile from Chef Compliance'
54
- def exec(profile)
55
- config = Compliance::Configuration.new
56
- profiles = get_profiles
57
- if !profiles.empty?
58
- # 1. verify that the profile exists (list)
59
- index = profiles.index { |p| "#{p[:org]}/#{p[:name]}" == profile }
60
- if index >= 0
61
- p = profiles[index]
62
- # 2. execute the profile with the proper url, inject `inspec exec` with the suitable params`
63
- url = "#{config['server']}/owners/#{p[:org]}/compliance/#{p[:name]}/tar"
64
- puts "b bin/inspec exec #{url} --user #{config['token']}"
65
- end
66
- else
67
- puts "The profile #{profile} is not available"
68
- end
69
- end
70
-
71
- desc 'upload PATH', 'uploads a local profile to Chef Compliance'
72
- def upload(path)
73
- # 1. detect if tar or folder
74
- # 2. archive if folder
75
- # 3. check if tar is a compliance profile
76
- # 4. show result and confirm upload to the user (skip with --force)
77
- # 5. upload tar to server
78
-
79
- # find the tar
80
- config = Compliance::Configuration.new
81
- tar_path = File.join(Dir.pwd, 'profile.tar.gz')
82
-
83
- owner = 'admin'
84
- profile = 'profile'
85
- url = "#{config['server']}/owners/#{owner}/compliance/#{profile}/tar"
86
-
87
- puts "Uploading to #{url}"
88
- if post_file(url, config['token'], '', tar_path)
89
- puts "Successfully uploaded profile"
90
- else
91
- puts "Error during profile upload"
92
- end
93
- end
94
-
95
- desc 'version', 'displays the version of the Chef Compliance server'
96
- def version
97
- config = Compliance::Configuration.new
98
- url = "#{config['server']}/version"
99
-
100
- data = get(url, nil, nil)
101
- if !data.nil?
102
- info = JSON.parse(data)
103
- puts "Chef Compliance version: #{info['version']}"
104
- else
105
- puts "Could not reach server #{url}"
106
- end
107
- end
108
-
109
- desc 'logout', 'user logout from Chef Compliance'
110
- def logout
111
- config = Compliance::Configuration.new
112
- url = "#{config['server']}/logout"
113
- data = post(url, config['token'], nil)
114
- if !data.nil?
115
- puts "Successfully logged out"
116
- else
117
- puts "Could not log out"
118
- end
119
- config.destroy
120
- end
121
-
122
- private
123
-
124
- def get_profiles
125
- config = Compliance::Configuration.new
126
-
127
- url = "#{config['server']}/user/compliance"
128
- data = get(url, config['token'], '')
129
-
130
- if !data.nil?
131
- profiles = JSON.parse(data)
132
- val = []
133
- # iterate over profiles
134
- profiles.each_key { |org|
135
- profiles[org].each_key { |name|
136
- val.push({ org: org, name: name})
137
- }
138
- }
139
- val
140
- else
141
- []
142
- end
143
- end
144
-
145
- def get(url, username, password)
146
- uri = URI.parse(url)
147
- req = Net::HTTP::Get.new(uri.path)
148
- req.basic_auth username, password
149
-
150
- send_request(uri, req)
151
- end
152
-
153
- def post(url, username, password)
154
- # form request
155
- uri = URI.parse(url)
156
- req = Net::HTTP::Post.new(uri.path)
157
- req.basic_auth username, password
158
- req.form_data={}
159
-
160
- send_request(uri, req)
161
- end
162
-
163
- # upload a file
164
- def post_file(url, username, password, file_path)
165
- uri = URI.parse(url)
166
- http = Net::HTTP.new(uri.host, uri.port)
167
- req = Net::HTTP::Post.new(uri.path)
168
- req.basic_auth username, password
169
-
170
- req.body_stream=File.open(file_path)
171
- req["Content-Type"] = "multipart/form-data"
172
- req.add_field('Content-Length', File.size(file_path))
173
- req.add_field('Content-Type', 'application/x-gtar')
174
-
175
- boundary = "INSPEC-PROFILE-UPLOAD"
176
- req.add_field('session', boundary)
177
- res=http.request(req)
178
-
179
- # puts "Response #{response.code} #{response.message}"
180
- # puts "#{response.body}"
181
- # puts "Headers: #{response.to_hash.inspect}"
182
-
183
- res.is_a?(Net::HTTPSuccess)
184
- end
185
-
186
- def send_request(uri, req)
187
- # send request
188
- res = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') {|http|
189
- http.request(req)
190
- }
191
- if res.is_a?(Net::HTTPSuccess)
192
- res.body
193
- else
194
- nil
195
- end
196
- end
197
- end
198
-
199
- module Compliance
200
- class Configuration
201
-
202
- def initialize
203
- @config_path = File.join(ENV['HOME'], '/.inspec')
204
- # ensure the directory is available
205
- unless File.directory?(@config_path)
206
- FileUtils.mkdir_p(@config_path)
207
- end
208
- # set config file pasth
209
- @config_file = File.join(@config_path, '/config.json')
210
- @config = {}
211
-
212
- # load the data
213
- get
214
- end
215
-
216
- # direct access to config
217
- def [](key)
218
- @config[key]
219
- end
220
-
221
- def []=(key, value)
222
- @config[key] = value
223
- end
224
-
225
- # return the json data
226
- def get
227
- if File.exists?(@config_file)
228
- file = File.read(@config_file)
229
- @config = JSON.parse(file)
230
- end
231
- @config
232
- end
233
-
234
- # stores a hash to json
235
- def store
236
- File.open(@config_file,"w") do |f|
237
- f.write(@config.to_json)
238
- end
239
- end
240
-
241
- def destroy
242
- File.delete(@config_file)
243
- end
244
- end
245
- end
@@ -1,4 +0,0 @@
1
- ---
2
- server_id: i-645bddd8
3
- hostname: ec2-52-29-45-159.eu-central-1.compute.amazonaws.com
4
- last_action: converge
@@ -1,4 +0,0 @@
1
- ---
2
- server_id: i-cd5adc71
3
- hostname: ec2-52-58-14-5.eu-central-1.compute.amazonaws.com
4
- last_action: setup
@@ -1,4 +0,0 @@
1
- ---
2
- server_id: i-fb58de47
3
- hostname: ec2-52-29-199-226.eu-central-1.compute.amazonaws.com
4
- last_action: setup
@@ -1,4 +0,0 @@
1
- ---
2
- server_id: i-565bddea
3
- hostname: ec2-52-29-81-120.eu-central-1.compute.amazonaws.com
4
- last_action: converge
@@ -1,4 +0,0 @@
1
- ---
2
- server_id: i-bc5bdd00
3
- hostname: ec2-52-29-169-254.eu-central-1.compute.amazonaws.com
4
- last_action: converge
@@ -1,4 +0,0 @@
1
- ---
2
- server_id: i-f558de49
3
- hostname: ec2-52-58-13-178.eu-central-1.compute.amazonaws.com
4
- last_action: converge
@@ -1,4 +0,0 @@
1
- ---
2
- server_id: i-615bdddd
3
- hostname: ec2-52-58-17-235.eu-central-1.compute.amazonaws.com
4
- last_action: converge
@@ -1,4 +0,0 @@
1
- ---
2
- server_id: i-ad59df11
3
- hostname: ec2-52-28-162-79.eu-central-1.compute.amazonaws.com
4
- last_action: converge
@@ -1,3 +0,0 @@
1
- ---
2
- server_id: i-6258dede
3
- hostname: ''
@@ -1,4 +0,0 @@
1
- ---
2
- server_id: i-395bdd85
3
- hostname: ec2-52-28-206-244.eu-central-1.compute.amazonaws.com
4
- last_action: converge
@@ -1,2 +0,0 @@
1
- ---
2
- username: administrator
@@ -1,27 +0,0 @@
1
- -----BEGIN RSA PRIVATE KEY-----
2
- MIIEogIBAAKCAQEAwLGEO0LYDlsK9XekX6zmTVq0Elm/NwUtKQ7rFcBtGXzdpee0
3
- XyhnpgnEIVL1MYL3gu3xxqNUKCrcoM1PPw8cZZqI9rT/GEEoy708wAkBbkLD81D8
4
- ABUJ7SyP24Gj8sewuTkppkgFvYwM5yIqyP8WjCnCGr4KRUC1HCAH1U+9LJfaaarW
5
- a5EJVDbfsrz9YoUG1fLm1nSReECFtgl7z1ZYdamjl1nd3m+OFJ5I9TRs38VEP0qg
6
- L6XhdCyYwLqKhcF3pGF/CXkuBmlv4p722PAa/dL3RhoE2pAHAbncPuzySY/KQgLo
7
- lsLN48LVpSBcwhXzZeyzsnr7XcsyP1s6V6ntfQIDAQABAoIBAEStgFGWy2aicE94
8
- qu8mspaTY2a+8fXsNGJT3NnN0ZSp+l2tLY5U2kxFYs/1v0o8QXc601dW0yHV1PjC
9
- 9CGngxl7cKFtdRXx81ZaRhKzovzncut/y7FDzlvn7AXyOLrJDWWWyA9p0BH0noyq
10
- ktE8iY6/O11IqmRwYZx6lhAi8Wu4vQ4ytVQhv15qNubka65RR9ylq0+dTPV4OIoW
11
- H9tASvvTh3vb/zpBcBKvX4x9n6F9I2Vf0GgXwA+2E+/1frnatYqU8VjgXsc4D0yC
12
- pWQyumGrytS6/jBnd64laqnvT1QFitaWob08WPHWYnXiBr0mlHGRpl5iz6l3sJKV
13
- 6a3LX8kCgYEA7J8jpd/ONFuPQDTrPQQJ7coDL0Dmxu5ihUVDgT/FfAz4OM9KF+ej
14
- ptiDbl/UrSZQm1GcT3CwLOevgPcsK7rTBFOBwRxvi9Wf3I6g4QozeXcPEcZWmDAn
15
- u+Lg6fMceKu8lwbTBLLqf02wk2IJkXgixXJJ6khxRy0qPujgQqERjbsCgYEA0Hln
16
- 6lmTOlN+mMs5pPu43ZRNy//QVUKBdOsZjyOnU3mydHRr+j1e3wN4csX6odBU2D9X
17
- JKqd2Xep1biTGPEZjRnqgVeGzHpoDJTgGaJevhr2WZ+zySEmbIInTOtS/jGvhwG9
18
- y23Zr5nIeVJGJ91eBT7GidjDYo7YvFabRjuXoicCgYAqR20ZMFop5Mo90LbPmi8j
19
- +9qB0PjrRqD36x5as8hXmAGqNO+qQctt/nXNfPYFUjlI51Yko5/3BhbH1mJgFeuq
20
- dDlVBf2wYKVFxX5dd3MnGuzoYiYK31/aJHnHk5bcwOLboW6HAmkAAiOw0e2fvnWI
21
- DhnC8Nq8uwc3YmjfvuPiDQKBgDJFBCy7WsgWuBEp+AVzeXlcuIG3dsoIVmUWB7y/
22
- USrMzp5MMHlP8R9/m7y5Rp1cOglHBMFfrt5wf3B8qGO8R3gBxs1XiLan0Y0vHPax
23
- c30NzVeBLf4S00wY+lcO651F59h7MAPswjAYugGfODGGrJRBNeipbzvFzDdl/t0p
24
- o3/DAoGAPM0tH/0E71pE3X2DGIAxgcma/waVurPGxw9+QqgksQW3+tkCg2EYuN8V
25
- dAKKa9aI739+1Em3S0Cr4dfSon8zyEBpyZhxlpY+/KypzrQgTEYS/l8u4Vdk0L74
26
- wL55wMiM0la2sLqUtgFF5zqSGCg7LLWNMc6owmlG5RZrneDjams=
27
- -----END RSA PRIVATE KEY-----