-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Convert everything to Ruby 1.9 syntax because I'm tired of people removing trailing commas despite the **massive** warning in the README - Update to the latest and greatest testing gems and practices - Remove strainer in favor of a purer solution - Update `.gitignore` to ignore additional files - Add more platforms to the `.kitchen.yml`
- Loading branch information
Showing
43 changed files
with
382 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
*.rbc | ||
.bundle | ||
.config | ||
.yardoc | ||
_yardoc | ||
*~ | ||
*# | ||
.#* | ||
\#*# | ||
.*.sw[a-z] | ||
*.un~ | ||
*.tmp | ||
*.bk | ||
*.bkup | ||
.kitchen.local.yml | ||
Berksfile.lock | ||
Gemfile.lock | ||
coverage/ | ||
doc/ | ||
tmp | ||
|
||
.bundle/ | ||
.cache/ | ||
.kitchen/ | ||
.kitchen.local.yml | ||
.vagrant/ | ||
.vagrant.d/ | ||
bin/ | ||
.rspec | ||
tmp/ | ||
vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
--- | ||
driver_plugin: vagrant | ||
driver_config: | ||
require_chef_omnibus: true | ||
|
||
platforms: | ||
- name: ubuntu-12.10 | ||
- name: ubuntu-13.04 | ||
- name: centos-6.4 | ||
|
||
suites: | ||
- name: append | ||
run_list: ['recipe[fake::append]'] | ||
run_list: | ||
- recipe[fake::append] | ||
- name: append_existing | ||
run_list: ['recipe[fake::append_existing]'] | ||
run_list: | ||
- recipe[fake::append_existing] | ||
- name: create | ||
run_list: ['recipe[fake::create]'] | ||
run_list: | ||
- recipe[fake::create] | ||
- name: create_if_missing | ||
run_list: ['recipe[fake::create_if_missing]'] | ||
run_list: | ||
- recipe[fake::create_if_missing] | ||
- name: default | ||
run_list: ['recipe[fake::default]'] | ||
run_list: | ||
- recipe[fake::default] | ||
- name: options | ||
run_list: ['recipe[fake::options]'] | ||
run_list: | ||
- recipe[fake::options] | ||
- name: unique | ||
run_list: | ||
- recipe[fake::unique] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
rvm: | ||
- 2.0.0 | ||
- 1.9.3 | ||
script: bundle exec strainer test --except kitchen | ||
- 2.0.0 | ||
script: | ||
- bundle exec foodcritic -f any . | ||
- bundle exec rspec --color --format progress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'chef', '~> 11.6' | ||
|
||
group :test do | ||
gem 'cane', '~> 2.6' | ||
gem 'chefspec', '~> 1.3' | ||
gem 'strainer', '~> 3.2' | ||
end | ||
gem 'berkshelf', '~> 2.0' | ||
gem 'chefspec', '~> 2.0' | ||
gem 'foodcritic', '~> 3.0' | ||
|
||
group :integration do | ||
gem 'berkshelf', '~> 2.0' | ||
gem 'test-kitchen', '~> 1.0.0.beta' | ||
gem 'kitchen-vagrant', '~> 0.11' | ||
gem 'test-kitchen', '~> 1.0.0.beta' | ||
gem 'kitchen-vagrant', path: '~/Development/kitchen-vagrant' #~> 0.11' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,15 @@ hostsfile LWRP | |
|
||
`hostsfile` provides an LWRP for managing your `/etc/hosts` (or Windows equivalent) file using Chef. | ||
|
||
|
||
Requirements | ||
------------ | ||
- Chef 11 or higher | ||
- **Ruby 1.9.3 or higher** | ||
|
||
**Please stop opening Pull Requests to restore Ruby 1.8 support!** Any of the `1.x.y` series of this cookbook will work with Chef 10 and Ruby 1.8. You can use Opscode's [Omnibus installer](http://www.opscode.com/blog/2012/06/29/omnibus-chef-packaging/) to install Ruby 1.9+ and Seth Chisamore's [Vagrant Omnibus plugin](https://github.com/schisamo/vagrant-omnibus) to get Ruby 1.9+ on your Vagrant box. | ||
|
||
|
||
Attributes | ||
---------- | ||
<table> | ||
|
@@ -32,6 +34,12 @@ Attributes | |
<td><tt>example.com</tt></td> | ||
<td></td> | ||
</tr> | ||
<tr> | ||
<td>unique</td> | ||
<td>remove any existing entries that have the same <tt>hostname</tt></td> | ||
<td><tt>true</tt></td> | ||
<td><tt>false</tt></td> | ||
</tr> | ||
<tr> | ||
<td>aliases</td> | ||
<td>array of aliases for the entry</td> | ||
|
@@ -52,25 +60,29 @@ Attributes | |
</tr> | ||
</table> | ||
|
||
|
||
Actions | ||
------- | ||
**Please note**: As of `v0.1.2`, specifying a hostname or alias that exists in another entry will remove that hostname from the other entry before adding to this one. For example: | ||
**Please note**: In `v0.1.2`, specifying a hostname or alias that existed in another automatically removed that hostname from the other entry before. In `v2.1.0`, the `unique` option was added to give the user case-by-case control of this behavior. For example, given an `/etc/hosts` file that contains: | ||
|
||
1.2.3.4 example.com www.example.com | ||
|
||
and | ||
when the Chef recipe below is converged: | ||
|
||
```ruby | ||
hostsfile_entry '2.3.4.5' do | ||
hostname 'www.example.com' | ||
unique true | ||
end | ||
``` | ||
|
||
would yield an /etc/hosts file like this: | ||
then the `/etc/hosts` file will look like this: | ||
|
||
1.2.3.4 example.com | ||
2.3.4.5 www.example.com | ||
|
||
Not specifying the `unique` parameter will result in duplicate hostsfile entries. | ||
|
||
#### `create` | ||
Creates a new hosts file entry. If an entry already exists, it will be overwritten by this one. | ||
|
||
|
@@ -141,6 +153,7 @@ end | |
|
||
This will remove the entry for `1.2.3.4`. | ||
|
||
|
||
Usage | ||
----- | ||
If you're using [Berkshelf](http://berkshelf.com/), just add `hostsfile` to your `Berksfile`: | ||
|
@@ -160,6 +173,7 @@ Have any other cookbooks *depend* on hostsfile by editing editing the `metadata. | |
depends 'hostsfile' | ||
``` | ||
|
||
|
||
Priority | ||
-------- | ||
Priority is a relatively new addition to the cookbook. It gives you the ability to (somewhat) specify the relative order of entries. By default, the priority is calculated for you as follows: | ||
|
@@ -170,19 +184,22 @@ Priority is a relatively new addition to the cookbook. It gives you the ability | |
|
||
However, you can override it using the `priority` option. | ||
|
||
|
||
Contributing | ||
------------ | ||
1. Fork the project | ||
2. Create a feature branch corresponding to you change | ||
3. Commit and test thoroughly | ||
4. Create a Pull Request on github | ||
- ensure you add a detailed description of your changes | ||
|
||
License and Authors | ||
------------------- | ||
|
||
License & Authors | ||
----------------- | ||
- Author:: Seth Vargo ([email protected]) | ||
|
||
Copyright 2012 Seth Vargo, CustomInk, LLC | ||
```text | ||
Copyright 2012-2013, Seth Vargo | ||
Copyright 2012, CustomInk, LLC | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -195,3 +212,4 @@ distributed under the License is distributed on an "AS IS" BASIS, | |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.