chef-provisioning 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -4
- data/README.md +49 -51
- data/chef-provisioning.gemspec +1 -0
- data/lib/chef/provisioning/transport/winrm.rb +17 -16
- data/lib/chef/provisioning/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f204092e9a7d1e82aed406dfe240d4aaffe7d58
|
4
|
+
data.tar.gz: fd7d3085242de0d888eb52adf2b33b30d5916d2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39479eff2b60ac3e64dea5d4cf63b743d53fd4fd1b6205ca995acb50a3792236cbb17a1919956e8955747704f97b9aea47127edbeb79a05b6439a01f4ca56915
|
7
|
+
data.tar.gz: 7672f59422b99b17420e18e53d1a2e4b9f9ca764c1cd6b3c944f09077fdd8f1fa7a32d05dc7e55a295b4b41f726bc00e9e89aa4053a616d7f3c0a95d4743bb74
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,33 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [2.
|
4
|
-
[Full Changelog](https://github.com/chef/chef-provisioning/compare/v2.0
|
3
|
+
## [2.1.1](https://github.com/chef/chef-provisioning/tree/2.1.1) (2017-02-14)
|
4
|
+
[Full Changelog](https://github.com/chef/chef-provisioning/compare/v2.1.0...2.1.1)
|
5
|
+
|
6
|
+
**Merged pull requests:**
|
7
|
+
|
8
|
+
- Leverage winrm-elevated to execute chef install script [\#562](https://github.com/chef/chef-provisioning/pull/562) ([tyler-ball](https://github.com/tyler-ball))
|
9
|
+
- Updating various READMEs to try and better call out benefits, drawbacks and the target audience [\#557](https://github.com/chef/chef-provisioning/pull/557) ([tyler-ball](https://github.com/tyler-ball))
|
10
|
+
|
11
|
+
## [v2.1.0](https://github.com/chef/chef-provisioning/tree/v2.1.0) (2017-01-11)
|
12
|
+
[Full Changelog](https://github.com/chef/chef-provisioning/compare/v2.0.2...v2.1.0)
|
13
|
+
|
14
|
+
**Merged pull requests:**
|
15
|
+
|
16
|
+
- relax upper bounds on deps [\#556](https://github.com/chef/chef-provisioning/pull/556) ([lamont-granquist](https://github.com/lamont-granquist))
|
17
|
+
- Add a section about ACLs in README.me [\#553](https://github.com/chef/chef-provisioning/pull/553) ([elthariel](https://github.com/elthariel))
|
18
|
+
- Update README.md [\#548](https://github.com/chef/chef-provisioning/pull/548) ([martinmosegaard](https://github.com/martinmosegaard))
|
19
|
+
|
20
|
+
## [v2.0.2](https://github.com/chef/chef-provisioning/tree/v2.0.2) (2016-09-22)
|
21
|
+
[Full Changelog](https://github.com/chef/chef-provisioning/compare/v2.0.1...v2.0.2)
|
5
22
|
|
6
23
|
**Fixed bugs:**
|
7
24
|
|
8
25
|
- Allow mixlib-install 2.0 [\#546](https://github.com/chef/chef-provisioning/pull/546) ([jkeiser](https://github.com/jkeiser))
|
9
26
|
|
27
|
+
**Merged pull requests:**
|
28
|
+
|
29
|
+
- Bump version to 2.0.2 [\#547](https://github.com/chef/chef-provisioning/pull/547) ([jkeiser](https://github.com/jkeiser))
|
30
|
+
|
10
31
|
## [v2.0.1](https://github.com/chef/chef-provisioning/tree/v2.0.1) (2016-09-07)
|
11
32
|
[Full Changelog](https://github.com/chef/chef-provisioning/compare/v2.0.0...v2.0.1)
|
12
33
|
|
@@ -276,7 +297,6 @@
|
|
276
297
|
**Closed issues:**
|
277
298
|
|
278
299
|
- chef-dk 0.5.1 with chef-zero renders unusable chefzero://localhost:8889 URLs on nodes [\#336](https://github.com/chef/chef-provisioning/issues/336)
|
279
|
-
- Updating chef-provisioning-aws breaks chef-client -z functionality with ChefDK 0.4.0 \(current version\). [\#322](https://github.com/chef/chef-provisioning/issues/322)
|
280
300
|
- Converging 0 resources - Am I missing something? [\#320](https://github.com/chef/chef-provisioning/issues/320)
|
281
301
|
|
282
302
|
**Merged pull requests:**
|
@@ -904,4 +924,4 @@
|
|
904
924
|
## [v0.1](https://github.com/chef/chef-provisioning/tree/v0.1) (2013-12-21)
|
905
925
|
|
906
926
|
|
907
|
-
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
927
|
+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
data/README.md
CHANGED
@@ -1,17 +1,53 @@
|
|
1
1
|
Chef Provisioning
|
2
2
|
==========
|
3
|
-
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/chef/chef-provisioning?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4
|
-
[![Stories in Ready](https://badge.waffle.io/chef/chef-provisioning.png?label=ready&title=Ready)](https://waffle.io/chef/chef-provisioning)
|
5
3
|
[![Status](https://travis-ci.org/chef/chef-provisioning.svg?branch=master)](https://travis-ci.org/chef/chef-provisioning)
|
6
4
|
[![Gem Version](https://badge.fury.io/rb/chef-provisioning.svg)](http://badge.fury.io/rb/chef-provisioning)
|
7
5
|
|
8
|
-
|
6
|
+
Please join us in Slack by signing up at http://community-slack.chef.io/ and joining `#chef-provisioning`
|
9
7
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
Overview
|
9
|
+
==========
|
10
|
+
|
11
|
+
Chef Provisioning is a Cookbook and Recipe based approach for managing your infrastructure. Users can codify their infrastructure and use Chef to converge their infrastructure to the desired state. It has a plugin model (called Drivers) to manage different infrastructures, including AWS, Azure and Fog.
|
12
|
+
|
13
|
+
Chef Provisioning is maintained according to the [Chef Maintenance Policy](https://github.com/chef/chef-rfc/blob/master/rfc030-maintenance-policy.md).
|
14
|
+
|
15
|
+
Drivers
|
16
|
+
-------------
|
17
|
+
|
18
|
+
Due to the age and engagement level with different Drivers they have fallen into two categories - maintained and unmaintained.
|
19
|
+
|
20
|
+
Maintained drivers have a representative in the maintenance policy and get triaged / discussed during office hours. They are
|
21
|
+
|
22
|
+
[AWS](https://github.com/chef/chef-provisioning-aws) | [Fog](https://github.com/chef/chef-provisioning-fog)
|
23
|
+
---- | ---- | ----
|
24
|
+
[![Gem Version](https://badge.fury.io/rb/chef-provisioning-aws.svg)](http://badge.fury.io/rb/chef-provisioning-aws) | [![Gem Version](https://badge.fury.io/rb/chef-provisioning-fog.svg)](http://badge.fury.io/rb/chef-provisioning-fog)
|
25
|
+
|
26
|
+
Two drivers are not maintained by Chef:
|
27
|
+
|
28
|
+
* [VSphere](https://github.com/CenturyLinkCloud/chef-provisioning-vsphere)
|
29
|
+
* [AsureRM](https://github.com/pendrica/chef-provisioning-azurerm)
|
30
|
+
|
31
|
+
Unmaintained Drivers are at risk of becoming stale. They are:
|
32
|
+
|
33
|
+
* [Docker](https://github.com/chef/chef-provisioning-docker)
|
34
|
+
* [ssh](https://github.com/chef/chef-provisioning-ssh)
|
35
|
+
* [Vagrant](https://github.com/chef/chef-provisioning-vagrant)
|
36
|
+
* [LXC](https://github.com/chef/chef-provisioning-lxc)
|
37
|
+
* [Hanlon](https://github.com/chef/chef-provisioning-hanlon)
|
38
|
+
|
39
|
+
Target Audience
|
40
|
+
-------------
|
41
|
+
|
42
|
+
Chef Provisioning is a good fit for people who use or want to use the Chef ecosystem to manage their infrastructure. Infrastructure is represented as Chef Resources and managed in Chef Recipes and Cookbooks. These recipes run on a provisioner node and attempt to converge the infrastructure idempotently. The AWS driver is the most used, the most tested and receives the most updates.
|
43
|
+
|
44
|
+
Chef Provisioning and its Drivers are maintained by the open source community. They currently have a slow tempo for issue triage and pull request merging. Troubleshooting a bug may require stepping through the Ruby Chef codebase and engaging the community.
|
45
|
+
|
46
|
+
If you are new to Chef and Chef Provisioning, learning both can be daunting. If you are not familiar with Ruby as well, double the learning curve. Successful provisioning users know how they want to manage their cookbooks. Generally this is some CI/CD pipeline.
|
47
|
+
|
48
|
+
Chef is very flexible which allows customized provisioning solutions at the cost of high complexity. This makes it hard to document all the possible use cases. Patterns (for example, how to manage the provisioning node and run the provisioning recipes) are not well documented.
|
49
|
+
|
50
|
+
Chef Provisioning should be used to manage infrastructure (CRUD operations) and register Chef nodes with the server for the first time only. Other use cases (like scheduling chef runs, node inventory or reporting) are not supported.
|
15
51
|
|
16
52
|
Documentation
|
17
53
|
-------------
|
@@ -23,7 +59,6 @@ These are the primary documents to help learn about using Provisioning and creat
|
|
23
59
|
* [Configuration](https://github.com/chef/chef-provisioning/blob/master/docs/configuration.md#configuring-and-using-provisioning-drivers)
|
24
60
|
* [Writing Drivers](https://github.com/chef/chef-provisioning/blob/master/docs/building_drivers.md#writing-drivers)
|
25
61
|
* [Embedding](https://github.com/chef/chef-provisioning/blob/master/docs/embedding.md)
|
26
|
-
* [Providers](https://github.com/chef/chef-provisioning/blob/master/docs/providers)
|
27
62
|
|
28
63
|
Media
|
29
64
|
-----
|
@@ -46,10 +81,9 @@ You can try out Chef Provisioning in many different flavors.
|
|
46
81
|
|
47
82
|
### Vagrant
|
48
83
|
|
49
|
-
To give it a spin, install Vagrant and VirtualBox
|
84
|
+
To give it a spin, install the latest ChefDK, Vagrant and VirtualBox. Run the following from the `chef-provisioning/docs/examples` directory:
|
50
85
|
|
51
86
|
```
|
52
|
-
gem install chef-provisioning chef-provisioning-vagrant
|
53
87
|
export CHEF_DRIVER=vagrant
|
54
88
|
export VAGRANT_DEFAULT_PROVIDER=virtualbox
|
55
89
|
chef-client -z vagrant_linux.rb simple.rb
|
@@ -62,7 +96,6 @@ This will create two vagrant precise64 linux boxes, "mario" and "luigi1", in `~/
|
|
62
96
|
If you have an AWS account, you can spin up a machine there like this:
|
63
97
|
|
64
98
|
```
|
65
|
-
gem install chef-provisioning chef-provisioning-aws
|
66
99
|
export CHEF_DRIVER=aws
|
67
100
|
chef-client -z simple.rb
|
68
101
|
```
|
@@ -74,7 +107,6 @@ This will create two linux boxes in the AWS account referenced by your default p
|
|
74
107
|
If you are on DigitalOcean and using the `tugboat` gem, you can do this:
|
75
108
|
|
76
109
|
```
|
77
|
-
gem install chef-provisioning chef-provisioning-fog
|
78
110
|
export CHEF_DRIVER=fog:DigitalOcean
|
79
111
|
chef-client -z simple.rb
|
80
112
|
```
|
@@ -135,29 +167,6 @@ The driver API is separated out so that new drivers can be made with minimal eff
|
|
135
167
|
|
136
168
|
Drivers save their data in the Chef node itself, so that they will be accessible to everyone who is using the Chef server to manage the nodes.
|
137
169
|
|
138
|
-
Drivers each have their own repository. Current drivers:
|
139
|
-
|
140
|
-
**Cloud:**
|
141
|
-
- [AWS](https://github.com/chef/chef-provisioning-aws)
|
142
|
-
- [Azure](https://github.com/chef/chef-provisioning-azure)
|
143
|
-
- [FOG: EC2, DigitalOcean, OpenStack, etc.](https://github.com/chef/chef-provisioning-fog)
|
144
|
-
|
145
|
-
**Virtualization:**
|
146
|
-
- [Vagrant: VirtualBox, VMware Fusion, etc.](https://github.com/chef/chef-provisioning-vagrant)
|
147
|
-
- [vSphere](https://github.com/CenturyLinkCloud/chef-provisioning-vsphere)
|
148
|
-
|
149
|
-
**Containers:**
|
150
|
-
- [Docker](https://github.com/chef/chef-provisioning-docker)
|
151
|
-
|
152
|
-
**Bare Metal:**
|
153
|
-
- [OpenCrowbar](https://github.com/newgoliath/chef-provisioning-crowbar) OpenCrowbar controls your real metal. It discovers, inventories, configs RAID & BIOS and networks, and installs your OS. [OpenCrowbar website](http://www.opencrowbar.org) [OpenCrowbar github](https://github.com/opencrowbar/core)
|
154
|
-
- [SSH (no PXE)](https://github.com/double-z/chef-metal-ssh) (not yet up to date with 0.11)
|
155
|
-
|
156
|
-
**Seeking Maintainers:**
|
157
|
-
These repositories are not actively maintained and are seeking maintainers.
|
158
|
-
- [LXC](https://github.com/chef/chef-provisioning-lxc)
|
159
|
-
- [Hanlon](https://github.com/chef/chef-provisioning-hanlon)
|
160
|
-
|
161
170
|
### Machine options
|
162
171
|
|
163
172
|
You can pass machine options that will be used by `machine`, `machine_batch` and `machine_image` to
|
@@ -225,7 +234,7 @@ Individual drivers will often add their own driver specific config. For example
|
|
225
234
|
|
226
235
|
### Anatomy of a Recipe
|
227
236
|
|
228
|
-
|
237
|
+
The ChefDK comes with a provisioner for Vagrant, an abstraction that covers VirtualBox, VMware and other Virtual Machine drivers. In docs/examples, you can run this to try it:
|
229
238
|
|
230
239
|
```ruby
|
231
240
|
export CHEF_DRIVER=vagrant
|
@@ -295,7 +304,7 @@ end
|
|
295
304
|
|
296
305
|
### Configuring ACLs
|
297
306
|
|
298
|
-
If you want to run your provisionning recipes from an actual chef node, rather than from your workstation, you need to give that node's client enough rights to create the node and client he'll be provisioning on the chef server. Without those additional rights, the provisioning will fail with a error along the lines of `chef_client[mymachine] had an error: Net::HTTPServerException: 403 "Forbidden"`.
|
307
|
+
If you want to run your provisionning recipes from an actual chef node, rather than from your workstation, you need to give that node's client enough rights to create the node and client he'll be provisioning on the chef server. Without those additional rights, the provisioning will fail with a error along the lines of `chef_client[mymachine] had an error: Net::HTTPServerException: 403 "Forbidden"`.
|
299
308
|
|
300
309
|
A clean solution to this problem is to use [knife-acl](https://github.com/chef/knife-acl) to define a `provisioners` group with the required rights, and add your client to it:
|
301
310
|
|
@@ -307,20 +316,9 @@ $> knife acl add group provisioners containers nodes read,create,update,delete,g
|
|
307
316
|
$> knife group add client my_provisioning_client_name provisioners
|
308
317
|
```
|
309
318
|
|
310
|
-
Kitchen
|
311
|
-
-------
|
312
|
-
|
313
|
-
Chef Provisioning also works with Test Kitchen, allowing you to test entire clusters, not just machines! The repository for the kitchen-metal gem is https://github.com/doubt72/kitchen-metal.
|
314
|
-
|
315
|
-
|
316
|
-
Fixing conflict with chef-zero 3.2.1 and ~> 4.0
|
317
|
-
-----------------------------------------------
|
318
|
-
|
319
|
-
If you run into the error `Unable to activate cheffish-1.0.0, because chef-zero-3.2.1 conflicts with chef-zero (~> 4.0)` you'll need to update the version of the chef gem included in the ChefDK. Follow the instructions @ [https://github.com/fnichol/chefdk-update-app](https://github.com/fnichol/chefdk-update-app) and update chef to ~>12.2.1
|
320
|
-
|
321
319
|
Bugs and The Plan
|
322
320
|
-----------------
|
323
321
|
|
324
|
-
Please submit bugs, gripes and feature requests at [https://github.com/chef/chef-provisioning/issues](https://github.com/chef/chef-provisioning/issues)
|
322
|
+
Please submit bugs, gripes and feature requests at [https://github.com/chef/chef-provisioning/issues](https://github.com/chef/chef-provisioning/issues) and join us in the Slack room to chat.
|
325
323
|
|
326
|
-
To contribute, just make a PR in the appropriate repo
|
324
|
+
To contribute, just make a PR in the appropriate repo following the Chef [contribution process](https://github.com/chef/chef/blob/master/CONTRIBUTING.md#contribution-process).
|
data/chef-provisioning.gemspec
CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.add_dependency 'net-ssh-gateway', '~> 1.2'
|
20
20
|
s.add_dependency 'inifile', '>= 2.0.2'
|
21
21
|
s.add_dependency 'cheffish', '~> 4.0'
|
22
|
+
s.add_dependency 'winrm', '~> 2.0'
|
22
23
|
s.add_dependency 'winrm-fs', '~> 1.0'
|
23
24
|
s.add_dependency "mixlib-install", ">= 1.0", "< 3.0"
|
24
25
|
|
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'chef/provisioning/transport'
|
2
2
|
require 'base64'
|
3
3
|
require 'timeout'
|
4
|
+
require 'winrm-elevated'
|
5
|
+
require 'winrm-fs'
|
4
6
|
|
5
7
|
class Chef
|
6
8
|
module Provisioning
|
@@ -29,7 +31,7 @@ module Provisioning
|
|
29
31
|
# WinRM v2 switched from :pass to :password
|
30
32
|
# we accept either to avoid having to update every driver
|
31
33
|
@options[:password] = @options[:password] || @options[:pass]
|
32
|
-
|
34
|
+
|
33
35
|
@config = global_config
|
34
36
|
end
|
35
37
|
|
@@ -37,10 +39,8 @@ module Provisioning
|
|
37
39
|
attr_reader :config
|
38
40
|
|
39
41
|
def execute(command, execute_options = {})
|
40
|
-
|
41
|
-
|
42
|
-
session.run(command, &block)
|
43
|
-
end
|
42
|
+
block = Proc.new { |stdout, stderr| stream_chunk(execute_options, stdout, stderr) }
|
43
|
+
output = session.run(command, &block)
|
44
44
|
WinRMResult.new(command, execute_options, config, output)
|
45
45
|
end
|
46
46
|
|
@@ -58,7 +58,7 @@ module Provisioning
|
|
58
58
|
begin
|
59
59
|
file.write(content)
|
60
60
|
file.close
|
61
|
-
|
61
|
+
file_manager.upload(file.path, path)
|
62
62
|
ensure
|
63
63
|
file.unlink
|
64
64
|
end
|
@@ -73,8 +73,7 @@ module Provisioning
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def available?
|
76
|
-
|
77
|
-
execute('pwd', :timeout => 10)
|
76
|
+
execute('pwd')
|
78
77
|
true
|
79
78
|
rescue ::WinRM::WinRMAuthorizationError
|
80
79
|
Chef::Log.debug("unavailable: winrm authentication error: #{$!.inspect} ")
|
@@ -99,16 +98,18 @@ module Provisioning
|
|
99
98
|
protected
|
100
99
|
|
101
100
|
def session
|
102
|
-
@session ||=
|
103
|
-
require 'winrm'
|
104
|
-
::WinRM::Connection.new(options).shell(:powershell)
|
105
|
-
end
|
101
|
+
@session ||= connection.shell(:elevated)
|
106
102
|
end
|
107
103
|
|
108
|
-
def
|
109
|
-
@
|
110
|
-
|
111
|
-
|
104
|
+
def file_manager
|
105
|
+
@file_manager ||= ::WinRM::FS::FileManager.new(connection)
|
106
|
+
end
|
107
|
+
|
108
|
+
private
|
109
|
+
|
110
|
+
def connection
|
111
|
+
@connection ||= begin
|
112
|
+
::WinRM::Connection.new(@options)
|
112
113
|
end
|
113
114
|
end
|
114
115
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-provisioning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Keiser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -86,6 +86,20 @@ dependencies:
|
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '4.0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: winrm
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '2.0'
|
96
|
+
type: :runtime
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '2.0'
|
89
103
|
- !ruby/object:Gem::Dependency
|
90
104
|
name: winrm-fs
|
91
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -289,7 +303,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
289
303
|
version: '0'
|
290
304
|
requirements: []
|
291
305
|
rubyforge_project:
|
292
|
-
rubygems_version: 2.
|
306
|
+
rubygems_version: 2.5.1
|
293
307
|
signing_key:
|
294
308
|
specification_version: 4
|
295
309
|
summary: A library for creating machines and infrastructures idempotently in Chef.
|