Skip to content

Commit

Permalink
Add generated cookbook content
Browse files Browse the repository at this point in the history
  • Loading branch information
glimberg committed Feb 20, 2017
0 parents commit 53f09f5
Show file tree
Hide file tree
Showing 10 changed files with 225 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.vagrant
*~
*#
.#*
\#*#
.*.sw[a-z]
*.un~

# Bundler
Gemfile.lock
bin/*
.bundle/*

# test kitchen
.kitchen/
.kitchen.local.yml

# Chef
Berksfile.lock
.zero-knife.rb
Policyfile.lock.json
26 changes: 26 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
driver:
name: vagrant

provisioner:
name: chef_zero
# You may wish to disable always updating cookbooks in CI or other testing environments.
# For example:
# always_update_cookbooks: <%= !ENV['CI'] %>
always_update_cookbooks: true

verifier:
name: inspec

platforms:
- name: ubuntu-16.04
- name: centos-7.2

suites:
- name: default
run_list:
- recipe[chef-zerotier::default]
verifier:
inspec_tests:
- test/smoke/default
attributes:
3 changes: 3 additions & 0 deletions Berksfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source 'https://supermarket.chef.io'

metadata
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# chef-zerotier

TODO: Enter the cookbook description here.

107 changes: 107 additions & 0 deletions chefignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Put files/directories that should be ignored in this file when uploading
# to a chef-server or supermarket.
# Lines that start with '# ' are comments.

# OS generated files #
######################
.DS_Store
Icon?
nohup.out
ehthumbs.db
Thumbs.db

# SASS #
########
.sass-cache

# EDITORS #
###########
\#*
.#*
*~
*.sw[a-z]
*.bak
REVISION
TAGS*
tmtags
*_flymake.*
*_flymake
*.tmproj
.project
.settings
mkmf.log

## COMPILED ##
##############
a.out
*.o
*.pyc
*.so
*.com
*.class
*.dll
*.exe
*/rdoc/

# Testing #
###########
.watchr
.rspec
spec/*
spec/fixtures/*
test/*
features/*
examples/*
Guardfile
Procfile
.kitchen*
.rubocop.yml
spec/*
Rakefile
.travis.yml
.foodcritic
.codeclimate.yml

# SCM #
#######
.git
*/.git
.gitignore
.gitmodules
.gitconfig
.gitattributes
.svn
*/.bzr/*
*/.hg/*
*/.svn/*

# Berkshelf #
#############
Berksfile
Berksfile.lock
cookbooks/*
tmp

# Policyfile #
##############
Policyfile.rb
Policyfile.lock.json

# Cookbooks #
#############
CONTRIBUTING*
CHANGELOG*
TESTING*
MAINTAINERS.toml

# Strainer #
############
Colanderfile
Strainerfile
.colander
.strainer

# Vagrant #
###########
.vagrant
Vagrantfile
19 changes: 19 additions & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name 'chef-zerotier'
maintainer 'The Authors'
maintainer_email '[email protected]'
license 'all_rights'
description 'Installs/Configures chef-zerotier'
long_description 'Installs/Configures chef-zerotier'
version '0.1.0'

# The `issues_url` points to the location where issues for this cookbook are
# tracked. A `View Issues` link will be displayed on this cookbook's page when
# uploaded to a Supermarket.
#
# issues_url 'https://github.com/<insert_org_here>/chef-zerotier/issues' if respond_to?(:issues_url)

# The `source_url` points to the development reposiory for this cookbook. A
# `View Source` link will be displayed on this cookbook's page when uploaded to
# a Supermarket.
#
# source_url 'https://github.com/<insert_org_here>/chef-zerotier' if respond_to?(:source_url)
5 changes: 5 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Cookbook:: chef-zerotier
# Recipe:: default
#
# Copyright:: 2017, The Authors, All Rights Reserved.
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require 'chefspec'
require 'chefspec/berkshelf'
20 changes: 20 additions & 0 deletions spec/unit/recipes/default_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Cookbook:: chef-zerotier
# Spec:: default
#
# Copyright:: 2017, The Authors, All Rights Reserved.

require 'spec_helper'

describe 'chef-zerotier::default' do
context 'When all attributes are default, on an unspecified platform' do
let(:chef_run) do
runner = ChefSpec::ServerRunner.new
runner.converge(described_recipe)
end

it 'converges successfully' do
expect { chef_run }.to_not raise_error
end
end
end
18 changes: 18 additions & 0 deletions test/smoke/default/default_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# # encoding: utf-8

# Inspec test for recipe chef-zerotier::default

# The Inspec reference, with examples and extensive documentation, can be
# found at http://inspec.io/docs/reference/resources/

unless os.windows?
describe user('root') do
it { should exist }
skip 'This is an example test, replace with your own test.'
end
end

describe port(80) do
it { should_not be_listening }
skip 'This is an example test, replace with your own test.'
end

0 comments on commit 53f09f5

Please sign in to comment.