madscience 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Cheffile +3 -1
- data/Cheffile.lock +11 -11
- data/README.md +47 -31
- data/bin/madscience +85 -37
- data/cookbooks/apt/CHANGELOG.md +4 -1
- data/cookbooks/apt/README.md +1 -0
- data/cookbooks/apt/metadata.json +2 -2
- data/cookbooks/apt/providers/preference.rb +10 -1
- data/cookbooks/apt/recipes/unattended-upgrades.rb +4 -0
- data/cookbooks/vagrant/Berksfile +7 -1
- data/cookbooks/vagrant/CHANGELOG.md +4 -0
- data/cookbooks/vagrant/README.md +36 -27
- data/cookbooks/vagrant/attributes/default.rb +1 -0
- data/cookbooks/vagrant/libraries/helpers.rb +24 -1
- data/cookbooks/vagrant/metadata.rb +6 -4
- data/cookbooks/vagrant/providers/plugin.rb +38 -8
- data/cookbooks/vagrant/recipes/default.rb +1 -14
- data/cookbooks/vagrant/recipes/install_plugins.rb +35 -0
- data/cookbooks/vagrant/recipes/mac_os_x.rb +0 -16
- data/cookbooks/vagrant/resources/plugin.rb +2 -0
- data/cookbooks/vagrant/test/fixtures/cookbooks/test/README.md +4 -0
- data/cookbooks/vagrant/test/fixtures/cookbooks/test/metadata.rb +2 -0
- data/cookbooks/vagrant/test/fixtures/cookbooks/test/recipes/default.rb +18 -0
- data/cookbooks/virtualbox/recipes/default.rb +1 -1
- data/cookbooks/windows/CHANGELOG.md +45 -24
- data/cookbooks/windows/README.md +47 -8
- data/cookbooks/windows/attributes/default.rb +3 -3
- data/cookbooks/windows/files/default/handlers/windows_reboot_handler.rb +4 -4
- data/cookbooks/windows/libraries/feature_base.rb +1 -1
- data/cookbooks/windows/libraries/powershell_helper.rb +2 -2
- data/cookbooks/windows/libraries/registry_helper.rb +2 -2
- data/cookbooks/windows/libraries/version.rb +2 -2
- data/cookbooks/windows/libraries/windows_helper.rb +48 -2
- data/cookbooks/windows/libraries/windows_package.rb +0 -42
- data/cookbooks/windows/libraries/wmi_helper.rb +1 -1
- data/cookbooks/windows/metadata.json +5 -13
- data/cookbooks/windows/providers/auto_run.rb +1 -1
- data/cookbooks/windows/providers/batch.rb +2 -2
- data/cookbooks/windows/providers/feature_dism.rb +2 -2
- data/cookbooks/windows/providers/feature_servermanagercmd.rb +2 -2
- data/cookbooks/windows/providers/pagefile.rb +1 -1
- data/cookbooks/windows/providers/path.rb +1 -1
- data/cookbooks/windows/providers/reboot.rb +2 -2
- data/cookbooks/windows/providers/registry.rb +2 -2
- data/cookbooks/windows/providers/task.rb +2 -2
- data/cookbooks/windows/providers/zipfile.rb +3 -2
- data/cookbooks/windows/recipes/default.rb +2 -2
- data/cookbooks/windows/recipes/reboot_handler.rb +2 -2
- data/cookbooks/windows/resources/batch.rb +2 -2
- data/cookbooks/windows/resources/feature.rb +2 -2
- data/cookbooks/windows/resources/pagefile.rb +1 -1
- data/cookbooks/windows/resources/reboot.rb +2 -2
- data/cookbooks/windows/resources/registry.rb +2 -2
- data/cookbooks/windows/resources/task.rb +2 -2
- data/cookbooks/windows/resources/zipfile.rb +2 -2
- data/cookbooks/yum/CHANGELOG.md +8 -0
- data/cookbooks/yum/attributes/main.rb +3 -0
- data/cookbooks/yum/metadata.json +1 -1
- data/cookbooks/yum/templates/default/main.erb +4 -1
- data/lib/madscience/version.rb +1 -1
- data/site-cookbooks/madscience-vagrant-cookbook/recipes/default.rb +10 -3
- metadata +6 -11
- data/cookbooks/apt/metadata.rb +0 -34
- data/cookbooks/windows/Berksfile +0 -7
- data/cookbooks/windows/CONTRIBUTING +0 -46
- data/cookbooks/windows/Gemfile +0 -14
- data/cookbooks/windows/LICENSE +0 -201
- data/cookbooks/windows/TODO.md +0 -6
- data/cookbooks/windows/chefignore +0 -2
- data/cookbooks/windows/metadata.rb +0 -9
- data/cookbooks/yum/metadata.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf908a07554ef2fe92e8de0344c8618adba28aff
|
4
|
+
data.tar.gz: 321c2f0df96b92ab2f9d544e675ac16171c0912e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ef2f3e8a0e45a1ebf2709a6735cece2d2628b19338f40eee1392b0023301a6a00ff07079094ccb230827f71345b0a38e551a3fbcf6cf7f838bdbdd5d400fc8e
|
7
|
+
data.tar.gz: 827f27f688a0409b305b54038c8488268ed3dfeb0b5e41897afcbb9559225eb4614f690633eea74afd2579c869b8f56684e71e0ae84d5e71340f2b1a162f6c23
|
data/Cheffile
CHANGED
@@ -3,7 +3,9 @@
|
|
3
3
|
|
4
4
|
site 'http://community.opscode.com/api/v1'
|
5
5
|
|
6
|
+
# TODO: lock down Vagrant and VirtualBox cookbooks at specific release version
|
7
|
+
|
6
8
|
cookbook 'vagrant',
|
7
9
|
:git => 'https://github.com/noahgibbs/vagrant-cookbook'
|
8
10
|
cookbook 'virtualbox',
|
9
|
-
:git => 'https://github.com/
|
11
|
+
:git => 'https://github.com/noahgibbs/virtualbox-cookbook'
|
data/Cheffile.lock
CHANGED
@@ -1,32 +1,32 @@
|
|
1
1
|
SITE
|
2
2
|
remote: http://community.opscode.com/api/v1
|
3
3
|
specs:
|
4
|
-
apt (2.6.
|
4
|
+
apt (2.6.1)
|
5
5
|
chef_handler (1.1.6)
|
6
6
|
dmg (2.2.2)
|
7
|
-
windows (1.36.
|
7
|
+
windows (1.36.6)
|
8
8
|
chef_handler (>= 0.0.0)
|
9
|
-
yum (3.5.
|
9
|
+
yum (3.5.3)
|
10
10
|
|
11
11
|
GIT
|
12
|
-
remote: https://github.com/
|
12
|
+
remote: https://github.com/noahgibbs/vagrant-cookbook
|
13
13
|
ref: master
|
14
|
-
sha:
|
14
|
+
sha: 802fccf8d451a48e302e08e82441795d9833c175
|
15
15
|
specs:
|
16
|
-
|
17
|
-
apt (>= 0.0.0)
|
16
|
+
vagrant (0.2.2)
|
18
17
|
dmg (>= 0.0.0)
|
19
18
|
windows (>= 0.0.0)
|
20
|
-
yum (>= 0.0.0)
|
21
19
|
|
22
20
|
GIT
|
23
|
-
remote: https://github.com/noahgibbs/
|
21
|
+
remote: https://github.com/noahgibbs/virtualbox-cookbook
|
24
22
|
ref: master
|
25
|
-
sha:
|
23
|
+
sha: 5336d572b061f72a7130c9031930b3cbbfc00456
|
26
24
|
specs:
|
27
|
-
|
25
|
+
virtualbox (0.7.2)
|
26
|
+
apt (>= 0.0.0)
|
28
27
|
dmg (>= 0.0.0)
|
29
28
|
windows (>= 0.0.0)
|
29
|
+
yum (>= 0.0.0)
|
30
30
|
|
31
31
|
DEPENDENCIES
|
32
32
|
vagrant (>= 0)
|
data/README.md
CHANGED
@@ -9,9 +9,24 @@ The Mad Science Stack is based on a class called Rails Deploy In An Hour
|
|
9
9
|
(http://rails-deploy-in-an-hour.com), a paid product. This code is MIT
|
10
10
|
licensed, however, and can be used according to that license.
|
11
11
|
|
12
|
+
The Mad Science Stack assumes your sensitive deployment information (SSH keys,
|
13
|
+
passwords, etc.) is in ~/.deploy_credentials. Much of it will be created if it
|
14
|
+
doesn't exist, but you'll need to fill in your own passwords for external
|
15
|
+
services like email, your own AWS deploy keys and so on if you need them.
|
16
|
+
|
17
|
+
When in doubt, run setup and look in the deploy credentials directory and
|
18
|
+
nodes/all_nodes.json.erb in the deploy repository. You can also read
|
19
|
+
documentation in the MadScience project Wiki:
|
20
|
+
https://github.com/noahgibbs/madscience/wiki
|
21
|
+
|
22
|
+
It's also possible to purchase an online class with additional videos, example
|
23
|
+
configurations and documentation at "http://rails-deploy-in-an-hour.com" if you wish.
|
24
|
+
|
25
|
+
## Tool Versions
|
26
|
+
|
12
27
|
Each version of the Mad Science Stack is tested with a specific version of
|
13
28
|
each tool. The current version of the Mad Science Stack, Version 0.0.1,
|
14
|
-
installs and uses other specific tool versions,
|
29
|
+
installs and uses other specific tool versions, in this case:
|
15
30
|
|
16
31
|
* Chef: 12.0.3
|
17
32
|
* Librarian-Chef: 0.0.3
|
@@ -27,6 +42,8 @@ Not all of this software is used by every deploy repository. For instance,
|
|
27
42
|
Capistrano can be optional. But if you use it with a given version of
|
28
43
|
MadScience, that's the version we've tested with.
|
29
44
|
|
45
|
+
## Requirements
|
46
|
+
|
30
47
|
The MadScience stack also assumes you have these installed:
|
31
48
|
|
32
49
|
* Bundler and RubyGems (some recent version)
|
@@ -40,12 +57,33 @@ course.
|
|
40
57
|
|
41
58
|
Add 'madscience' to your Gemfile or install it manually:
|
42
59
|
|
43
|
-
|
60
|
+
gem install madscience
|
44
61
|
|
45
62
|
You'll also need Git and SSH installed already.
|
46
63
|
|
47
64
|
It's possible to clone this repo and run madscience locally, too.
|
48
65
|
|
66
|
+
After madscience has been run, you can clone the default madscience deploy
|
67
|
+
repository under the current directory, and create a new (development) VM:
|
68
|
+
|
69
|
+
rvmsudo madscience setup_clone_and_deploy # with RVM
|
70
|
+
# OR sudo madscience setup_clone_and_deploy # with no RVM
|
71
|
+
|
72
|
+
You can also just install the tools without cloning a new repo or deploying it automatically.
|
73
|
+
|
74
|
+
rvmsudo madscience setup # with RVM
|
75
|
+
# OR sudo madscience setup # with no RVM
|
76
|
+
|
77
|
+
And if you want a one-liner for your organization, you can specify a different
|
78
|
+
deploy repository:
|
79
|
+
|
80
|
+
MADSCIENCE_REPO=git://my.org/path_to_my_repo rvmsudo madscience setup_clone_and_deploy
|
81
|
+
|
82
|
+
If you're really gung-ho and have your deploy credentials directory set up
|
83
|
+
already, you can even clone and deploy to real hosting:
|
84
|
+
|
85
|
+
MADSCIENCE_REPO=git://my.org/path_to_my_repo MADSCIENCE_PROVIDER=aws rvmsudo madscience setup_clone_and_deploy
|
86
|
+
|
49
87
|
## Usage
|
50
88
|
|
51
89
|
After you've installed the Mad Science gem ("gem install madscience"), you'll
|
@@ -63,28 +101,7 @@ using a version manager (RVM, chruby, rbenv, etc.)
|
|
63
101
|
It will also set up initial deploy credentials such as SSH keys. You can
|
64
102
|
modify the results in ~/.deploy_credentials if you like. The default setup is
|
65
103
|
meant to be tolerably secure and fairly convenient. You only need one
|
66
|
-
|
67
|
-
|
68
|
-
### Cloning
|
69
|
-
|
70
|
-
The setup command will set up basic deployment credentials if you don't have
|
71
|
-
them. It will also set up VirtualBox and Vagrant, and install the appropriate
|
72
|
-
tools and gems.
|
73
|
-
|
74
|
-
However, you'll still need a deploy repo - code that's specific to your setup,
|
75
|
-
including what host to install to, what Chef cookbooks to use and where to
|
76
|
-
find your application.
|
77
|
-
|
78
|
-
There's a default one (NOTE: currently it's a private repo! There will be a
|
79
|
-
public repo for this later.) Or you can set the MADSCIENCE_REPO environment
|
80
|
-
variable to customize what repo to clone from, or just clone the repo
|
81
|
-
yourself, locally.
|
82
|
-
|
83
|
-
# No sudo here, you don't want root (admin) to own these files
|
84
|
-
madscience clone
|
85
|
-
|
86
|
-
This will clone and configure a new repository which you can configure for
|
87
|
-
your app(s).
|
104
|
+
deploy credentials directory no matter how many Rubies or deploy repositories you have.
|
88
105
|
|
89
106
|
### Implementation
|
90
107
|
|
@@ -98,12 +115,11 @@ that you're installing virtualization software, of course.
|
|
98
115
|
If you've cloned the madscience gem from GitHub and don't have it installed,
|
99
116
|
you'll want to run it like this:
|
100
117
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
bundle exec bin/madscience clone
|
118
|
+
# No RVM? Change "rvmsudo" to "sudo"
|
119
|
+
bundle install
|
120
|
+
sudo rm -rf cookbooks/* # Blow away root-owned cookbooks on later runs
|
121
|
+
librarian-chef install
|
122
|
+
rvmsudo bundle exec bin/madscience setup # Whichever command you're testing
|
107
123
|
|
108
124
|
## Problems?
|
109
125
|
|
@@ -116,7 +132,7 @@ It's easy to get permissions problems. You're running some commands as sudo, and
|
|
116
132
|
* Author:: Noah Gibbs (the.codefolio.guy@gmail.com)
|
117
133
|
* Vagrant-Cookbook copyright 2013-2014 Joshua Timberman, Apache 2.0 License
|
118
134
|
* Virtualbox-Cookbook copyright 2013-2014 Joshua Timberman, Apache 2.0 License
|
119
|
-
* Everything else (C) Noah Gibbs, 2014
|
135
|
+
* Everything else (C) Noah Gibbs, 2014-2015
|
120
136
|
|
121
137
|
With the exception of Joshua Timberman's cookbooks, this code is under the MIT
|
122
138
|
license.
|
data/bin/madscience
CHANGED
@@ -1,30 +1,33 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
# Parameters which can be passed in environment variables
|
3
4
|
MADSCIENCE_REPO_URL = ENV['MADSCIENCE_REPO'] ||
|
4
|
-
"git@github.com:noahgibbs/
|
5
|
+
"git@github.com:noahgibbs/madscience.git"
|
6
|
+
MADSCIENCE_PROVIDER = ENV['MADSCIENCE_PROVIDER'] || "virtualbox"
|
5
7
|
|
6
8
|
# TODO: Add Windows runas incantation to replace sudo on Windows
|
7
9
|
USAGE_INFO = <<USAGE
|
8
10
|
Usage:
|
9
|
-
sudo #{$0}
|
10
|
-
#{$0} clone
|
11
|
+
sudo #{$0} setup_and_clone
|
11
12
|
|
12
13
|
OR
|
13
14
|
|
14
|
-
rvmsudo #{$0}
|
15
|
-
|
15
|
+
rvmsudo #{$0} setup_and_clone
|
16
|
+
|
17
|
+
Other commands:
|
18
|
+
setup - install dev machine tools for madscience stack. Run as sudo.
|
19
|
+
clone - clone a new repository, called madscience, under this dir
|
16
20
|
USAGE
|
17
21
|
|
18
22
|
# First, make sure we have the right Ruby version
|
19
23
|
# TODO: add more checks for RUBY_VERSION, RUBY_PLATFORM, etc. Ensure MRI.
|
20
24
|
if RUBY_PLATFORM == "java"
|
21
|
-
raise "Please install and run the MadScience gem in the Ruby you'll be deploying with! That means MRI
|
25
|
+
raise "Please install and run the MadScience gem in the Ruby you'll be deploying with! That means MRI 2.0.0+!"
|
22
26
|
end
|
23
|
-
unless RUBY_VERSION[0..1] == "2."
|
24
|
-
raise "Please install Ruby version
|
27
|
+
unless RUBY_VERSION[0..1] == "2."
|
28
|
+
raise "Please install Ruby version 2.0.0+ for MadScience compatibility!"
|
25
29
|
end
|
26
30
|
|
27
|
-
# Require the MadScience gem, which will then be in $LOAD_PATH
|
28
31
|
require "madscience"
|
29
32
|
require "madscience/version"
|
30
33
|
|
@@ -39,53 +42,98 @@ Dir.chdir File.join(ms_path, "..")
|
|
39
42
|
require "bundler"
|
40
43
|
Bundler.setup
|
41
44
|
|
42
|
-
|
43
|
-
|
45
|
+
def check_superuser
|
46
|
+
raise "Must run as superuser!" unless Process.uid == 0
|
47
|
+
end
|
44
48
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
+
def get_sudo_user
|
50
|
+
raise "Can't find your $SUDO_USER!" unless ENV['SUDO_USER']
|
51
|
+
ENV['SUDO_USER']
|
52
|
+
end
|
53
|
+
|
54
|
+
def get_sudo_uid
|
55
|
+
raise "Can't find your $SUDO_UID!" unless ENV['SUDO_UID']
|
56
|
+
ENV['SUDO_UID'].to_i
|
57
|
+
end
|
58
|
+
|
59
|
+
def drop_sudo_privileges
|
60
|
+
Process.setuid get_sudo_id
|
61
|
+
end
|
62
|
+
|
63
|
+
def do_local_setup
|
64
|
+
system("librarian-chef", "install")
|
65
|
+
system("chef-solo", "-c", "solo.rb") or raise "Failed during chef run!"
|
66
|
+
end
|
67
|
+
|
68
|
+
def do_clone
|
69
|
+
# Clone the MadScience repo
|
70
|
+
# TODO: check out MadScience::VERSION branch when we start having stable releases
|
71
|
+
unless system "git clone #{MADSCIENCE_REPO_URL} madscience"
|
72
|
+
raise "Couldn't successfully clone MadScience repo from #{MADSCIENCE_REPO_URL}!"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def do_deploy
|
77
|
+
# Deploy from the 'madscience' dir under this directory
|
78
|
+
|
79
|
+
cmd = "cd madscience && vagrant up --provision --provider=#{MADSCIENCE_PROVIDER}"
|
80
|
+
|
81
|
+
# Does this display STDOUT properly?
|
82
|
+
pid = Kernel.spawn cmd
|
83
|
+
Process.wait pid # Wait for process to finish
|
84
|
+
|
85
|
+
unless $?.success?
|
86
|
+
raise "Deploy process failed with status #{$?.exitstatus}! Fix and/or re-run using 'vagrant provision'!"
|
49
87
|
end
|
88
|
+
|
89
|
+
puts <<-MESSAGE
|
90
|
+
You have successfully deployed the default Rails application in your repository (#{MADSCIENCE_REPO_URL}).
|
91
|
+
Congratulations! If this isn't your actual Rails application, go and modify madscience/nodes/all_nodes.json.erb.
|
92
|
+
You can find documentation in the RubyMadScience wiki:
|
93
|
+
https://github.com/noahgibbs/madscience/wiki
|
94
|
+
|
95
|
+
Have fun with RubyMadScience!
|
96
|
+
MESSAGE
|
97
|
+
end
|
98
|
+
|
99
|
+
# No subcommand takes arguments (yet?)
|
100
|
+
if ARGV.size > 1
|
101
|
+
raise "#{$0} #{ARGV[0]} takes no other arguments!"
|
102
|
+
end
|
103
|
+
|
104
|
+
if ARGV[0] == "setup"
|
50
105
|
# Now we'll use Chef to install the right version of Vagrant
|
51
106
|
# with the right plugin(s).
|
52
107
|
|
53
|
-
|
54
|
-
|
108
|
+
check_superuser
|
109
|
+
do_local_setup
|
55
110
|
exit 0 # Success!
|
56
111
|
end
|
57
112
|
|
58
113
|
if ARGV[0] == "clone"
|
59
|
-
|
60
|
-
puts "#{$0} clone takes no other arguments!"
|
61
|
-
exit -1
|
62
|
-
end
|
114
|
+
do_clone
|
63
115
|
|
64
|
-
|
65
|
-
|
116
|
+
puts "Successfully cloned repo into #{location} under this directory. Now customize nodes/all_nodes.json.erb!"
|
117
|
+
exit 0
|
118
|
+
end
|
66
119
|
|
67
|
-
|
68
|
-
|
120
|
+
if ARGV[0] == "setup_clone_and_deploy"
|
121
|
+
check_superuser
|
122
|
+
do_local_setup
|
69
123
|
|
70
|
-
|
71
|
-
# TODO: check out MadScience::VERSION branch when we start having real releases
|
72
|
-
cmd = "git clone #{MADSCIENCE_REPO_URL} #{location}"
|
124
|
+
drop_sudo_privileges
|
73
125
|
|
74
|
-
|
75
|
-
|
76
|
-
exit -1
|
77
|
-
end
|
126
|
+
do_clone
|
127
|
+
do_deploy
|
78
128
|
|
79
|
-
puts "Successfully cloned repo into #{location} under directory #{location}. Now
|
129
|
+
puts "Successfully cloned repo into #{location} under directory #{location}. Now customize nodes/all_nodes.json.erb!"
|
80
130
|
exit 0
|
81
131
|
end
|
82
132
|
|
83
133
|
if ARGV == []
|
84
|
-
puts "No command given."
|
85
134
|
puts USAGE_INFO
|
86
|
-
|
135
|
+
raise "No command given!"
|
87
136
|
end
|
88
137
|
|
89
|
-
puts "Unrecognized command: #{ARGV.inspect}!"
|
90
138
|
puts USAGE_INFO
|
91
|
-
|
139
|
+
raise "Unrecognized command: #{ARGV.inspect}!"
|
data/cookbooks/apt/CHANGELOG.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
apt Cookbook CHANGELOG
|
2
2
|
======================
|
3
|
-
|
3
|
+
|
4
|
+
v2.6.1 (2014-12-29)
|
5
|
+
-------------------
|
6
|
+
- Remove old preference files without .pref extension from previous versions
|
4
7
|
|
5
8
|
v2.6.0 (2014-09-09)
|
6
9
|
-------------------
|
data/cookbooks/apt/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
apt Cookbook
|
2
2
|
============
|
3
|
+
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/opscode-cookbooks/apt?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
3
4
|
[![Cookbook Version](http://img.shields.io/cookbook/v/apt.svg)][cookbook]
|
4
5
|
[![Build Status](http://img.shields.io/travis/opscode-cookbooks/apt.svg)][travis]
|
5
6
|
|
data/cookbooks/apt/metadata.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "apt",
|
3
|
-
"version": "2.6.
|
3
|
+
"version": "2.6.1",
|
4
4
|
"description": "Configures apt and apt services and LWRPs for managing apt repositories and preferences",
|
5
|
-
"long_description": "apt Cookbook\n============\n[![Cookbook Version](http://img.shields.io/cookbook/v/apt.svg)][cookbook]\n[![Build Status](http://img.shields.io/travis/opscode-cookbooks/apt.svg)][travis]\n\n[cookbook]: https://community.opscode.com/cookbooks/apt\n[travis]: http://travis-ci.org/opscode-cookbooks/apt\n\nThis cookbook includes recipes to execute apt-get update to ensure the local APT package cache is up to date. There are recipes for managing the apt-cacher-ng caching proxy and proxy clients. It also includes a LWRP for managing APT repositories in /etc/apt/sources.list.d as well as an LWRP for pinning packages via /etc/apt/preferences.d.\n\n\nRequirements\n------------\n**Version 2.0.0+ of this cookbook requires Chef 11.0.0 or later**. If your Chef version is earlier than 11.0.0, use version 1.10.0 of this cookbook.\n\nVersion 1.8.2 to 1.10.0 of this cookbook requires **Chef 10.16.4** or later.\n\nIf your Chef version is earlier than 10.16.4, use version 1.7.0 of this cookbook.\n\n### Platform\nPlease refer to the [TESTING file](TESTING.md) to see the currently (and passing) tested platforms. The release was tested on:\n\n* Ubuntu 10.04\n* Ubuntu 12.04\n* Ubuntu 13.04\n* Debian 7.1\n* Debian 6.0 (have with manual testing)\n\nMay work with or without modification on other Debian derivatives.\n\n\n-------\n### default\nThis recipe installs the `update-notifier-common` package to provide the timestamp file used to only run `apt-get update` if the cache is more than one day old.\n\nThis recipe should appear first in the run list of Debian or Ubuntu nodes to ensure that the package cache is up to date before managing any `package` resources with Chef.\n\nThis recipe also sets up a local cache directory for preseeding packages.\n\n**Including the default recipe on a node that does not support apt (such as Windows) results in a noop.**\n\n### cacher-client\nConfigures the node to use the `apt-cacher-ng` server as a client.\n\n#### Bypassing the cache\nOccasionally you may come across repositories that do not play nicely when the node is using an `apt-cacher-ng` server. You can configure `cacher-client` to bypass the server and connect directly to the repository with the `cache_bypass` attribute.\n\nTo do this, you need to override the `cache_bypass` attribute with an array of repositories, with each array key as the repository URL and value as the protocol to use:\n\n```json\n{\n ...,\n 'apt': {\n ...,\n 'cache_bypass': {\n URL: PROTOCOL\n }\n }\n}\n```\n\nFor example, to prevent caching and directly connect to the repository at `download.oracle.com` via http:\n\n```json\n{\n 'apt': {\n 'cache_bypass': {\n 'download.oracle.com': 'http'\n }\n }\n}\n```\n\n### cacher-ng\nInstalls the `apt-cacher-ng` package and service so the system can provide APT caching. You can check the usage report at http://{hostname}:3142/acng-report.html.\n\nIf you wish to help the `cacher-ng` recipe seed itself, you must now explicitly include the `cacher-client` recipe in your run list **after** `cacher-ng` or you will block your ability to install any packages (ie. `apt-cacher-ng`).\n\n\nAttributes\n----------\n* `['apt']['cacher_ipaddress']` - use a cacher server (or standard proxy server) not available via search\n* `['apt']['cacher_interface]` - interface to connect to the cacher-ng service, no default.\n* `['apt']['cacher_port']` - port for the cacher-ng service (either client or server), default is '3142'\n* `['apt']['cacher_dir']` - directory used by cacher-ng service, default is '/var/cache/apt-cacher-ng'\n* `['apt']['cacher-client']['restrict_environment']` - restrict your node to using the `apt-cacher-ng` server in your Environment, default is 'false'\n* `['apt']['compiletime']` - force the `cacher-client` recipe to run before other recipes. It forces apt to use the proxy before other recipes run. Useful if your nodes have limited access to public apt repositories. This is overridden if the `cacher-ng` recipe is in your run list. Default is 'false'\n* `['apt']['compile_time_update']` - force the default recipe to run `apt-get update` at compile time.\n* `['apt']['cache_bypass']` - array of URLs to bypass the cache. Accepts the URL and protocol to fetch directly from the remote repository and not attempt to cache\n* `['apt']['periodic_update_min_delay']` - minimum delay (in seconds) beetween two actual executions of `apt-get update` by the `execute[apt-get-update-periodic]` resource, default is '86400' (24 hours)\n\nLibraries\n---------\nThere is an `interface_ipaddress` method that returns the IP address for a particular host and interface, used by the `cacher-client` recipe. To enable it on the server use the `['apt']['cacher_interface']` attribute.\n\nResources/Providers\n-------------------\n### `apt_repository`\nThis LWRP provides an easy way to manage additional APT repositories. Adding a new repository will notify running the `execute[apt-get-update]` resource immediately.\n\n#### Actions\n- :add: creates a repository file and builds the repository listing (default)\n- :remove: removes the repository file\n\n#### Attribute Parameters\n- repo_name: name attribute. The name of the channel to discover\n- uri: the base of the Debian distribution\n- distribution: this is usually your release's codename...ie something like `karmic`, `lucid` or `maverick`\n- components: package groupings... when in doubt use `main`\n- arch: constrain package to a particular arch like `i386`, `amd64` or even `armhf` or `powerpc`. Defaults to nil.\n- trusted: treat all packages from this repository as authenticated regardless of signature\n- deb_src: whether or not to add the repository as a source repo as well - value can be `true` or `false`, default `false`.\n- keyserver: the GPG keyserver where the key for the repo should be retrieved\n- key: if a `keyserver` is provided, this is assumed to be the fingerprint, otherwise it can be either the URI to the GPG key for the repo, or a cookbook_file.\n- key_proxy: if set, pass the specified proxy via `http-proxy=` to GPG.\n- cookbook: if key should be a cookbook_file, specify a cookbook where the key is located for files/default. Defaults to nil, so it will use the cookbook where the resource is used.\n\n#### Examples\n\nAdd the Zenoss repo:\n\n```ruby\napt_repository 'zenoss' do\n uri 'http://dev.zenoss.org/deb'\n components ['main', 'stable']\nend\n```\n\nAdd the Nginx PPA, autodetect the key and repository url:\n\n```ruby\napt_repository 'nginx-php' do\n uri 'ppa:nginx/stable'\n distribution node['lsb']['codename']\nend\n```\n\nAdd the Nginx PPA, grab the key from the keyserver, and add source repo:\n\n```ruby\napt_repository 'nginx-php' do\n uri 'http://ppa.launchpad.net/nginx/php5/ubuntu'\n distribution node['lsb']['codename']\n components ['main']\n keyserver 'keyserver.ubuntu.com'\n key 'C300EE8C'\n deb_src true\nend\n```\n\nAdd the Cloudera Repo of CDH4 packages for Ubuntu 12.04 on AMD64:\n\n```ruby\napt_repository 'cloudera' do\n uri 'http://archive.cloudera.com/cdh4/ubuntu/precise/amd64/cdh'\n arch 'amd64'\n distribution 'precise-cdh4'\n components ['contrib']\n key 'http://archive.cloudera.com/debian/archive.key'\nend\n```\n\nRemove Zenoss repo:\n\n```ruby\napt_repository 'zenoss' do\n action :remove\nend\n```\n\n### `apt_preference`\nThis LWRP provides an easy way to pin packages in /etc/apt/preferences.d. Although apt-pinning is quite helpful from time to time please note that Debian does not encourage its use without thorough consideration.\n\nFurther information regarding apt-pinning is available via http://wiki.debian.org/AptPreferences.\n\n#### Actions\n- :add: creates a preferences file under /etc/apt/preferences.d\n- :remove: Removes the file, therefore unpin the package\n\n#### Attribute Parameters\n- package_name: name attribute. The name of the package\n- glob: Pin by glob() expression or regexp surrounded by /.\n- pin: The package version/repository to pin\n- pin_priority: The pinning priority aka \"the highest package version wins\"\n\n#### Examples\nPin libmysqlclient16 to version 5.1.49-3:\n\n```ruby\napt_preference 'libmysqlclient16' do\n pin 'version 5.1.49-3'\n pin_priority '700'\nend\n```\n\nUnpin libmysqlclient16:\n\n```ruby\napt_preference 'libmysqlclient16' do\n action :remove\nend\n```\n\nPin all packages from dotdeb.org:\n\n```ruby\napt_preference 'dotdeb' do\n glob '*'\n pin 'origin packages.dotdeb.org'\n pin_priority '700'\nend\n```\n\n\nUsage\n-----\nPut `recipe[apt]` first in the run list. If you have other recipes that you want to use to configure how apt behaves, like new sources, notify the execute resource to run, e.g.:\n\n```ruby\ntemplate '/etc/apt/sources.list.d/my_apt_sources.list' do\n notifies :run, 'execute[apt-get update]', :immediately\nend\n```\n\nThe above will run during execution phase since it is a normal template resource, and should appear before other package resources that need the sources in the template.\n\nPut `recipe[apt::cacher-ng]` in the run_list for a server to provide APT caching and add `recipe[apt::cacher-client]` on the rest of the Debian-based nodes to take advantage of the caching server.\n\nIf you want to cleanup unused packages, there is also the `apt-get autoclean` and `apt-get autoremove` resources provided for automated cleanup.\n\n\nLicense & Authors\n-----------------\n- Author:: Joshua Timberman (joshua@opscode.com)\n- Author:: Matt Ray (matt@opscode.com)\n- Author:: Seth Chisamore (schisamo@opscode.com)\n\n```text\nCopyright 2009-2013, Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n",
|
5
|
+
"long_description": "apt Cookbook\n============\n[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/opscode-cookbooks/apt?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n[![Cookbook Version](http://img.shields.io/cookbook/v/apt.svg)][cookbook]\n[![Build Status](http://img.shields.io/travis/opscode-cookbooks/apt.svg)][travis]\n\n[cookbook]: https://community.opscode.com/cookbooks/apt\n[travis]: http://travis-ci.org/opscode-cookbooks/apt\n\nThis cookbook includes recipes to execute apt-get update to ensure the local APT package cache is up to date. There are recipes for managing the apt-cacher-ng caching proxy and proxy clients. It also includes a LWRP for managing APT repositories in /etc/apt/sources.list.d as well as an LWRP for pinning packages via /etc/apt/preferences.d.\n\n\nRequirements\n------------\n**Version 2.0.0+ of this cookbook requires Chef 11.0.0 or later**. If your Chef version is earlier than 11.0.0, use version 1.10.0 of this cookbook.\n\nVersion 1.8.2 to 1.10.0 of this cookbook requires **Chef 10.16.4** or later.\n\nIf your Chef version is earlier than 10.16.4, use version 1.7.0 of this cookbook.\n\n### Platform\nPlease refer to the [TESTING file](TESTING.md) to see the currently (and passing) tested platforms. The release was tested on:\n\n* Ubuntu 10.04\n* Ubuntu 12.04\n* Ubuntu 13.04\n* Debian 7.1\n* Debian 6.0 (have with manual testing)\n\nMay work with or without modification on other Debian derivatives.\n\n\n-------\n### default\nThis recipe installs the `update-notifier-common` package to provide the timestamp file used to only run `apt-get update` if the cache is more than one day old.\n\nThis recipe should appear first in the run list of Debian or Ubuntu nodes to ensure that the package cache is up to date before managing any `package` resources with Chef.\n\nThis recipe also sets up a local cache directory for preseeding packages.\n\n**Including the default recipe on a node that does not support apt (such as Windows) results in a noop.**\n\n### cacher-client\nConfigures the node to use the `apt-cacher-ng` server as a client.\n\n#### Bypassing the cache\nOccasionally you may come across repositories that do not play nicely when the node is using an `apt-cacher-ng` server. You can configure `cacher-client` to bypass the server and connect directly to the repository with the `cache_bypass` attribute.\n\nTo do this, you need to override the `cache_bypass` attribute with an array of repositories, with each array key as the repository URL and value as the protocol to use:\n\n```json\n{\n ...,\n 'apt': {\n ...,\n 'cache_bypass': {\n URL: PROTOCOL\n }\n }\n}\n```\n\nFor example, to prevent caching and directly connect to the repository at `download.oracle.com` via http:\n\n```json\n{\n 'apt': {\n 'cache_bypass': {\n 'download.oracle.com': 'http'\n }\n }\n}\n```\n\n### cacher-ng\nInstalls the `apt-cacher-ng` package and service so the system can provide APT caching. You can check the usage report at http://{hostname}:3142/acng-report.html.\n\nIf you wish to help the `cacher-ng` recipe seed itself, you must now explicitly include the `cacher-client` recipe in your run list **after** `cacher-ng` or you will block your ability to install any packages (ie. `apt-cacher-ng`).\n\n\nAttributes\n----------\n* `['apt']['cacher_ipaddress']` - use a cacher server (or standard proxy server) not available via search\n* `['apt']['cacher_interface]` - interface to connect to the cacher-ng service, no default.\n* `['apt']['cacher_port']` - port for the cacher-ng service (either client or server), default is '3142'\n* `['apt']['cacher_dir']` - directory used by cacher-ng service, default is '/var/cache/apt-cacher-ng'\n* `['apt']['cacher-client']['restrict_environment']` - restrict your node to using the `apt-cacher-ng` server in your Environment, default is 'false'\n* `['apt']['compiletime']` - force the `cacher-client` recipe to run before other recipes. It forces apt to use the proxy before other recipes run. Useful if your nodes have limited access to public apt repositories. This is overridden if the `cacher-ng` recipe is in your run list. Default is 'false'\n* `['apt']['compile_time_update']` - force the default recipe to run `apt-get update` at compile time.\n* `['apt']['cache_bypass']` - array of URLs to bypass the cache. Accepts the URL and protocol to fetch directly from the remote repository and not attempt to cache\n* `['apt']['periodic_update_min_delay']` - minimum delay (in seconds) beetween two actual executions of `apt-get update` by the `execute[apt-get-update-periodic]` resource, default is '86400' (24 hours)\n\nLibraries\n---------\nThere is an `interface_ipaddress` method that returns the IP address for a particular host and interface, used by the `cacher-client` recipe. To enable it on the server use the `['apt']['cacher_interface']` attribute.\n\nResources/Providers\n-------------------\n### `apt_repository`\nThis LWRP provides an easy way to manage additional APT repositories. Adding a new repository will notify running the `execute[apt-get-update]` resource immediately.\n\n#### Actions\n- :add: creates a repository file and builds the repository listing (default)\n- :remove: removes the repository file\n\n#### Attribute Parameters\n- repo_name: name attribute. The name of the channel to discover\n- uri: the base of the Debian distribution\n- distribution: this is usually your release's codename...ie something like `karmic`, `lucid` or `maverick`\n- components: package groupings... when in doubt use `main`\n- arch: constrain package to a particular arch like `i386`, `amd64` or even `armhf` or `powerpc`. Defaults to nil.\n- trusted: treat all packages from this repository as authenticated regardless of signature\n- deb_src: whether or not to add the repository as a source repo as well - value can be `true` or `false`, default `false`.\n- keyserver: the GPG keyserver where the key for the repo should be retrieved\n- key: if a `keyserver` is provided, this is assumed to be the fingerprint, otherwise it can be either the URI to the GPG key for the repo, or a cookbook_file.\n- key_proxy: if set, pass the specified proxy via `http-proxy=` to GPG.\n- cookbook: if key should be a cookbook_file, specify a cookbook where the key is located for files/default. Defaults to nil, so it will use the cookbook where the resource is used.\n\n#### Examples\n\nAdd the Zenoss repo:\n\n```ruby\napt_repository 'zenoss' do\n uri 'http://dev.zenoss.org/deb'\n components ['main', 'stable']\nend\n```\n\nAdd the Nginx PPA, autodetect the key and repository url:\n\n```ruby\napt_repository 'nginx-php' do\n uri 'ppa:nginx/stable'\n distribution node['lsb']['codename']\nend\n```\n\nAdd the Nginx PPA, grab the key from the keyserver, and add source repo:\n\n```ruby\napt_repository 'nginx-php' do\n uri 'http://ppa.launchpad.net/nginx/php5/ubuntu'\n distribution node['lsb']['codename']\n components ['main']\n keyserver 'keyserver.ubuntu.com'\n key 'C300EE8C'\n deb_src true\nend\n```\n\nAdd the Cloudera Repo of CDH4 packages for Ubuntu 12.04 on AMD64:\n\n```ruby\napt_repository 'cloudera' do\n uri 'http://archive.cloudera.com/cdh4/ubuntu/precise/amd64/cdh'\n arch 'amd64'\n distribution 'precise-cdh4'\n components ['contrib']\n key 'http://archive.cloudera.com/debian/archive.key'\nend\n```\n\nRemove Zenoss repo:\n\n```ruby\napt_repository 'zenoss' do\n action :remove\nend\n```\n\n### `apt_preference`\nThis LWRP provides an easy way to pin packages in /etc/apt/preferences.d. Although apt-pinning is quite helpful from time to time please note that Debian does not encourage its use without thorough consideration.\n\nFurther information regarding apt-pinning is available via http://wiki.debian.org/AptPreferences.\n\n#### Actions\n- :add: creates a preferences file under /etc/apt/preferences.d\n- :remove: Removes the file, therefore unpin the package\n\n#### Attribute Parameters\n- package_name: name attribute. The name of the package\n- glob: Pin by glob() expression or regexp surrounded by /.\n- pin: The package version/repository to pin\n- pin_priority: The pinning priority aka \"the highest package version wins\"\n\n#### Examples\nPin libmysqlclient16 to version 5.1.49-3:\n\n```ruby\napt_preference 'libmysqlclient16' do\n pin 'version 5.1.49-3'\n pin_priority '700'\nend\n```\n\nUnpin libmysqlclient16:\n\n```ruby\napt_preference 'libmysqlclient16' do\n action :remove\nend\n```\n\nPin all packages from dotdeb.org:\n\n```ruby\napt_preference 'dotdeb' do\n glob '*'\n pin 'origin packages.dotdeb.org'\n pin_priority '700'\nend\n```\n\n\nUsage\n-----\nPut `recipe[apt]` first in the run list. If you have other recipes that you want to use to configure how apt behaves, like new sources, notify the execute resource to run, e.g.:\n\n```ruby\ntemplate '/etc/apt/sources.list.d/my_apt_sources.list' do\n notifies :run, 'execute[apt-get update]', :immediately\nend\n```\n\nThe above will run during execution phase since it is a normal template resource, and should appear before other package resources that need the sources in the template.\n\nPut `recipe[apt::cacher-ng]` in the run_list for a server to provide APT caching and add `recipe[apt::cacher-client]` on the rest of the Debian-based nodes to take advantage of the caching server.\n\nIf you want to cleanup unused packages, there is also the `apt-get autoclean` and `apt-get autoremove` resources provided for automated cleanup.\n\n\nLicense & Authors\n-----------------\n- Author:: Joshua Timberman (joshua@opscode.com)\n- Author:: Matt Ray (matt@opscode.com)\n- Author:: Seth Chisamore (schisamo@opscode.com)\n\n```text\nCopyright 2009-2013, Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n",
|
6
6
|
"maintainer": "Chef Software, Inc.",
|
7
7
|
"maintainer_email": "cookbooks@opscode.com",
|
8
8
|
"license": "Apache 2.0",
|
@@ -39,7 +39,14 @@ action :add do
|
|
39
39
|
action :nothing
|
40
40
|
end
|
41
41
|
|
42
|
-
|
42
|
+
preference_old_file = file "/etc/apt/preferences.d/#{new_resource.name}" do
|
43
|
+
action :nothing
|
44
|
+
if ::File.exists?("/etc/apt/preferences.d/#{new_resource.name}")
|
45
|
+
Chef::Log.warn "Replacing #{new_resource.name} with #{new_resource.name}.pref in /etc/apt/preferences.d/"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
preference_file = file "/etc/apt/preferences.d/#{new_resource.name}.pref" do
|
43
50
|
owner 'root'
|
44
51
|
group 'root'
|
45
52
|
mode 00644
|
@@ -50,6 +57,8 @@ action :add do
|
|
50
57
|
preference_dir.run_action(:create)
|
51
58
|
# write out the preference file, replace it if it already exists
|
52
59
|
preference_file.run_action(:create)
|
60
|
+
# remove preference files from previous apt cookbook version
|
61
|
+
preference_old_file.run_action(:delete)
|
53
62
|
end
|
54
63
|
|
55
64
|
action :remove do
|
data/cookbooks/vagrant/Berksfile
CHANGED
data/cookbooks/vagrant/README.md
CHANGED
@@ -1,42 +1,41 @@
|
|
1
|
-
vagrant Cookbook
|
2
|
-
================
|
1
|
+
# vagrant Cookbook
|
3
2
|
|
4
|
-
Installs Vagrant 1.6+ and manages vagrant plugins w/ a custom
|
5
|
-
resource.
|
3
|
+
Installs Vagrant 1.6+ and manages vagrant plugins w/ a custom resource.
|
6
4
|
|
7
5
|
* Vagrant: http://www.vagrantup.com/
|
8
6
|
|
9
|
-
This cookbook is not intended to be used for vagrant "1.0" (gem
|
10
|
-
install) versions. A recipe is provided for removing the gem, see __Recipes__.
|
7
|
+
This cookbook is not intended to be used for vagrant "1.0" (gem install) versions. A recipe is provided for removing the gem, see __Recipes__.
|
11
8
|
|
12
9
|
This cookbook is not supported for installing versions of Vagrant older than 1.6.
|
13
10
|
|
14
|
-
Requirements
|
15
|
-
------------
|
11
|
+
# Requirements
|
16
12
|
|
17
13
|
Tested with Test Kitchen:
|
18
14
|
|
19
15
|
* Debian 7.6
|
20
16
|
* Ubuntu 14.04
|
21
17
|
* CentOS 6.5
|
18
|
+
* OS X 10.9
|
22
19
|
|
23
20
|
May work on other Debian/RHEL family distributions with or without modification.
|
24
21
|
|
25
|
-
Support exists for Windows
|
22
|
+
Support exists for Windows but this has not yet been added to test-kitchen. OS X support is in test-kitchen, but requires a custom box be created.
|
26
23
|
|
27
24
|
The URL and Checksum attributes must be set, see __Attributes__
|
28
25
|
|
29
26
|
Because Vagrant is installed as a native system package, Chef must run as a privileged user (e.g., root).
|
30
27
|
|
31
|
-
Attributes
|
32
|
-
==========
|
28
|
+
# Attributes
|
33
29
|
|
34
|
-
The following attributes *must* be set.
|
30
|
+
The following attributes *must* be set. The cookbook has helper methods in `libraries` that attempt to automatically discover these values.
|
35
31
|
|
32
|
+
* `node['vagrant']['version']` - Version of Vagrant to use, default is 1.6.5, which was current at the time of writing.
|
36
33
|
* `node['vagrant']['url']` - URL to the Vagrant installation package.
|
37
34
|
* `node['vagrant']['checksum']` - SHA256 checksum of the Vagrant
|
38
35
|
installation package.
|
39
36
|
|
37
|
+
**Note**: I'm not taking pull requests to merely update the version. Change it in your local setup via role, environment, wrapper cookbook, etc. The helpers should take care of the rest. If a new version of vagrant requires other changes, then open an issue.
|
38
|
+
|
40
39
|
If the node is Windows, the MSI version must be set. This is used by
|
41
40
|
the `windows_package` resource to determine if the package is
|
42
41
|
installed.
|
@@ -44,17 +43,17 @@ installed.
|
|
44
43
|
* `node['vagrant']['msi_version']` - Version string of the installed
|
45
44
|
MSI "package" on Windows.
|
46
45
|
|
47
|
-
The following
|
46
|
+
The following attributes are optional.
|
48
47
|
|
49
|
-
* `node['vagrant']['plugins']` -
|
48
|
+
* `node['vagrant']['plugins']` - A array of plugins. The elements in
|
50
49
|
the array can be a string or a hash. String elements should be the
|
51
50
|
names of plugins to install. Hash elements should have two keys,
|
52
51
|
"name" and "version", for the plugin name and its version to
|
53
52
|
install. This is used by the `vagrant_plugin` resource in the
|
54
|
-
|
53
|
+
`install_plugins` recipe.
|
54
|
+
* `node['vagrant']['user']` - A user that is used to automatically install plugins as for the `node['vagrant']['plugins']` attribute.
|
55
55
|
|
56
|
-
Resources
|
57
|
-
=========
|
56
|
+
# Resources
|
58
57
|
|
59
58
|
This cookbook includes the `vagrant_plugin` resource, for managing
|
60
59
|
vagrant plugins.
|
@@ -73,6 +72,9 @@ vagrant plugins.
|
|
73
72
|
"vagrant-omnibus".
|
74
73
|
- `:version`: version of the plugin to installed, must be specified as
|
75
74
|
a string, e.g., "1.0.2"
|
75
|
+
- `:user`: a user to run plugin installation as. Usually this is for single user systems (like workstations).
|
76
|
+
- `:sources`: alternate locations to search for plugins. This would commonly
|
77
|
+
be used if you are hosting your vagrant plugins in a custom gem repo
|
76
78
|
|
77
79
|
### Examples
|
78
80
|
|
@@ -80,17 +82,24 @@ vagrant plugins.
|
|
80
82
|
|
81
83
|
vagrant_plugin "vagrant-berkshelf"
|
82
84
|
version "1.2.0"
|
85
|
+
sources ["http://src1.example.com", "http://src2.example.com"]
|
86
|
+
end
|
87
|
+
|
88
|
+
# Install the plugins as the `donuts` user, into ~donuts/.vagrant.d
|
89
|
+
vagrant_plugin "vagrant-aws"
|
90
|
+
user "donuts"
|
83
91
|
end
|
84
92
|
|
85
|
-
Recipes
|
86
|
-
=======
|
93
|
+
# Recipes
|
87
94
|
|
88
95
|
## default
|
89
96
|
|
90
97
|
The default recipe includes the platform-family specific recipe to
|
91
|
-
install Vagrant.
|
92
|
-
|
93
|
-
|
98
|
+
install Vagrant. If the `node['vagrant']['plugins']` attribute is not empty, it includes the install_plugins recipe to install any required vagrant plugins.
|
99
|
+
|
100
|
+
## install_plugins
|
101
|
+
|
102
|
+
Iterates over the `node['vagrant']['plugins']` attribute and installs the listed plugins. If that attribute is a hash, it uses the version. If the `node['vagrant']['user']` attribute is set, the plugins are installed for only that user.
|
94
103
|
|
95
104
|
## debian, fedora, mac_os_x, rhel, windows
|
96
105
|
|
@@ -109,11 +118,10 @@ running `rbenv rehash`. Likewise, if you have multiple copies of the
|
|
109
118
|
vagrant gem installed, you'll need to clean up all versions. This
|
110
119
|
recipe won't support such craziness :-).
|
111
120
|
|
112
|
-
Usage
|
113
|
-
=====
|
121
|
+
# Usage
|
114
122
|
|
115
123
|
Set the url and checksum attributes on the node. Do this in a role, or
|
116
|
-
a "wrapper" cookbook.
|
124
|
+
a "wrapper" cookbook. Or, just set the version and let the magic happen.
|
117
125
|
|
118
126
|
Then include the default recipe on the node's run list.
|
119
127
|
|
@@ -129,12 +137,12 @@ of the `vagrant-berkshelf` plugin:
|
|
129
137
|
|
130
138
|
See the attribute description above.
|
131
139
|
|
132
|
-
License and Authors
|
133
|
-
-------------------
|
140
|
+
# License and Authors
|
134
141
|
|
135
142
|
* Author:: Joshua Timberman <opensource@housepub.org>
|
136
143
|
* Copyright (c) 2013-2014, Joshua Timberman
|
137
144
|
|
145
|
+
```
|
138
146
|
Licensed under the Apache License, Version 2.0 (the "License");
|
139
147
|
you may not use this file except in compliance with the License.
|
140
148
|
You may obtain a copy of the License at
|
@@ -146,3 +154,4 @@ distributed under the License is distributed on an "AS IS" BASIS,
|
|
146
154
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
147
155
|
See the License for the specific language governing permissions and
|
148
156
|
limitations under the License.
|
157
|
+
```
|
@@ -20,4 +20,5 @@ default['vagrant']['version'] = '1.6.5'
|
|
20
20
|
default['vagrant']['url'] = vagrant_package_uri(node['vagrant']['version'])
|
21
21
|
default['vagrant']['checksum'] = vagrant_sha256sum(node['vagrant']['version'])
|
22
22
|
default['vagrant']['plugins'] = []
|
23
|
+
default['vagrant']['user'] = nil
|
23
24
|
default['vagrant']['msi_version'] = ''
|