vagabond 0.2.6 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/Vagrantfile +34 -0
- data/lib/vagabond/cookbooks/apt/Berksfile +8 -0
- data/lib/vagabond/cookbooks/apt/CHANGELOG.md +97 -0
- data/lib/vagabond/cookbooks/apt/CONTRIBUTING +29 -0
- data/lib/vagabond/cookbooks/apt/LICENSE +201 -0
- data/lib/vagabond/cookbooks/apt/README.md +243 -0
- data/lib/vagabond/cookbooks/apt/TESTING.md +25 -0
- data/lib/vagabond/cookbooks/apt/attributes/default.rb +4 -0
- data/lib/vagabond/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
- data/lib/vagabond/cookbooks/apt/metadata.rb +30 -0
- data/lib/vagabond/cookbooks/apt/providers/preference.rb +61 -0
- data/lib/vagabond/cookbooks/apt/providers/repository.rb +132 -0
- data/lib/vagabond/cookbooks/apt/recipes/cacher-client.rb +59 -0
- data/lib/vagabond/cookbooks/apt/recipes/cacher-ng.rb +40 -0
- data/lib/vagabond/cookbooks/apt/recipes/default.rb +68 -0
- data/lib/vagabond/cookbooks/apt/resources/preference.rb +30 -0
- data/lib/vagabond/cookbooks/apt/resources/repository.rb +40 -0
- data/lib/vagabond/cookbooks/apt/templates/debian-6.0/acng.conf.erb +174 -0
- data/lib/vagabond/cookbooks/apt/templates/default/01proxy.erb +2 -0
- data/lib/vagabond/cookbooks/apt/templates/default/acng.conf.erb +276 -0
- data/lib/vagabond/cookbooks/apt/templates/ubuntu-10.04/acng.conf.erb +270 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/README.md +1 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/files/default/tests/minitest/cacher-ng_test.rb +28 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/files/default/tests/minitest/default_test.rb +28 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/files/default/tests/minitest/lwrps_test.rb +48 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/files/default/tests/minitest/support/helpers.rb +29 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/metadata.rb +6 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/recipes/cacher-ng.rb +20 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/recipes/default.rb +20 -0
- data/lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/recipes/lwrps.rb +66 -0
- data/lib/vagabond/cookbooks/vagabond/metadata.rb +1 -0
- data/lib/vagabond/cookbooks/vagabond/recipes/default.rb +9 -0
- data/lib/vagabond/vagabond.rb +5 -1
- data/lib/vagabond/version.rb +1 -1
- data/test/Vagrantfile +48 -0
- data/vagabond-0.2.6.gem +0 -0
- data/vagabond.gemspec +1 -1
- metadata +36 -4
@@ -0,0 +1,66 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: apt_test
|
3
|
+
# Recipe:: lwrps
|
4
|
+
#
|
5
|
+
# Copyright 2012, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
include_recipe "apt"
|
21
|
+
|
22
|
+
# Apt Repository
|
23
|
+
apt_repository "opscode" do
|
24
|
+
uri "http://apt.opscode.com"
|
25
|
+
components ["main"]
|
26
|
+
distribution "#{node['lsb']['codename']}-0.10"
|
27
|
+
key "2940ABA983EF826A"
|
28
|
+
keyserver "pgpkeys.mit.edu"
|
29
|
+
action :add
|
30
|
+
end
|
31
|
+
|
32
|
+
# Apt Repository with arch
|
33
|
+
apt_repository "cloudera" do
|
34
|
+
uri "http://archive.cloudera.com/cdh4/ubuntu/precise/amd64/cdh"
|
35
|
+
arch "amd64"
|
36
|
+
distribution "precise-cdh4"
|
37
|
+
components ["contrib"]
|
38
|
+
key "http://archive.cloudera.com/debian/archive.key"
|
39
|
+
action :add
|
40
|
+
end
|
41
|
+
|
42
|
+
# Apt repository and install a package it contains
|
43
|
+
apt_repository "nginx" do
|
44
|
+
uri "http://nginx.org/packages/ubuntu"
|
45
|
+
distribution node['lsb']['codename']
|
46
|
+
components ["nginx"]
|
47
|
+
key "http://nginx.org/keys/nginx_signing.key"
|
48
|
+
deb_src true
|
49
|
+
end
|
50
|
+
|
51
|
+
package "nginx-debug" do
|
52
|
+
action :upgrade
|
53
|
+
end
|
54
|
+
|
55
|
+
# Apt Preferences
|
56
|
+
apt_preference "chef" do
|
57
|
+
pin "version 10.16.2-1"
|
58
|
+
pin_priority "700"
|
59
|
+
end
|
60
|
+
|
61
|
+
# COOK-2338
|
62
|
+
apt_preference "dotdeb" do
|
63
|
+
glob "*"
|
64
|
+
pin "origin packages.dotdeb.org "
|
65
|
+
pin_priority "700"
|
66
|
+
end
|
@@ -33,6 +33,7 @@ unless(node[:network][:interfaces][:lxcbr0])
|
|
33
33
|
end
|
34
34
|
=end
|
35
35
|
|
36
|
+
include_recipe 'apt::cacher-ng'
|
36
37
|
include_recipe 'lxc'
|
37
38
|
|
38
39
|
ruby_block 'LXC template: lxc-centos' do
|
@@ -66,6 +67,8 @@ node[:vagabond][:bases].each do |name, options|
|
|
66
67
|
]
|
67
68
|
if(!options[:template].scan(%r{debian|ubuntu}).empty?)
|
68
69
|
pkg_man = 'apt-get'
|
70
|
+
proxy = ["echo \"Acquire::http::Proxy \\\"http://#{node[:lxc][:addr]}:#{node[:apt][:cacher_port]}\\\";\" > /etc/apt/apt.conf.d/01proxy"]
|
71
|
+
proxy << "echo \"Acquire::https::Proxy \\\"DIRECT\\\";\" >> /etc/apt/apt.conf.d/01proxy"
|
69
72
|
elsif(!options[:template].scan(%r{fedora|centos}).empty?)
|
70
73
|
pkg_man = 'yum'
|
71
74
|
end
|
@@ -76,6 +79,7 @@ node[:vagabond][:bases].each do |name, options|
|
|
76
79
|
else
|
77
80
|
pkg_coms = []
|
78
81
|
end
|
82
|
+
pkg_coms = proxy + pkg_coms if proxy
|
79
83
|
|
80
84
|
lxc_container name do
|
81
85
|
template options[:template]
|
@@ -83,6 +87,8 @@ node[:vagabond][:bases].each do |name, options|
|
|
83
87
|
default_config false if options[:memory]
|
84
88
|
create_environment options[:environment] if options[:environment]
|
85
89
|
initialize_commands [
|
90
|
+
'locale-gen en_US.UTF-8',
|
91
|
+
'update-locale LANG="en_US.UTF-8"',
|
86
92
|
'rm -f /etc/sysctl.d/10-console-messages.conf',
|
87
93
|
'rm -f /etc/sysctl.d/10-ptrace.conf',
|
88
94
|
'rm -f /etc/sysctl.d/10-kernel-hardening.conf'
|
@@ -92,6 +98,8 @@ node[:vagabond][:bases].each do |name, options|
|
|
92
98
|
end
|
93
99
|
end
|
94
100
|
|
101
|
+
=begin
|
102
|
+
# TODO: This will be the base for building ephemeral servers
|
95
103
|
lxc_container 'chef-server' do
|
96
104
|
clone 'ubuntu_1204'
|
97
105
|
initialize_commands [
|
@@ -101,6 +109,7 @@ lxc_container 'chef-server' do
|
|
101
109
|
node[:vagabond][:server_base]
|
102
110
|
end
|
103
111
|
end
|
112
|
+
=end
|
104
113
|
|
105
114
|
node[:vagabond][:customs].each do |name, options|
|
106
115
|
|
data/lib/vagabond/vagabond.rb
CHANGED
@@ -159,10 +159,14 @@ module Vagabond
|
|
159
159
|
def load_configurations
|
160
160
|
@vagabondfile = Vagabondfile.new(options[:vagabond_file], :allow_missing)
|
161
161
|
options[:sudo] = sudo
|
162
|
-
|
162
|
+
# TODO: provide action call back for full or partial solo disable
|
163
|
+
if((@action.to_s == 'status' && lxc_installed?) || @action.to_s == 'init')
|
164
|
+
options[:disable_solo] = true
|
165
|
+
end
|
163
166
|
Chef::Log.init('/dev/null') unless options[:debug]
|
164
167
|
Lxc.use_sudo = @vagabondfile[:sudo].nil? ? true : @vagabondfile[:sudo]
|
165
168
|
@internal_config = InternalConfiguration.new(@vagabondfile, ui, options)
|
169
|
+
options[:disable_solo] = false if @action.to_s == 'init'
|
166
170
|
@config = @vagabondfile[:boxes][name]
|
167
171
|
@lxc = Lxc.new(@internal_config[mappings_key][name] || '____nonreal____')
|
168
172
|
if(options[:local_server] && lxc_installed?)
|
data/lib/vagabond/version.rb
CHANGED
data/test/Vagrantfile
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
Vagrant.configure("2") do |config|
|
5
|
+
config.vm.hostname = "sensu-lxc-host"
|
6
|
+
config.vm.box = 'precise-64-lxc-preseed'
|
7
|
+
config.vm.box_url = 'http://vagrant.hw-ops.com/precise-64-lxc-preseed.box'
|
8
|
+
|
9
|
+
if(ENV['ENABLE_APT_PROXY'])
|
10
|
+
proxy = [
|
11
|
+
"echo \"Acquire::http::Proxy \\\"http://#{ENV['ENABLE_APT_PROXY']}:3142\\\";\" > /etc/apt/apt.conf.d/01proxy",
|
12
|
+
"echo \"Acquire::https::Proxy \\\"DIRECT\\\";\" >> /etc/apt/apt.conf.d/01proxy"
|
13
|
+
]
|
14
|
+
else
|
15
|
+
proxy = []
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
config.vm.provision :shell do |shell|
|
20
|
+
shell.inline = (
|
21
|
+
proxy + [
|
22
|
+
"lxc-destroy -n ubuntu_1204",
|
23
|
+
"apt-get update",
|
24
|
+
"apt-get install -y -q ruby1.9.1-full git",
|
25
|
+
"gem install --no-ri --no-rdoc bundler",
|
26
|
+
"git clone git://github.com/chrisroberts/vagabond-test-cookbook.git",
|
27
|
+
"cd vagabond-test-repo",
|
28
|
+
"bundle install --binstubs",
|
29
|
+
"bin/vagabond kitchen test --debug",
|
30
|
+
"bin/vagabond kitchen test --cluster cacher --debug",
|
31
|
+
"cd ..",
|
32
|
+
"git clone git://github.com/chrisroberts/vagabond-test-repo.git",
|
33
|
+
"cd vagabond-test-repo",
|
34
|
+
"bundle install --binstubs",
|
35
|
+
"bin/vagabond up test_node --debug",
|
36
|
+
"bin/vagabond cluster test_cluster --debug",
|
37
|
+
"bin/vagabond cluster test_cluster --parallel --debug",
|
38
|
+
"bin/vagabond destroy test_cluster --cluster --debug",
|
39
|
+
"bin/vagabond server destroy --debug"
|
40
|
+
]
|
41
|
+
).join("\n")
|
42
|
+
end
|
43
|
+
|
44
|
+
config.vm.provider :virtualbox do |vb|
|
45
|
+
vb.customize ["modifyvm", :id, "--cpus", "2"]
|
46
|
+
vb.customize ["modifyvm", :id, "--memory", "2048"]
|
47
|
+
end
|
48
|
+
end
|
data/vagabond-0.2.6.gem
ADDED
Binary file
|
data/vagabond.gemspec
CHANGED
@@ -19,6 +19,6 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.add_dependency 'test-kitchen', '>= 1.0.0.alpha'
|
20
20
|
s.add_dependency 'thor'
|
21
21
|
s.add_dependency 'uuidtools'
|
22
|
-
s.add_dependency 'elecksee', '>= 1.0.
|
22
|
+
s.add_dependency 'elecksee', '>= 1.0.6'
|
23
23
|
s.add_dependency 'serverspec', '>= 0.6.3'
|
24
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagabond
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - ! '>='
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 1.0.
|
101
|
+
version: 1.0.6
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -106,7 +106,7 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 1.0.
|
109
|
+
version: 1.0.6
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
111
|
name: serverspec
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
@@ -173,6 +173,35 @@ files:
|
|
173
173
|
- lib/vagabond/cookbooks/vagabond/libraries/vagabond.rb
|
174
174
|
- lib/vagabond/cookbooks/vagabond/recipes/default.rb
|
175
175
|
- lib/vagabond/cookbooks/vagabond/recipes/zero.rb
|
176
|
+
- lib/vagabond/cookbooks/apt/files/default/apt-proxy-v2.conf
|
177
|
+
- lib/vagabond/cookbooks/apt/metadata.rb
|
178
|
+
- lib/vagabond/cookbooks/apt/templates/default/01proxy.erb
|
179
|
+
- lib/vagabond/cookbooks/apt/templates/default/acng.conf.erb
|
180
|
+
- lib/vagabond/cookbooks/apt/templates/debian-6.0/acng.conf.erb
|
181
|
+
- lib/vagabond/cookbooks/apt/templates/ubuntu-10.04/acng.conf.erb
|
182
|
+
- lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/files/default/tests/minitest/cacher-ng_test.rb
|
183
|
+
- lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/files/default/tests/minitest/lwrps_test.rb
|
184
|
+
- lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/files/default/tests/minitest/default_test.rb
|
185
|
+
- lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/files/default/tests/minitest/support/helpers.rb
|
186
|
+
- lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/metadata.rb
|
187
|
+
- lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/README.md
|
188
|
+
- lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/recipes/default.rb
|
189
|
+
- lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/recipes/cacher-ng.rb
|
190
|
+
- lib/vagabond/cookbooks/apt/test/cookbooks/apt_test/recipes/lwrps.rb
|
191
|
+
- lib/vagabond/cookbooks/apt/Berksfile
|
192
|
+
- lib/vagabond/cookbooks/apt/attributes/default.rb
|
193
|
+
- lib/vagabond/cookbooks/apt/README.md
|
194
|
+
- lib/vagabond/cookbooks/apt/LICENSE
|
195
|
+
- lib/vagabond/cookbooks/apt/CONTRIBUTING
|
196
|
+
- lib/vagabond/cookbooks/apt/providers/repository.rb
|
197
|
+
- lib/vagabond/cookbooks/apt/providers/preference.rb
|
198
|
+
- lib/vagabond/cookbooks/apt/TESTING.md
|
199
|
+
- lib/vagabond/cookbooks/apt/resources/repository.rb
|
200
|
+
- lib/vagabond/cookbooks/apt/resources/preference.rb
|
201
|
+
- lib/vagabond/cookbooks/apt/CHANGELOG.md
|
202
|
+
- lib/vagabond/cookbooks/apt/recipes/default.rb
|
203
|
+
- lib/vagabond/cookbooks/apt/recipes/cacher-ng.rb
|
204
|
+
- lib/vagabond/cookbooks/apt/recipes/cacher-client.rb
|
176
205
|
- lib/vagabond/errors.rb
|
177
206
|
- lib/vagabond/server.rb
|
178
207
|
- lib/vagabond/kitchen.rb
|
@@ -206,9 +235,12 @@ files:
|
|
206
235
|
- lib/vagabond/actions/ssh.rb
|
207
236
|
- lib/vagabond/uploader.rb
|
208
237
|
- lib/vagabond.rb
|
238
|
+
- test/Vagrantfile
|
239
|
+
- vagabond-0.2.6.gem
|
209
240
|
- README.md
|
210
241
|
- LICENSE
|
211
242
|
- vagabond.gemspec
|
243
|
+
- Vagrantfile
|
212
244
|
- bin/vagabond
|
213
245
|
- USAGE.md
|
214
246
|
- CHANGELOG.md
|