infrataster-plugin-chef 0.0.3

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 ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ M2QyY2ZkYmMwMmMzNzQ0YWE2ZWVlOTBkM2ZkNmRmNzcwOGM0NTI0ZA==
5
+ data.tar.gz: !binary |-
6
+ ZjRmZDUzMWM3ZWJlNmE3MmMwY2ZmYWNiNjhiMTVhZTcyNjE0OGI1OQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ MmI4MTlmZDk1NTdhZTk3YzJiODM1YTY2YWVmZTg4ZmVjMzI1MGQ3MTZkNDIx
10
+ YWIxYTQ0Mjk4NTFhMmY5NzY2NGQ3ZjAxYWYzOGUxZmRlMDk3MmE4NDlkOGUw
11
+ MmFhOGM5ZDk3NGJlNmVkZjVlYTA5NDUzMzVhNTQ2MjU3YjdlMTg=
12
+ data.tar.gz: !binary |-
13
+ YjdjN2ExMjQ0Mzk0MjZhM2IwYmU2OGZlNWVlODhkYjJlYzIyMjRlZjk5ODdj
14
+ MWEyOTJhZWU4NDM1MDZhNzM1ZjFmNTQ0ODA2MDAzM2NhMDYzNGVkMzgxMzkw
15
+ NGU3YjUzNjZhOGIyMjk1MjNlNzQzMDY2YzhmNWRhNDRjNDU5Nzc=
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ *.gem
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ Style/FileName:
2
+ Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,149 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ infrataster-plugin-chef (0.0.1)
5
+ chef (< 12)
6
+ infrataster (~> 0.2.0)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ ast (2.0.0)
12
+ astrolabe (1.3.0)
13
+ parser (>= 2.2.0.pre.3, < 3.0)
14
+ capybara (2.4.4)
15
+ mime-types (>= 1.16)
16
+ nokogiri (>= 1.3.3)
17
+ rack (>= 1.0.0)
18
+ rack-test (>= 0.5.4)
19
+ xpath (~> 2.0)
20
+ chef (11.12.8)
21
+ chef-zero (>= 2.0.2, < 2.1)
22
+ diff-lcs (~> 1.2, >= 1.2.4)
23
+ erubis (~> 2.7)
24
+ highline (~> 1.6, >= 1.6.9)
25
+ json (>= 1.4.4, <= 1.8.1)
26
+ mime-types (~> 1.16)
27
+ mixlib-authentication (~> 1.3)
28
+ mixlib-cli (~> 1.4)
29
+ mixlib-config (~> 2.0)
30
+ mixlib-log (~> 1.3)
31
+ mixlib-shellout (~> 1.4)
32
+ net-ssh (~> 2.6)
33
+ net-ssh-multi (~> 1.1)
34
+ ohai (~> 7.0.4)
35
+ pry (~> 0.9)
36
+ rest-client (>= 1.0.4, < 1.7.0)
37
+ yajl-ruby (~> 1.1)
38
+ chef-zero (2.0.2)
39
+ hashie (~> 2.0)
40
+ json
41
+ mixlib-log (~> 1.3)
42
+ rack
43
+ cliver (0.3.2)
44
+ coderay (1.1.0)
45
+ diff-lcs (1.2.5)
46
+ erubis (2.7.0)
47
+ faraday (0.9.0)
48
+ multipart-post (>= 1.2, < 3)
49
+ hashie (2.1.2)
50
+ highline (1.6.21)
51
+ infrataster (0.2.0)
52
+ capybara
53
+ faraday
54
+ net-ssh
55
+ net-ssh-gateway
56
+ poltergeist
57
+ rspec (>= 2.0, < 4.0)
58
+ thor
59
+ ipaddress (0.8.0)
60
+ json (1.8.1)
61
+ method_source (0.8.2)
62
+ mime-types (1.25.1)
63
+ mini_portile (0.6.1)
64
+ mixlib-authentication (1.3.0)
65
+ mixlib-log
66
+ mixlib-cli (1.5.0)
67
+ mixlib-config (2.1.0)
68
+ mixlib-log (1.6.0)
69
+ mixlib-shellout (1.6.1)
70
+ multi_json (1.10.1)
71
+ multipart-post (2.0.0)
72
+ net-ssh (2.9.1)
73
+ net-ssh-gateway (1.2.0)
74
+ net-ssh (>= 2.6.5)
75
+ net-ssh-multi (1.2.0)
76
+ net-ssh (>= 2.6.5)
77
+ net-ssh-gateway (>= 1.2.0)
78
+ nokogiri (1.6.5)
79
+ mini_portile (~> 0.6.0)
80
+ ohai (7.0.4)
81
+ ipaddress
82
+ mime-types (~> 1.16)
83
+ mixlib-cli
84
+ mixlib-config (~> 2.0)
85
+ mixlib-log
86
+ mixlib-shellout (~> 1.2)
87
+ systemu (~> 2.5.2)
88
+ yajl-ruby
89
+ parser (2.2.0.pre.8)
90
+ ast (>= 1.1, < 3.0)
91
+ slop (~> 3.4, >= 3.4.5)
92
+ poltergeist (1.5.1)
93
+ capybara (~> 2.1)
94
+ cliver (~> 0.3.1)
95
+ multi_json (~> 1.0)
96
+ websocket-driver (>= 0.2.0)
97
+ powerpack (0.0.9)
98
+ pry (0.10.1)
99
+ coderay (~> 1.1.0)
100
+ method_source (~> 0.8.1)
101
+ slop (~> 3.4)
102
+ rack (1.5.2)
103
+ rack-test (0.6.2)
104
+ rack (>= 1.0)
105
+ rainbow (2.0.0)
106
+ rake (10.4.2)
107
+ rdoc (4.2.0)
108
+ json (~> 1.4)
109
+ rest-client (1.6.8)
110
+ mime-types (~> 1.16)
111
+ rdoc (>= 2.4.2)
112
+ rspec (3.1.0)
113
+ rspec-core (~> 3.1.0)
114
+ rspec-expectations (~> 3.1.0)
115
+ rspec-mocks (~> 3.1.0)
116
+ rspec-core (3.1.7)
117
+ rspec-support (~> 3.1.0)
118
+ rspec-expectations (3.1.2)
119
+ diff-lcs (>= 1.2.0, < 2.0)
120
+ rspec-support (~> 3.1.0)
121
+ rspec-mocks (3.1.3)
122
+ rspec-support (~> 3.1.0)
123
+ rspec-support (3.1.2)
124
+ rubocop (0.28.0)
125
+ astrolabe (~> 1.3)
126
+ parser (>= 2.2.0.pre.7, < 3.0)
127
+ powerpack (~> 0.0.6)
128
+ rainbow (>= 1.99.1, < 3.0)
129
+ ruby-progressbar (~> 1.4)
130
+ ruby-progressbar (1.7.0)
131
+ slop (3.6.0)
132
+ systemu (2.5.2)
133
+ thor (0.19.1)
134
+ websocket-driver (0.5.0)
135
+ websocket-extensions (>= 0.1.0)
136
+ websocket-extensions (0.1.1)
137
+ xpath (2.0.0)
138
+ nokogiri (~> 1.3)
139
+ yajl-ruby (1.2.1)
140
+
141
+ PLATFORMS
142
+ ruby
143
+
144
+ DEPENDENCIES
145
+ bundler (~> 1.6)
146
+ infrataster-plugin-chef!
147
+ rake
148
+ rspec
149
+ rubocop
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Paul Thomas
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # infrataster-plugin-chef
2
+
3
+ This is a plugin that works with https://github.com/ryotarai/infrataster and https://github.com/opscode/chef-provisioning under Vagrant to extend the `Infrataster::Server` object to contain Chef node data
4
+
5
+ # Usage
6
+
7
+ Within your `spec_helper.rb` instead of using `Infrataster::Server.define` use the new `Infrataster::ChefServer` class instead as shown below
8
+
9
+ ```ruby
10
+ Infrataster::ChefServer.define(
11
+ "testserver",
12
+ "192.168.39.20",
13
+ chefnode: "prov/repo/nodes/testserver.json",
14
+ vagrant: true
15
+ )
16
+ ```
17
+
18
+ `chefnode` is a new argument that provides the path to a JSON file that represents the chef node. When using chef-provisioning to create servers this is usually created by chef-provisioning within your existing local repository
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ # rubocop:disable Style/RegexpLiteral
3
+ Gem::Specification.new do |spec|
4
+ spec.name = 'infrataster-plugin-chef'
5
+ spec.version = '0.0.3'
6
+ spec.authors = ['Paul Thomas']
7
+ spec.email = ['pthomas@dyn.com']
8
+ spec.summary = 'Add Chef node data to Infrataster from JSON'
9
+ spec.homepage = 'https://github.com/Afterglow/infrataster-plugin-chef'
10
+ spec.license = 'MIT'
11
+
12
+ spec.files = `git ls-files -z`.split("\x0")
13
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
14
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
15
+ spec.require_paths = ['lib']
16
+
17
+ spec.add_runtime_dependency 'infrataster', '~> 0.2.0'
18
+ spec.add_runtime_dependency 'chef', '~> 11.12'
19
+
20
+ spec.add_development_dependency 'bundler', '~> 1.6'
21
+ spec.add_development_dependency 'rake'
22
+ spec.add_development_dependency 'rspec'
23
+ spec.add_development_dependency 'rubocop'
24
+ end
@@ -0,0 +1,26 @@
1
+ require 'infrataster/server'
2
+ require 'chef/node'
3
+ require 'json'
4
+
5
+ module Infrataster
6
+ # Adds chef data to Infrataster::Server
7
+ class ChefServer < Infrataster::Server
8
+ class << self
9
+ def define(*args)
10
+ @@servers << ChefServer.new(*args)
11
+ end
12
+ end
13
+
14
+ attr_reader :node
15
+
16
+ def node_from_file(file)
17
+ obj = JSON.parse(IO.read(file))
18
+ Chef::Node.json_create(obj)
19
+ end
20
+
21
+ def initialize(name, address, options = {})
22
+ @node = node_from_file(options[:chefnode])
23
+ super(name, address, options)
24
+ end
25
+ end
26
+ end
@@ -0,0 +1 @@
1
+ require 'infrataster/chef_server'
@@ -0,0 +1,10 @@
1
+ require 'infrataster/rspec'
2
+ require 'infrataster-plugin-chef'
3
+
4
+ RSpec.configure do |config|
5
+ config.treat_symbols_as_metadata_keys_with_true_values = true
6
+ config.run_all_when_everything_filtered = true
7
+ config.filter_run :focus
8
+
9
+ config.order = 'random'
10
+ end
metadata ADDED
@@ -0,0 +1,139 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: infrataster-plugin-chef
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Paul Thomas
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: infrataster
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 0.2.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 0.2.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: chef
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '11.12'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '11.12'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.6'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description:
98
+ email:
99
+ - pthomas@dyn.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - .gitignore
105
+ - .rubocop.yml
106
+ - Gemfile
107
+ - Gemfile.lock
108
+ - LICENSE.txt
109
+ - README.md
110
+ - infrataster-plugin-chef.gemspec
111
+ - lib/infrataster-plugin-chef.rb
112
+ - lib/infrataster/chef_server.rb
113
+ - spec/spec_helper.rb
114
+ homepage: https://github.com/Afterglow/infrataster-plugin-chef
115
+ licenses:
116
+ - MIT
117
+ metadata: {}
118
+ post_install_message:
119
+ rdoc_options: []
120
+ require_paths:
121
+ - lib
122
+ required_ruby_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ! '>='
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ required_rubygems_version: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ requirements: []
133
+ rubyforge_project:
134
+ rubygems_version: 2.2.2
135
+ signing_key:
136
+ specification_version: 4
137
+ summary: Add Chef node data to Infrataster from JSON
138
+ test_files:
139
+ - spec/spec_helper.rb