knife-ec2 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,101 +1,140 @@
1
- Knife EC2
2
- =========
3
- [![Gem Version](https://badge.fury.io/rb/knife-ec2.svg)](http://badge.fury.io/rb/knife-ec2)
1
+ # Knife EC2
2
+ [![Gem Version](https://badge.fury.io/rb/knife-ec2.svg)](https://rubygems.org/gems/knife-ec2)
4
3
  [![Build Status](https://travis-ci.org/chef/knife-ec2.svg?branch=master)](https://travis-ci.org/chef/knife-ec2)
5
4
  [![Dependency Status](https://gemnasium.com/chef/knife-ec2.svg)](https://gemnasium.com/chef/knife-ec2)
6
5
 
7
- This is the official Chef Knife plugin for EC2. This plugin gives knife the ability to create, bootstrap, and manage EC2 instances.
6
+ This is the official Chef Knife plugin for Amazon EC2. This plugin gives knife the ability to create, bootstrap, and manage EC2 instances.
7
+ - Documentation: [https://github.com/chef/knife-ec2/blob/master/README.md](https://github.com/chef/knife-ec2/blob/master/README.md)
8
+ - Source: [https://github.com/chef/knife-ec2/tree/master](https://github.com/chef/knife-ec2/tree/master)
9
+ - Issues: [https://github.com/chef/knife-ec2/issues](https://github.com/chef/knife-ec2/issues)
10
+ - IRC: `#chef` and `#chef-hacking` on Freenode
11
+ - Mailing list: [https://discourse.chef.io/](https://discourse.chef.io/)
8
12
 
9
- * Documentation: <http://docs.chef.io/plugin_knife_ec2.html>
10
- * Source: <http://github.com/chef/knife-ec2/tree/master>
11
- * Issues: <https://github.com/chef/knife-ec2/issues>
12
- * IRC: `#chef` and `#chef-hacking` on Freenode
13
- * Mailing list: <http://lists.chef.io>
14
-
15
- Note: Documentation needs to be updated in chef docs
16
-
17
- Installation
18
- ------------
19
-
20
- If you're using [ChefDK](http://downloads.chef.io/chef-dk/), simply install the
21
- Gem:
13
+ ## Installation
14
+ If you're using [ChefDK](https://downloads.chef.io/chef-dk/), simply install the Gem:
22
15
 
23
16
  ```bash
24
- chef gem install knife-ec2
17
+ $ chef gem install knife-ec2
25
18
  ```
26
19
 
27
20
  If you're using bundler, simply add Chef and Knife EC2 to your `Gemfile`:
28
21
 
29
22
  ```ruby
30
- gem 'chef'
31
23
  gem 'knife-ec2'
32
24
  ```
33
25
 
34
- If you are not using bundler, you can install the gem manually. Be sure you are running Chef 0.10.10 or higher, as earlier versions do not support plugins.
35
-
36
- $ gem install chef
26
+ If you are not using bundler, you can install the gem manually from Rubygems:
37
27
 
38
- This plugin is distributed as a Ruby Gem. To install it, run:
39
-
40
- $ gem install knife-ec2
28
+ ```bash
29
+ $ gem install knife-ec2
30
+ ```
41
31
 
42
32
  Depending on your system's configuration, you may need to run this command with root privileges.
43
33
 
34
+ ## Configuration
35
+ In order to communicate with the Amazon's EC2 API you will need to pass Knife your AWS Access Key, Secret Access Key, and if using STS your session token. This can be done in several ways:
44
36
 
45
- Configuration
46
- -------------
47
- In order to communicate with the Amazon's EC2 API you will have to tell Knife about your AWS Access Key and Secret Access Key. The easiest way to accomplish this is to create some entries in your `knife.rb` file:
37
+ ### Knife.rb Configuration
38
+ The easiest way to configure your Amazon EC2 credentials for knife-ec2 is to specify them in your your `knife.rb` file:
48
39
 
49
40
  ```ruby
50
41
  knife[:aws_access_key_id] = "Your AWS Access Key ID"
51
42
  knife[:aws_secret_access_key] = "Your AWS Secret Access Key"
52
43
  ```
53
44
 
54
- If your `knife.rb` file will be checked into a SCM system (ie readable by others) you may want to read the values from environment variables:
45
+ Additionally if using AWS STS:
46
+
47
+ ```ruby
48
+ knife[:aws_session_token] = "Your AWS Session Token"
49
+ ```
50
+
51
+ Note: If your `knife.rb` file will be checked into a source control management system, or is otherwise accessible by others, you may want to use one of the other configuration methods to avoid exposing your credentials.
52
+
53
+ ### Environmental Variables
54
+ Knife-ec2 can also read your credentials from shell environmental variables. Export `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and `AWS_SESSION_TOKEN` variables in your shell then add the following configuration to your `knife.rb` file:
55
55
 
56
56
  ```ruby
57
57
  knife[:aws_access_key_id] = ENV['AWS_ACCESS_KEY_ID']
58
58
  knife[:aws_secret_access_key] = ENV['AWS_SECRET_ACCESS_KEY']
59
- # Optional if you're using Amazon's STS
59
+ ```
60
+
61
+ Additionally if using AWS STS:
62
+
63
+ ```ruby
60
64
  knife[:aws_session_token] = ENV['AWS_SESSION_TOKEN']
61
65
  ```
62
66
 
63
- You also have the option of passing your AWS API Key/Secret into the individual knife subcommands using the `-A` (or `--aws-access-key-id`) `-K` (or `--aws-secret-access-key`) command options
67
+ ### CLI Arguments
68
+ You also have the option of passing your AWS API Key/Secret into the individual knife subcommands using the `--aws-access-key-id` and `--aws-secret-access-key` command options
69
+
70
+ Example of provisioning a new t2.micro Ubuntu 14.04 webserver:
64
71
 
65
72
  ```bash
66
- # provision a new m1.small Ubuntu 10.04 webserver
67
- $ knife ec2 server create -r 'role[webserver]' -I ami-7000f019 -f m1.small -A 'Your AWS Access Key ID' -K "Your AWS Secret Access Key"
73
+ $ knife ec2 server create -r 'role[webserver]' -I ami-cd0fd6be -f t2.micro --aws-access-key-id 'Your AWS Access Key ID' --aws-secret-access-key "Your AWS Secret Access Key"
74
+ ```
75
+
76
+ ### AWS Credential File
77
+ Amazon's newer credential config file format is also supported by knife:
78
+
79
+ ```
80
+ [default]
81
+ aws_access_key_id = Your AWS Access Key ID
82
+ aws_secret_access_key = Your AWS Secret Access Key
83
+ ```
84
+
85
+ In this case, you can point the `aws_credential_file` option to this file in your `knife.rb` file, like so:
86
+
87
+ ```ruby
88
+ knife[:aws_credential_file] = "/path/to/credentials/file"
89
+ ```
90
+ Since the Knife config file is just Ruby you can also avoid hardcoding your home directory, which creates a configuration that can be used for any user:
91
+
92
+ ```ruby
93
+ knife[:aws_credential_file] = File.join(ENV['HOME'], "/.aws/credentials")
68
94
  ```
69
95
 
70
- If you are working with Amazon's command line tools, there is a good chance
71
- you already have a file with these keys somewhere in this format:
72
96
 
73
- AWSAccessKeyId=Your AWS Access Key ID
74
- AWSSecretKey=Your AWS Secret Access Key
97
+ If you have multiple profiles in your credentials file you can define which profile to use. The `default` profile will be used if not supplied,
75
98
 
99
+ ```ruby
100
+ knife[:aws_profile] = "personal"
101
+ ```
76
102
 
77
- The new config file format used by Amazon's command line tools is also supported:
103
+ ### AWS Configuration File
104
+ Amazon's newer configuration file format is also supported by knife:
78
105
 
79
- [default]
80
- aws_access_key_id = Your AWS Access Key ID
81
- aws_secret_access_key = Your AWS Secret Access Key
106
+ ```
107
+ [default]
108
+ region = "specify_any_supported_region"
109
+ ```
82
110
 
83
- In this case, you can point the <tt>aws_credential_file</tt> option to
84
- this file in your <tt>knife.rb</tt> file, like so:
111
+ In this case you can point the `aws_config_file` option to this file in your `knife.rb` file, like so:
85
112
 
86
113
  ```ruby
87
- knife[:aws_credential_file] = "/path/to/credentials/file/in/above/format"
114
+ knife[:aws_config_file] = "/path/to/configuration/file"
115
+ ```
116
+ Since the Knife config is just Ruby you can also avoid hardcoding your name directory, which creates a config that can be used for any user:
117
+
118
+ ```ruby
119
+ knife[:aws_config_file] = File.join(ENV['HOME'], "/.aws/configuration")
88
120
  ```
89
121
 
90
- If you have multiple profiles in your credentials file you can define which
91
- profile to use. The `default` profile will be used if not supplied,
122
+
123
+ If you have multiple profiles in your configuration file you can define which profile to use. The `default` profile will be used if not supplied,
92
124
 
93
125
  ```ruby
94
126
  knife[:aws_profile] = "personal"
95
127
  ```
96
128
 
97
- Additionally the following options may be set in your `knife.rb`:
129
+ In this case configuration file format is:
130
+ ```
131
+ [profile personal]
132
+ region = "specify_any_supported_region"
133
+ ```
134
+
98
135
 
136
+ ## Additional knife.rb Configuration Options
137
+ The following configuration options may be set in your `knife.rb`:
99
138
  - flavor
100
139
  - image
101
140
  - availability_zone
@@ -105,9 +144,8 @@ Additionally the following options may be set in your `knife.rb`:
105
144
  - distro
106
145
  - template_file
107
146
 
108
- Using Cloud-Based Secret Data
109
- -----------------------------
110
- knife-ec2 now includes the ability to retrieve the encrypted data bag secret and validation keys directly from a cloud-based assets store (currently on S3 is supported). To enable this functionality, you must first upload keys to S3 and give them appropriate permissions. The following is a suggested set of IAM permissions required to make this work:
147
+ ## Using Cloud-Based Secret Data
148
+ knife-ec2 now includes the ability to retrieve the encrypted data bag secret and validation keys directly from a cloud-based assets store (currently only S3 is supported). To enable this functionality, you must first upload keys to S3 and give them appropriate permissions. The following is a suggested set of IAM permissions required to make this work:
111
149
 
112
150
  ```json
113
151
  {
@@ -119,7 +157,7 @@ knife-ec2 now includes the ability to retrieve the encrypted data bag secret and
119
157
  "s3:List*"
120
158
  ],
121
159
  "Resource": [
122
- "arn:aws:s3:::provisioning.bucket.com/chef/*"
160
+ "arn:aws:s3:::example.com/chef/*"
123
161
  ]
124
162
  }
125
163
  ]
@@ -127,63 +165,80 @@ knife-ec2 now includes the ability to retrieve the encrypted data bag secret and
127
165
  ```
128
166
 
129
167
  ### Supported URL format
130
- - `http` or `https` based: 'http://provisioning.bucket.com/chef/my-validator.pem'
168
+ - `http` or `https` based: 'http://example.com/chef/my-validator.pem'
131
169
  - `s3` based: 's3://chef/my-validator.pem'
132
170
 
133
171
  ### Use the following configuration options in `knife.rb` to set the source URLs:
172
+
134
173
  ```ruby
135
- knife[:validation_key_url] = 'http://provisioning.bucket.com/chef/my-validator.pem'
136
- knife[:s3_secret] = 'http://provisioning.bucket.com/chef/encrypted_data_bag_secret'
174
+ knife[:validation_key_url] = 'http://example.com/chef/my-validator.pem'
175
+ knife[:s3_secret] = 'http://example.com/chef/encrypted_data_bag_secret'
137
176
  ```
138
177
 
139
178
  ### Alternatively, URLs can be passed directly on the command line:
140
179
  - Validation Key: `--validation-key-url s3://chef/my-validator.pem`
141
180
  - Encrypted Data Bag Secret: `--s3-secret s3://chef/encrypted_data_bag_secret`
142
181
 
143
- Subcommands
144
- -----------
182
+ ## knife-ec2 Subcommands
145
183
  This plugin provides the following Knife subcommands. Specific command options can be found by invoking the subcommand with a `--help` flag
146
184
 
185
+ ### `knife ec2 server create`
186
+ Provisions a new server in the Amazon EC2 and then perform a Chef bootstrap (using the SSH or WinRM protocols). The goal of the bootstrap is to get Chef installed on the target system so it can run Chef Client with a Chef Server. The main assumption is a baseline OS installation exists (provided by the provisioning). It is primarily intended for Chef Client systems that talk to a Chef server. The examples below create Linux and Windows instances:
187
+
188
+ ```
189
+ # Create some instances -- knife configuration contains the AWS credentials
147
190
 
148
- #### `knife ec2 server create`
149
- Provisions a new server in the Amazon EC2 and then perform a Chef bootstrap
150
- (using the SSH or WinRM protocols). The goal of the bootstrap is to get Chef installed on the target system so it can run Chef Client with a Chef Server. The main assumption is a baseline OS installation exists (provided by the provisioning). It is primarily intended for Chef Client systems that talk to a Chef server. The examples below create Linux and Windows instances:
191
+ # A Linux instance via ssh
192
+ knife ec2 server create -I ami-d0f89fb9 --ssh-key your-public-key-id -f m1.medium --ssh-user ubuntu --identity-file ~/.ssh/your-private-key
193
+
194
+ # A Windows instance via the WinRM protocol -- --ssh-key is still required due to EC2 API operations that need it to grant access to the Windows instance
195
+ # `--spot-price` option lets you specify the spot pricing
196
+ knife ec2 server create -I ami-173d747e -G windows -f m1.medium --user-data ~/your-user-data-file -x '.\a_local_user' -P 'yourpassword' --ssh-key your-public-key-id --spot-price price-in-USD
197
+
198
+ # Pass --server-connect-attribute to specify the instance attribute that we will try to connect to via ssh/winrm
199
+ # Possible values of --server-connect-attribute: private_dns_name, private_ip_address, dns_name, public_ip_address
200
+ # If --server-connect-attribute is not specified, knife attempts to determine if connecting to the instance's public or private IP is most appropriate based on other settings
201
+ knife ec2 server create -I ami-173d747e -x ubuntu --server-connect-attribute public_ip_address
202
+ ```
151
203
 
152
- # Create some instances -- knife configuration contains the AWS credentials
204
+ View additional information on configuring Windows images for bootstrap in the documentation for [knife-windows](https://docs.chef.io/plugin_knife_windows.html).
153
205
 
154
- # A Linux instance via ssh
155
- knife ec2 server create -I ami-d0f89fb9 --ssh-key your-public-key-id -f m1.medium --ssh-user ubuntu --identity-file ~/.ssh/your-private-key
156
206
 
157
- # A Windows instance via the WinRM protocol -- --ssh-key is still required due to EC2 API operations that need it to grant access to the Windows instance
158
- # `--spot-price` option lets you specify the spot pricing
159
- knife ec2 server create -I ami-173d747e -G windows -f m1.medium --user-data ~/your-user-data-file -x '.\a_local_user' -P 'yourpassword' --ssh-key your-public-key-id --spot-price price-in-USD
207
+ #### Bootstrap Windows (2012 R2 and above platform) instance without user-data through winrm ssl transport
160
208
 
161
- View additional information on configuring Windows images for bootstrap in the documentation for [knife-windows](http://docs.chef.io/plugin_knife_windows.html).
209
+ Users can bootstrap the Windows instance without the need to provide the user-data. `knife-ec2` has the ability to bootstrap the Windows instance through `winrm protocol` using the `ssl` transport. This requires users to set `--winrm-transport` option as `ssl` and `--winrm-ssl-verify-mode` option as `verify_none`. This will do the necessary winrm ssl transport configurations on the target node and the bootstrap will just work.
162
210
 
163
- ##### Options for bootstrapping Windows
211
+ ***Note***: Users also need to pass the `--security-group-ids` option with IDs of the security group(s) having the required ports opened like `5986` for winrm ssl transport. In case if `--security-group-ids` option is not passed then make sure that the default security group in your account has the required ports opened.
164
212
 
165
- The `knife ec2 server create` command also supports the following
166
- options for bootstrapping a Windows node after the VM s created:
213
+ Below is the sample command to create a Windows instance and bootstrap it through `ssl` transport without passing any user-data:
167
214
 
168
- :winrm_password The WinRM password
169
- :winrm_authentication_protocol Defaults to negotiate, supports kerberos, can be set to basic for debugging
170
- :winrm_transport Defaults to plaintext, use ssl for improved privacy
171
- :winrm_port Defaults to 5985 plaintext transport, or 5986 for SSL
172
- :ca_trust_file The CA certificate file to use to verify the server when using SSL
173
- :winrm_ssl_verify_mode Defaults to verify_peer, use verify_none to skip validation of the server certificate during testing
174
- :kerberos_keytab_file The Kerberos keytab file used for authentication
175
- :kerberos_realm The Kerberos realm used for authentication
176
- :kerberos_service The Kerberos service used for authentication
215
+ ```
216
+ knife ec2 server create -N chef-node-name -I your-windows-image -f flavor-of-server -x '.\a_local_user' -P 'yourpassword' --ssh-key your-public-key-id --winrm-transport ssl --winrm-ssl-verify-mode verify_none --security-group-ids your-security-groups -VV
217
+ ```
218
+
219
+ #### Options for bootstrapping Windows
220
+ The `knife ec2 server create` command also supports the following options for bootstrapping a Windows node after the VM s created:
221
+
222
+ ```
223
+ :winrm_password The WinRM password
224
+ :winrm_authentication_protocol Defaults to negotiate, supports kerberos, can be set to basic for debugging
225
+ :winrm_transport Defaults to plaintext, use ssl for improved security
226
+ :winrm_port Defaults to 5985 plaintext transport, or 5986 for SSL
227
+ :ca_trust_file The CA certificate file to use to verify the server when using SSL
228
+ :winrm_ssl_verify_mode Defaults to verify_peer, use verify_none to skip validation of the server certificate during testing
229
+ :kerberos_keytab_file The Kerberos keytab file used for authentication
230
+ :kerberos_realm The Kerberos realm used for authentication
231
+ :kerberos_service The Kerberos service used for authentication
232
+ ```
177
233
 
178
- #### `knife ec2 server delete`
234
+ ### `knife ec2 server delete`
179
235
  Deletes an existing server in the currently configured AWS account. **By default, this does not delete the associated node and client objects from the Chef server. To do so, add the `--purge` flag**
180
236
 
181
- #### `knife ec2 server list`
237
+ ### `knife ec2 server list`
182
238
  Outputs a list of all servers in the currently configured AWS account. **Note, this shows all instances associated with the account, some of which may not be currently managed by the Chef server.**
183
239
 
184
- License and Authors
185
- -------------------
186
- - Author:: Adam Jacob (<adam@chef.io>)
240
+ ## License and Authors
241
+ - Author:: Adam Jacob ([adam@chef.io](mailto:adam@chef.io))
187
242
 
188
243
  ```text
189
244
  Copyright 2009-2015 Chef Software, Inc.
@@ -6,47 +6,31 @@ Example Note:
6
6
  ## Example Heading
7
7
  Details about the thing that changed that needs to get included in the Release Notes in markdown.
8
8
  -->
9
- # knife-ec2 0.12.0 release notes:
9
+ # knife-ec2 0.13.0 release notes:
10
10
 
11
- This release of `knife-ec2` adds features like spot pricing, EBS volume encryption support and some bug fixes. There is also a dependency update for the `fog` gem and 'em-winrm' dependency is removed.
11
+ This release of `knife-ec2` adds feature to bootstrap Windows instances over SSL without the need for users to provide the `user-data`. Also, it adds support for users to pass `AWS config file` option on the `CLI` containing the `AWS configurations` to read the config like `region` information.
12
12
 
13
- ## Compatibility note for Windows nodes: `--winrm-authentication-protocol basic`
14
- In this version of `knife-ec2`, the default authentication protocol
15
- for Windows nodes is now `negotiate`for the `server create` subcommand. This can
16
- cause bootstraps to fail if the remote Windows node is not configured
17
- for `negotiate`. To work around this and retain the behavior of
18
- previous releases, you can specify use `basic` authentication in your
19
- `knife` configuration file or on the command line as in
20
- this example:
13
+ ***Note:*** The bootstrap (over SSL without the `user-data`) feature for Windows is available only for Windows 2012 R2 and above platform.
21
14
 
22
- knife ec2 server create -I ami-173d747e -G windows -f m1.medium --user-data ~/your-user-data-file -x 'a_local_user' -P 'yourpassword' --ssh-key your-public-key-id --winrm-authentication-protocol basic
23
15
 
24
- ## Acknowledgements
25
- Our thanks go to contributor **Peer Allan** for adding
26
- [knife-ec2:#305](https://github.com/chef/knife-ec2/pull/305). This
27
- enables the use of standard AWS credential configuration from `~/.aws/credentials`.
28
-
29
- ## Release information
30
-
31
- See the [CHANGELOG](https://github.com/chef/knife-ec2/blob/0.12.0/CHANGELOG.md) for a list of all changes in this release, and review
32
- [DOC_CHANGES.md](https://github.com/chef/knife-ec2/blob/0.12.0/DOC_CHANGES.md) for relevant documentation updates.
16
+ ## Features added in knife-ec2 0.13.0
33
17
 
34
- Issues with `knife-ec2` should be reported in the issue system at
35
- https://github.com/opscode/knife-ec2/issues. Learn more about how you can
36
- contribute features and bug fixes to `knife-ec2` at https://github.com/opscode/knife-ec2/blob/master/CONTRIBUTING.md.
18
+ * `--[no-]create-ssl-listener` option to add `ssl listener` on Windows instance to bootstrap the instance through `winrm ssl transport` without the need for users to pass the `user-data`. Default value of this option is `true`.
19
+ * Support for `~/.aws/config` file for reading aws configurations. Use `--aws-config-file` option for the same.
20
+ * Support to read `aws_session_token` from `~/.aws/credentials` file.
21
+ * Support for `ec2 classic link`, options are `--classic-link-vpc-id` and `--classic-link-vpc-security-groups-ids`.
22
+ * Support for `m4`, `d2`, `t2` and `g2` ebs encryption flavors.
23
+ * Use `--format json` option to list the `ec2 servers` in the json format. Default output format is `summary` though.
24
+ * Use `--attach-network-interface` option to attach additional `network interfaces` to the instance.
25
+ * Added `--disable-api-termination` option to allow users to disable the termination of the instance using the Amazon EC2 console, CLI and API. However, this option won't work for `spot instances` as `termination protection` cannot be enabled for `spot instances`.
26
+ * Added `--spot-wait-mode` option to enable users to give their decision on CLI whether to `wait` for the `spot request fulfillment` or to `exit` before the `spot request fulfillment`. Default value for this option is `prompt` which will prompt the user to give their choice.
37
27
 
38
- ## Features added in knife-ec2 0.12.0
39
-
40
- * Support for `~/.aws/credentials` credential configuration (Peer Allan)
41
- * Validatorless bootstrap for Windows nodes
42
- * --forward-agent ssh agent forwarding support
43
- * `--msi-url`, `--install-as-service`, `--bootstrap-install-command`
44
- for Windows nodes
28
+ ## Acknowledgements
45
29
 
46
- ## knife-ec2 on RubyGems and Github
47
- https://rubygems.org/gems/knife-ec2
48
- https://github.com/opscode/knife-ec2
30
+ Our thanks go to contributor **Quentin de Metz** for adding
31
+ [knife-ec2:#322](https://github.com/chef/knife-ec2/pull/322). This
32
+ enables the support for `Classic Link` in the `knife ec2 server create` command.
49
33
 
50
- ## Issues fixed in knife-ec2 0.11.0
51
- See the [0.12.0 CHANGELOG](https://github.com/chef/knife-ec2/blob/0.12.0/CHANGELOG.md)
52
- for the complete list of issues fixed in this release.
34
+ Our thanks go to contributor **Eric Herot** for adding
35
+ [knife-ec2:#375](https://github.com/chef/knife-ec2/pull/375). This
36
+ enables the users to add additional `Network Interfaces` to the instance before the bootstrap process.
data/Rakefile CHANGED
@@ -1,56 +1,56 @@
1
- #
2
- # Author:: Adam Jacob (<adam@opscode.com>)
3
- # Author:: Daniel DeLeo (<dan@opscode.com>)
4
- # Author:: Seth Chisamore (<schisamo@opscode.com>)
5
- # Copyright:: Copyright (c) 2008, 2010 Opscode, Inc.
6
- # License:: Apache License, Version 2.0
7
- #
8
- # Licensed under the Apache License, Version 2.0 (the "License");
9
- # you may not use this file except in compliance with the License.
10
- # You may obtain a copy of the License at
11
- #
12
- # http://www.apache.org/licenses/LICENSE-2.0
13
- #
14
- # Unless required by applicable law or agreed to in writing, software
15
- # distributed under the License is distributed on an "AS IS" BASIS,
16
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- # See the License for the specific language governing permissions and
18
- # limitations under the License.
19
- #
20
-
21
- require 'bundler'
22
- Bundler::GemHelper.install_tasks
23
-
24
- # require 'rubygems'
25
- # require 'rake/gempackagetask'
26
- require 'rdoc/task'
27
-
28
- begin
29
- require 'sdoc'
30
- require 'rdoc/task'
31
-
32
- RDoc::Task.new do |rdoc|
33
- rdoc.title = 'Chef Ruby API Documentation'
34
- rdoc.main = 'README.rdoc'
35
- rdoc.options << '--fmt' << 'shtml' # explictly set shtml generator
36
- rdoc.template = 'direct' # lighter template
37
- rdoc.rdoc_files.include('README.rdoc', 'LICENSE', 'spec/tiny_server.rb', 'lib/**/*.rb')
38
- rdoc.rdoc_dir = 'rdoc'
39
- end
40
- rescue LoadError
41
- puts 'sdoc is not available. (sudo) gem install sdoc to generate rdoc documentation.'
42
- end
43
-
44
- begin
45
- require 'rspec/core/rake_task'
46
-
47
- task :default => :spec
48
-
49
- desc 'Run all specs in spec directory'
50
- RSpec::Core::RakeTask.new(:spec) do |t|
51
- t.pattern = 'spec/unit/**/*_spec.rb'
52
- end
53
-
54
- rescue LoadError
55
- STDERR.puts "\n*** RSpec not available. (sudo) gem install rspec to run unit tests. ***\n\n"
56
- end
1
+ #
2
+ # Author:: Adam Jacob (<adam@chef.io>)
3
+ # Author:: Daniel DeLeo (<dan@chef.io>)
4
+ # Author:: Seth Chisamore (<schisamo@chef.io>)
5
+ # Copyright:: Copyright (c) 2008-2015 Chef Software, Inc.
6
+ # License:: Apache License, Version 2.0
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+ #
20
+
21
+ require 'bundler'
22
+ Bundler::GemHelper.install_tasks
23
+
24
+ # require 'rubygems'
25
+ # require 'rake/gempackagetask'
26
+ require 'rdoc/task'
27
+
28
+ begin
29
+ require 'sdoc'
30
+ require 'rdoc/task'
31
+
32
+ RDoc::Task.new do |rdoc|
33
+ rdoc.title = 'Chef Ruby API Documentation'
34
+ rdoc.main = 'README.rdoc'
35
+ rdoc.options << '--fmt' << 'shtml' # explictly set shtml generator
36
+ rdoc.template = 'direct' # lighter template
37
+ rdoc.rdoc_files.include('README.rdoc', 'LICENSE', 'spec/tiny_server.rb', 'lib/**/*.rb')
38
+ rdoc.rdoc_dir = 'rdoc'
39
+ end
40
+ rescue LoadError
41
+ puts 'sdoc is not available. (sudo) gem install sdoc to generate rdoc documentation.'
42
+ end
43
+
44
+ begin
45
+ require 'rspec/core/rake_task'
46
+
47
+ task :default => :spec
48
+
49
+ desc 'Run all specs in spec directory'
50
+ RSpec::Core::RakeTask.new(:spec) do |t|
51
+ t.pattern = 'spec/unit/**/*_spec.rb'
52
+ end
53
+
54
+ rescue LoadError
55
+ STDERR.puts "\n*** RSpec not available. (sudo) gem install rspec to run unit tests. ***\n\n"
56
+ end