-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd7b3db
commit 7532bca
Showing
24 changed files
with
480 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.vagrant | ||
Berksfile.lock | ||
*~ | ||
*# | ||
.#* | ||
\#*# | ||
.*.sw[a-z] | ||
*.un~ | ||
|
||
# Bundler | ||
Gemfile.lock | ||
bin/* | ||
.bundle/* | ||
|
||
.kitchen/ | ||
.kitchen.local.yml |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
driver: | ||
name: vagrant | ||
|
||
provisioner: | ||
name: chef_zero | ||
|
||
verifier: | ||
name: inspec | ||
|
||
platforms: | ||
- name: centos-6.7 | ||
|
||
suites: | ||
- name: default | ||
run_list: | ||
- recipe[workstation::default] | ||
verifier: | ||
inspec_tests: | ||
- test/recipes | ||
attributes: |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source "https://supermarket.chef.io" | ||
|
||
metadata |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# workstation | ||
|
||
TODO: Enter the cookbook description here. | ||
|
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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Put files/directories that should be ignored in this file when uploading | ||
# or sharing to the community site. | ||
# 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/* | ||
Guardfile | ||
Procfile | ||
|
||
# SCM # | ||
####### | ||
.git | ||
*/.git | ||
.gitignore | ||
.gitmodules | ||
.gitconfig | ||
.gitattributes | ||
.svn | ||
*/.bzr/* | ||
*/.hg/* | ||
*/.svn/* | ||
|
||
# Berkshelf # | ||
############# | ||
Berksfile | ||
Berksfile.lock | ||
cookbooks/* | ||
tmp | ||
|
||
# Cookbooks # | ||
############# | ||
CONTRIBUTING | ||
|
||
# Strainer # | ||
############ | ||
Colanderfile | ||
Strainerfile | ||
.colander | ||
.strainer | ||
|
||
# Vagrant # | ||
########### | ||
.vagrant | ||
Vagrantfile | ||
|
||
# Travis # | ||
########## | ||
.travis.yml |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name 'workstation' | ||
maintainer 'The Authors' | ||
maintainer_email '[email protected]' | ||
license 'all_rights' | ||
description 'Installs/Configures workstation' | ||
long_description 'Installs/Configures workstation' | ||
version '0.2.1' | ||
|
16 changes: 16 additions & 0 deletions
16
07-4 Adding A Template/begin/workstation/recipes/default.rb
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# Cookbook Name:: workstation | ||
# Recipe:: default | ||
# | ||
# Copyright (c) 2015 The Authors, All Rights Reserved. | ||
|
||
|
||
# | ||
# The default recipe is the recipe that the cookbook is know most for | ||
# accomplishing. It is often the practice to use this file to include specific | ||
# recipes that perform a specific task. | ||
# | ||
# @see http://docs.chef.io/recipes.html#include-recipes | ||
# | ||
|
||
include_recipe 'workstation::setup' |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# | ||
# Cookbook Name:: workstation | ||
# Recipe:: setup | ||
# | ||
# Copyright (c) 2015 The Authors, All Rights Reserved. | ||
|
||
package 'nano' | ||
# or package 'vim-enhanced' | ||
|
||
package 'ntp' | ||
|
||
package 'git' do | ||
action :install | ||
end | ||
|
||
file '/etc/motd' do | ||
content "This server is the property of Chef | ||
HOSTNAME: #{node['hostname']} | ||
IPADDRESS: #{node['ipaddress']} | ||
CPU: #{node['cpu']['0']['mhz']} | ||
MEMORY: #{node['memory']['total']} | ||
" | ||
action :create | ||
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require 'chefspec' | ||
require 'chefspec/berkshelf' |
27 changes: 27 additions & 0 deletions
27
07-4 Adding A Template/begin/workstation/spec/unit/recipes/default_spec.rb
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# Cookbook Name:: workstation | ||
# Spec:: default | ||
# | ||
# Copyright (c) 2015 The Authors, All Rights Reserved. | ||
|
||
require 'spec_helper' | ||
|
||
describe 'workstation::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 'installs tree' do | ||
expect(chef_run).to install_package('tree') | ||
end | ||
|
||
it 'creates an /etc/motd' do | ||
expect(chef_run).to create_template('/etc/motd') | ||
end | ||
|
||
end | ||
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
This server is the property of Chef | ||
HOSTNAME: <%= node['hostname'] %> | ||
IPADDRESS: <%= node['ipaddress'] %> | ||
CPU: <%= node['cpu']['0']['mhz'] %> | ||
MEMORY: <%= node['memory']['total'] %> |
19 changes: 19 additions & 0 deletions
19
07-4 Adding A Template/begin/workstation/test/recipes/default_test.rb
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# # encoding: utf-8 | ||
|
||
# Inspec test for recipe apache::default | ||
|
||
# The Inspec reference, with examples and extensive documentation, can be | ||
# found at https://docs.chef.io/inspec_reference.html | ||
|
||
unless os.windows? | ||
# This is an example test, replace with your own test. | ||
describe user('root'), :skip do | ||
it { should exist } | ||
end | ||
end | ||
|
||
# This is an example test, replace it with your own test. | ||
describe port(80), :skip do | ||
it { should_not be_listening } | ||
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.vagrant | ||
Berksfile.lock | ||
*~ | ||
*# | ||
.#* | ||
\#*# | ||
.*.sw[a-z] | ||
*.un~ | ||
|
||
# Bundler | ||
Gemfile.lock | ||
bin/* | ||
.bundle/* | ||
|
||
.kitchen/ | ||
.kitchen.local.yml |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
driver: | ||
name: vagrant | ||
|
||
provisioner: | ||
name: chef_zero | ||
|
||
verifier: | ||
name: inspec | ||
|
||
platforms: | ||
- name: centos-6.7 | ||
|
||
suites: | ||
- name: default | ||
run_list: | ||
- recipe[workstation::default] | ||
verifier: | ||
inspec_tests: | ||
- test/recipes | ||
attributes: |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source "https://supermarket.chef.io" | ||
|
||
metadata |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# workstation | ||
|
||
TODO: Enter the cookbook description here. | ||
|
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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Put files/directories that should be ignored in this file when uploading | ||
# or sharing to the community site. | ||
# 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/* | ||
Guardfile | ||
Procfile | ||
|
||
# SCM # | ||
####### | ||
.git | ||
*/.git | ||
.gitignore | ||
.gitmodules | ||
.gitconfig | ||
.gitattributes | ||
.svn | ||
*/.bzr/* | ||
*/.hg/* | ||
*/.svn/* | ||
|
||
# Berkshelf # | ||
############# | ||
Berksfile | ||
Berksfile.lock | ||
cookbooks/* | ||
tmp | ||
|
||
# Cookbooks # | ||
############# | ||
CONTRIBUTING | ||
|
||
# Strainer # | ||
############ | ||
Colanderfile | ||
Strainerfile | ||
.colander | ||
.strainer | ||
|
||
# Vagrant # | ||
########### | ||
.vagrant | ||
Vagrantfile | ||
|
||
# Travis # | ||
########## | ||
.travis.yml |
Oops, something went wrong.