Commit 3a47d364c85d04b6e6bf7e5917b879c154dafa5b
0 parents
Exists in
master
Remove caches for fast download
Showing 40 changed files with 2126 additions and 0 deletions Side-by-side Diff
- .gitignore
- .ruby-version
- Gemfile
- Gemfile.lock
- LICENSE
- Puppetfile
- Puppetfile.lock
- README.md
- config/basic.rb
- config/boxen.rb
- config/hiera.yaml
- docs/faq.md
- docs/modules.md
- docs/personal-configuration.md
- docs/puppet.md
- docs/rails.md
- hiera/common.yaml.example
- hiera/users/hanjianwei.yaml
- lib/.gitkeep
- manifests/site.pp
- modules/people/README.md
- modules/people/manifests/.gitkeep
- modules/people/manifests/hanjianwei.pp
- modules/people/manifests/hanjianwei/applications.pp
- modules/people/manifests/hanjianwei/config.pp
- modules/people/manifests/hanjianwei/mirrors.pp
- modules/people/manifests/hanjianwei/osx.pp
- modules/people/manifests/hanjianwei/repositories.pp
- modules/projects/README.md
- modules/projects/manifests/.gitkeep
- modules/projects/manifests/all.pp
- modules/projects/templates/shared/nginx.conf.erb
- script/bootstrap
- script/boxen
- script/boxen-bootstrap
- script/boxen-git-credential
- script/boxen-my-config
- script/nuke
- script/sync
- shared/README.md
.gitignore
.ruby-version
... | ... | @@ -0,0 +1 @@ |
1 | +system |
Gemfile
... | ... | @@ -0,0 +1,18 @@ |
1 | +source "http://mirrors.aliyun.com/rubygems/" | |
2 | + | |
3 | +gem "boxen", "~> 2.6" | |
4 | +gem "hiera", "~> 1.3.3" | |
5 | +gem "librarian-puppet", "~> 1.0.2" | |
6 | +gem "puppet", "3.6.1" | |
7 | +gem "puppet-lint", "0.3.2" | |
8 | +gem "puppetlabs_spec_helper", "0.4.1" | |
9 | +gem "open4", "~> 1.3.4" | |
10 | +gem "rake", "10.3.2" | |
11 | +gem "rspec-puppet", "1.0.1" | |
12 | +gem "deep_merge", "~> 1.0" | |
13 | + | |
14 | +group :development do | |
15 | + gem "aws-sdk", "~> 1.42" | |
16 | + gem "net-ssh" | |
17 | + gem "rbvmomi" | |
18 | +end |
Gemfile.lock
... | ... | @@ -0,0 +1,100 @@ |
1 | +GEM | |
2 | + remote: https://rubygems.org/ | |
3 | + specs: | |
4 | + CFPropertyList (2.2.8) | |
5 | + addressable (2.3.6) | |
6 | + ansi (1.4.3) | |
7 | + aws-sdk (1.42.0) | |
8 | + json (~> 1.4) | |
9 | + nokogiri (>= 1.4.4) | |
10 | + boxen (2.6.0) | |
11 | + ansi (~> 1.4) | |
12 | + hiera (~> 1.0) | |
13 | + highline (~> 1.6) | |
14 | + json_pure (>= 1.7.7, < 2.0) | |
15 | + librarian-puppet (~> 1.0.0) | |
16 | + octokit (~> 2.7, >= 2.7.1) | |
17 | + puppet (~> 3.0) | |
18 | + builder (3.2.2) | |
19 | + deep_merge (1.0.1) | |
20 | + diff-lcs (1.2.5) | |
21 | + facter (2.0.1) | |
22 | + CFPropertyList (~> 2.2.6) | |
23 | + faraday (0.9.0) | |
24 | + multipart-post (>= 1.2, < 3) | |
25 | + hiera (1.3.3) | |
26 | + json_pure | |
27 | + highline (1.6.21) | |
28 | + json (1.8.1) | |
29 | + json_pure (1.8.1) | |
30 | + librarian (0.1.2) | |
31 | + highline | |
32 | + thor (~> 0.15) | |
33 | + librarian-puppet (1.0.2) | |
34 | + json | |
35 | + librarian (>= 0.1.2) | |
36 | + metaclass (0.0.4) | |
37 | + mini_portile (0.6.0) | |
38 | + mocha (1.1.0) | |
39 | + metaclass (~> 0.0.1) | |
40 | + multipart-post (2.0.0) | |
41 | + net-ssh (2.9.1) | |
42 | + nokogiri (1.6.2.1) | |
43 | + mini_portile (= 0.6.0) | |
44 | + octokit (2.7.2) | |
45 | + sawyer (~> 0.5.2) | |
46 | + open4 (1.3.4) | |
47 | + puppet (3.6.1) | |
48 | + facter (> 1.6, < 3) | |
49 | + hiera (~> 1.0) | |
50 | + json_pure | |
51 | + rgen (~> 0.6.5) | |
52 | + puppet-lint (0.3.2) | |
53 | + puppetlabs_spec_helper (0.4.1) | |
54 | + mocha (>= 0.10.5) | |
55 | + rake | |
56 | + rspec (>= 2.9.0) | |
57 | + rspec-puppet (>= 0.1.1) | |
58 | + rake (10.3.2) | |
59 | + rbvmomi (1.8.1) | |
60 | + builder | |
61 | + nokogiri (>= 1.4.1) | |
62 | + trollop | |
63 | + rgen (0.6.6) | |
64 | + rspec (3.0.0) | |
65 | + rspec-core (~> 3.0.0) | |
66 | + rspec-expectations (~> 3.0.0) | |
67 | + rspec-mocks (~> 3.0.0) | |
68 | + rspec-core (3.0.0) | |
69 | + rspec-support (~> 3.0.0) | |
70 | + rspec-expectations (3.0.0) | |
71 | + diff-lcs (>= 1.2.0, < 2.0) | |
72 | + rspec-support (~> 3.0.0) | |
73 | + rspec-mocks (3.0.0) | |
74 | + rspec-support (~> 3.0.0) | |
75 | + rspec-puppet (1.0.1) | |
76 | + rspec | |
77 | + rspec-support (3.0.0) | |
78 | + sawyer (0.5.4) | |
79 | + addressable (~> 2.3.5) | |
80 | + faraday (~> 0.8, < 0.10) | |
81 | + thor (0.19.1) | |
82 | + trollop (2.0) | |
83 | + | |
84 | +PLATFORMS | |
85 | + ruby | |
86 | + | |
87 | +DEPENDENCIES | |
88 | + aws-sdk (~> 1.42) | |
89 | + boxen (~> 2.6) | |
90 | + deep_merge (~> 1.0) | |
91 | + hiera (~> 1.3.3) | |
92 | + librarian-puppet (~> 1.0.2) | |
93 | + net-ssh | |
94 | + open4 (~> 1.3.4) | |
95 | + puppet (= 3.6.1) | |
96 | + puppet-lint (= 0.3.2) | |
97 | + puppetlabs_spec_helper (= 0.4.1) | |
98 | + rake (= 10.3.2) | |
99 | + rbvmomi | |
100 | + rspec-puppet (= 1.0.1) |
LICENSE
... | ... | @@ -0,0 +1,20 @@ |
1 | +Copyright (c) 2012 GitHub, Inc. | |
2 | + | |
3 | +Permission is hereby granted, free of charge, to any person obtaining | |
4 | +a copy of this software and associated documentation files (the | |
5 | +"Software"), to deal in the Software without restriction, including | |
6 | +without limitation the rights to use, copy, modify, merge, publish, | |
7 | +distribute, sublicense, and/or sell copies of the Software, and to | |
8 | +permit persons to whom the Software is furnished to do so, subject to | |
9 | +the following conditions: | |
10 | + | |
11 | +The above copyright notice and this permission notice shall be | |
12 | +included in all copies or substantial portions of the Software. | |
13 | + | |
14 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
15 | +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
16 | +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |
17 | +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | |
18 | +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | |
19 | +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | |
20 | +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Puppetfile
... | ... | @@ -0,0 +1,61 @@ |
1 | +# This file manages Puppet module dependencies. | |
2 | +# | |
3 | +# It works a lot like Bundler. We provide some core modules by | |
4 | +# default. This ensures at least the ability to construct a basic | |
5 | +# environment. | |
6 | + | |
7 | +# Shortcut for a module from GitHub's boxen organization | |
8 | +def github(name, *args) | |
9 | + options ||= if args.last.is_a? Hash | |
10 | + args.last | |
11 | + else | |
12 | + {} | |
13 | + end | |
14 | + | |
15 | + if path = options.delete(:path) | |
16 | + mod name, :path => path | |
17 | + else | |
18 | + version = args.first | |
19 | + options[:repo] ||= "boxen/puppet-#{name}" | |
20 | + mod name, version, :github_tarball => options[:repo] | |
21 | + end | |
22 | +end | |
23 | + | |
24 | +# Shortcut for a module under development | |
25 | +def dev(name, *args) | |
26 | + mod name, :path => "#{ENV['HOME']}/src/boxen/puppet-#{name}" | |
27 | +end | |
28 | + | |
29 | +# Includes many of our custom types and providers, as well as global | |
30 | +# config. Required. | |
31 | + | |
32 | +github "boxen", "3.6.1" | |
33 | + | |
34 | +# Support for default hiera data in modules | |
35 | + | |
36 | +github "module-data", "0.0.3", :repo => "ripienaar/puppet-module-data" | |
37 | + | |
38 | +# Core modules for a basic development environment. You can replace | |
39 | +# some/most of these if you want, but it's not recommended. | |
40 | + | |
41 | +github "dnsmasq", "1.0.1" | |
42 | +github "gcc", "2.0.101" | |
43 | +github "git", "2.4.0" | |
44 | +github "homebrew", "1.9.4.rc", :repo => "hanjianwei/puppet-homebrew" | |
45 | +github "hub", "1.3.0" | |
46 | +github "inifile", "1.0.3", :repo => "puppetlabs/puppetlabs-inifile" | |
47 | +github "nginx", "1.4.3" | |
48 | +github "nodejs", "3.7.0" | |
49 | +github "openssl", "1.0.0" | |
50 | +github "pkgconfig", "1.0.0" | |
51 | +github "repository", "2.3.0" | |
52 | +github "ruby", "8.0.4" | |
53 | +github "stdlib", "4.2.1", :repo => "puppetlabs/puppetlabs-stdlib" | |
54 | +github "sudo", "1.0.0" | |
55 | +github "xquartz", "1.1.1" | |
56 | + | |
57 | +# Optional/custom modules. There are tons available at | |
58 | +# https://github.com/boxen. | |
59 | +github "osx", "2.7.0" | |
60 | +github "property_list_key", "0.2.1", :repo => "glarizza/puppet-property_list_key" | |
61 | +github "brewcask", "0.0.4.rc2", :repo => "hanjianwei/puppet-brewcask" |
Puppetfile.lock
... | ... | @@ -0,0 +1,122 @@ |
1 | +GITHUBTARBALL | |
2 | + remote: boxen/puppet-boxen | |
3 | + specs: | |
4 | + boxen (3.6.1) | |
5 | + | |
6 | +GITHUBTARBALL | |
7 | + remote: boxen/puppet-dnsmasq | |
8 | + specs: | |
9 | + dnsmasq (1.0.1) | |
10 | + | |
11 | +GITHUBTARBALL | |
12 | + remote: boxen/puppet-gcc | |
13 | + specs: | |
14 | + gcc (2.0.101) | |
15 | + | |
16 | +GITHUBTARBALL | |
17 | + remote: boxen/puppet-git | |
18 | + specs: | |
19 | + git (2.4.0) | |
20 | + | |
21 | +GITHUBTARBALL | |
22 | + remote: boxen/puppet-hub | |
23 | + specs: | |
24 | + hub (1.3.0) | |
25 | + | |
26 | +GITHUBTARBALL | |
27 | + remote: boxen/puppet-nginx | |
28 | + specs: | |
29 | + nginx (1.4.3) | |
30 | + | |
31 | +GITHUBTARBALL | |
32 | + remote: boxen/puppet-nodejs | |
33 | + specs: | |
34 | + nodejs (3.7.0) | |
35 | + | |
36 | +GITHUBTARBALL | |
37 | + remote: boxen/puppet-openssl | |
38 | + specs: | |
39 | + openssl (1.0.0) | |
40 | + | |
41 | +GITHUBTARBALL | |
42 | + remote: boxen/puppet-osx | |
43 | + specs: | |
44 | + osx (2.7.0) | |
45 | + | |
46 | +GITHUBTARBALL | |
47 | + remote: boxen/puppet-pkgconfig | |
48 | + specs: | |
49 | + pkgconfig (1.0.0) | |
50 | + | |
51 | +GITHUBTARBALL | |
52 | + remote: boxen/puppet-repository | |
53 | + specs: | |
54 | + repository (2.3.0) | |
55 | + | |
56 | +GITHUBTARBALL | |
57 | + remote: boxen/puppet-ruby | |
58 | + specs: | |
59 | + ruby (8.0.4) | |
60 | + | |
61 | +GITHUBTARBALL | |
62 | + remote: boxen/puppet-sudo | |
63 | + specs: | |
64 | + sudo (1.0.0) | |
65 | + | |
66 | +GITHUBTARBALL | |
67 | + remote: boxen/puppet-xquartz | |
68 | + specs: | |
69 | + xquartz (1.1.1) | |
70 | + | |
71 | +GITHUBTARBALL | |
72 | + remote: glarizza/puppet-property_list_key | |
73 | + specs: | |
74 | + property_list_key (0.2.1) | |
75 | + | |
76 | +GITHUBTARBALL | |
77 | + remote: hanjianwei/puppet-brewcask | |
78 | + specs: | |
79 | + brewcask (0.0.4.rc2) | |
80 | + | |
81 | +GITHUBTARBALL | |
82 | + remote: hanjianwei/puppet-homebrew | |
83 | + specs: | |
84 | + homebrew (1.9.4.rc) | |
85 | + | |
86 | +GITHUBTARBALL | |
87 | + remote: puppetlabs/puppetlabs-inifile | |
88 | + specs: | |
89 | + inifile (1.0.3) | |
90 | + | |
91 | +GITHUBTARBALL | |
92 | + remote: puppetlabs/puppetlabs-stdlib | |
93 | + specs: | |
94 | + stdlib (4.2.1) | |
95 | + | |
96 | +GITHUBTARBALL | |
97 | + remote: ripienaar/puppet-module-data | |
98 | + specs: | |
99 | + module-data (0.0.3) | |
100 | + | |
101 | +DEPENDENCIES | |
102 | + boxen (= 3.6.1) | |
103 | + brewcask (= 0.0.4.rc2) | |
104 | + dnsmasq (= 1.0.1) | |
105 | + gcc (= 2.0.101) | |
106 | + git (= 2.4.0) | |
107 | + homebrew (= 1.9.4.rc) | |
108 | + hub (= 1.3.0) | |
109 | + inifile (= 1.0.3) | |
110 | + module-data (= 0.0.3) | |
111 | + nginx (= 1.4.3) | |
112 | + nodejs (= 3.7.0) | |
113 | + openssl (= 1.0.0) | |
114 | + osx (= 2.7.0) | |
115 | + pkgconfig (= 1.0.0) | |
116 | + property_list_key (= 0.2.1) | |
117 | + repository (= 2.3.0) | |
118 | + ruby (= 8.0.4) | |
119 | + stdlib (= 4.2.1) | |
120 | + sudo (= 1.0.0) | |
121 | + xquartz (= 1.1.1) | |
122 | + |
README.md
... | ... | @@ -0,0 +1,318 @@ |
1 | +# Our Boxen | |
2 | + | |
3 | +This is a template Boxen project designed for your organization to fork and | |
4 | +modify appropriately. | |
5 | +The Boxen rubygem and the Boxen puppet modules are only a framework for getting | |
6 | +things done. | |
7 | +This repository template is just a basic example of _how_ to do things with them. | |
8 | + | |
9 | +## Getting Started | |
10 | + | |
11 | +To give you a brief overview, we're going to: | |
12 | + | |
13 | +* Install dependencies (basically Xcode) | |
14 | +* Bootstrap a boxen for your self/team/org/company | |
15 | +* Then convert your local copy of that boxen to the post-bootstrapped version | |
16 | + | |
17 | +There are a few potential conflicts to keep in mind. | |
18 | +Boxen does its best not to get in the way of a dirty system, | |
19 | +but you should check into the following before attempting to install your | |
20 | +boxen on any machine (we do some checks before every Boxen run to try | |
21 | +and detect most of these and tell you anyway): | |
22 | + | |
23 | +* Boxen __requires__ at least the Xcode Command Line Tools installed. | |
24 | +* Boxen __will not__ work with an existing rvm install. | |
25 | +* Boxen __may not__ play nice with a GitHub username that includes dash(-) | |
26 | +* Boxen __may not__ play nice with an existing rbenv install. | |
27 | +* Boxen __may not__ play nice with an existing chruby install. | |
28 | +* Boxen __may not__ play nice with an existing homebrew install. | |
29 | +* Boxen __may not__ play nice with an existing nvm install. | |
30 | +* Boxen __recommends__ installing the full Xcode. | |
31 | + | |
32 | +### Dependencies | |
33 | + | |
34 | +**Install the Xcode Command Lines Tools and/or full Xcode.** | |
35 | +This will grant you the most predictable behavior in building apps like | |
36 | +MacVim. | |
37 | + | |
38 | +How do you do it? | |
39 | + | |
40 | +#### OS X 10.9 (Mavericks) | |
41 | + | |
42 | +If you are using [`b26abd0` of boxen-web](https://github.com/boxen/boxen-web/commit/b26abd0d681129eba0b5f46ed43110d873d8fdc2) | |
43 | +or newer, it will be automatically installed as part of Boxen. | |
44 | +Otherwise, follow instructions below. | |
45 | + | |
46 | +#### OS X < 10.9 | |
47 | + | |
48 | +1. Install Xcode from the Mac App Store. | |
49 | +1. Open Xcode. | |
50 | +1. Open the Preferences window (`Cmd-,`). | |
51 | +1. Go to the Downloads tab. | |
52 | +1. Install the Command Line Tools. | |
53 | + | |
54 | +### Bootstrapping | |
55 | + | |
56 | +Create a **new** git repository somewhere on the internet. | |
57 | +It can be private or public -- it really doesn't matter. | |
58 | +If you're making a repository on GitHub, you _may not_ want to fork this repo | |
59 | +to get started. | |
60 | +The reason for that is that you can't really make private forks of public | |
61 | +repositories easily. | |
62 | + | |
63 | +Once you've done that, you can run the following to bootstrap | |
64 | +your boxen: | |
65 | + | |
66 | +``` | |
67 | +sudo mkdir -p /opt/boxen | |
68 | +sudo chown ${USER}:staff /opt/boxen | |
69 | +git clone https://github.com/boxen/our-boxen /opt/boxen/repo | |
70 | +cd /opt/boxen/repo | |
71 | +git remote rm origin | |
72 | +git remote add origin <the location of my new git repository> | |
73 | +git push -u origin master | |
74 | +``` | |
75 | + | |
76 | +Now that your boxen is bootstrapped, you can run the following to | |
77 | +install the default configuration from this repo: | |
78 | + | |
79 | +``` | |
80 | +cd /opt/boxen/repo | |
81 | +./script/boxen | |
82 | +``` | |
83 | + | |
84 | +### Distributing | |
85 | + | |
86 | +That's enough to get your boxen into a usable state on other machines, | |
87 | +usually. | |
88 | +From there, we recommend setting up | |
89 | +[boxen-web](https://github.com/boxen/boxen-web) | |
90 | +as an easy way to automate letting other folks install your boxen. | |
91 | + | |
92 | +If you _don't_ want to use boxen-web, folks can get using your boxen like so: | |
93 | + | |
94 | +``` | |
95 | +sudo mkdir -p /opt/boxen | |
96 | +sudo chown ${USER}:staff /opt/boxen | |
97 | +git clone <location of my new git repository> /opt/boxen/repo | |
98 | +cd /opt/boxen/repo | |
99 | +./script/boxen | |
100 | +``` | |
101 | + | |
102 | +Keep in mind this requires you to encrypt your hard drive by default. | |
103 | +If you do not want to do encrypt your hard drive, you can use the `--no-fde`. | |
104 | + | |
105 | +``` | |
106 | +./script/boxen --no-fde | |
107 | +``` | |
108 | + | |
109 | +It should run successfully, and should tell you to source a shell script | |
110 | +in your environment. | |
111 | +For users without a bash or zsh config or a `~/.profile` file, | |
112 | +Boxen will create a shim for you that will work correctly. | |
113 | +If you do have a `~/.bashrc` or `~/.zshrc`, your shell will not use | |
114 | +`~/.profile` so you'll need to add a line like so at _the end of your config_: | |
115 | + | |
116 | +``` sh | |
117 | +[ -f /opt/boxen/env.sh ] && source /opt/boxen/env.sh | |
118 | +``` | |
119 | + | |
120 | +Once your shell is ready, open a new tab/window in your Terminal | |
121 | +and you should be able to successfully run `boxen --env`. | |
122 | +If that runs cleanly, you're in good shape. | |
123 | + | |
124 | +## What You Get | |
125 | + | |
126 | +This template project provides the following by default: | |
127 | + | |
128 | +* Homebrew | |
129 | +* Git | |
130 | +* Hub | |
131 | +* dnsmasq w/ .dev resolver for localhost | |
132 | +* rbenv | |
133 | +* Full Disk Encryption requirement | |
134 | +* Node.js 0.6 | |
135 | +* Node.js 0.8 | |
136 | +* Node.js 0.10 | |
137 | +* Ruby 1.9.3 | |
138 | +* Ruby 2.0.0 | |
139 | +* Ruby 2.1.0 | |
140 | +* Ruby 2.1.1 | |
141 | +* ack | |
142 | +* Findutils | |
143 | +* GNU tar | |
144 | + | |
145 | +## Customizing | |
146 | + | |
147 | +You can always check out the number of existing modules we already | |
148 | +provide as optional installs under the | |
149 | +[boxen organization](https://github.com/boxen). These modules are all | |
150 | +tested to be compatible with Boxen. Use the `Puppetfile` to pull them | |
151 | +in dependencies automatically whenever `boxen` is run. | |
152 | + | |
153 | +### Including boxen modules from github (boxen/puppet-<name>) | |
154 | + | |
155 | +You must add the github information for your added Puppet module into your Puppetfile at the root of your | |
156 | +boxen repo (ex. /path/to/your-boxen/Puppetfile): | |
157 | + | |
158 | + # Core modules for a basic development environment. You can replace | |
159 | + # some/most of these if you want, but it's not recommended. | |