elzar 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.chef/knife.rb +3 -0
- data/.gitignore +1 -0
- data/.rvmrc +1 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +96 -0
- data/README.md +42 -0
- data/Rakefile +1 -0
- data/Vagrantfile +16 -0
- data/cookbooks/.gitkeep +0 -0
- data/cookbooks/apt/README.md +122 -0
- data/cookbooks/apt/files/default/apt-cacher +9 -0
- data/cookbooks/apt/files/default/apt-cacher.conf +144 -0
- data/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
- data/cookbooks/apt/metadata.rb +13 -0
- data/cookbooks/apt/providers/repository.rb +73 -0
- data/cookbooks/apt/recipes/cacher-client.rb +44 -0
- data/cookbooks/apt/recipes/cacher.rb +45 -0
- data/cookbooks/apt/recipes/default.rb +50 -0
- data/cookbooks/apt/resources/repository.rb +30 -0
- data/cookbooks/build-essential/README.md +24 -0
- data/cookbooks/build-essential/metadata.rb +10 -0
- data/cookbooks/build-essential/recipes/default.rb +45 -0
- data/cookbooks/database/README.md +403 -0
- data/cookbooks/database/libraries/provider_database_mysql.rb +97 -0
- data/cookbooks/database/libraries/provider_database_mysql_user.rb +76 -0
- data/cookbooks/database/libraries/provider_database_postgresql.rb +126 -0
- data/cookbooks/database/libraries/provider_database_postgresql_user.rb +78 -0
- data/cookbooks/database/libraries/provider_database_sql_server.rb +109 -0
- data/cookbooks/database/libraries/provider_database_sql_server_user.rb +106 -0
- data/cookbooks/database/libraries/resource_database.rb +111 -0
- data/cookbooks/database/libraries/resource_database_user.rb +90 -0
- data/cookbooks/database/libraries/resource_mysql_database.rb +34 -0
- data/cookbooks/database/libraries/resource_mysql_database_user.rb +34 -0
- data/cookbooks/database/libraries/resource_postgresql_database.rb +35 -0
- data/cookbooks/database/libraries/resource_postgresql_database_user.rb +35 -0
- data/cookbooks/database/libraries/resource_sql_server_database.rb +34 -0
- data/cookbooks/database/libraries/resource_sql_server_database_user.rb +34 -0
- data/cookbooks/database/metadata.rb +21 -0
- data/cookbooks/database/recipes/default.rb +20 -0
- data/cookbooks/database/recipes/ebs_backup.rb +89 -0
- data/cookbooks/database/recipes/ebs_volume.rb +196 -0
- data/cookbooks/database/recipes/master.rb +78 -0
- data/cookbooks/database/recipes/snapshot.rb +62 -0
- data/cookbooks/database/templates/default/app_grants.sql.erb +8 -0
- data/cookbooks/database/templates/default/aws_config.erb +3 -0
- data/cookbooks/database/templates/default/chef-solo-database-snapshot.cron.erb +10 -0
- data/cookbooks/database/templates/default/chef-solo-database-snapshot.json.erb +1 -0
- data/cookbooks/database/templates/default/chef-solo-database-snapshot.rb.erb +6 -0
- data/cookbooks/database/templates/default/ebs-backup-cron.erb +2 -0
- data/cookbooks/database/templates/default/ebs-db-backup.sh.erb +8 -0
- data/cookbooks/database/templates/default/ebs-db-restore.sh.erb +10 -0
- data/cookbooks/database/templates/default/s3cfg.erb +27 -0
- data/cookbooks/mysql/README.md +148 -0
- data/cookbooks/mysql/attributes/server.rb +68 -0
- data/cookbooks/mysql/libraries/database.rb +19 -0
- data/cookbooks/mysql/libraries/helpers.rb +33 -0
- data/cookbooks/mysql/metadata.rb +90 -0
- data/cookbooks/mysql/recipes/client.rb +51 -0
- data/cookbooks/mysql/recipes/default.rb +20 -0
- data/cookbooks/mysql/recipes/server.rb +133 -0
- data/cookbooks/mysql/recipes/server_ec2.rb +49 -0
- data/cookbooks/mysql/templates/default/debian.cnf.erb +12 -0
- data/cookbooks/mysql/templates/default/grants.sql.erb +15 -0
- data/cookbooks/mysql/templates/default/my.cnf.erb +176 -0
- data/cookbooks/mysql/templates/default/mysql-server.seed.erb +10 -0
- data/cookbooks/mysql/templates/default/port_mysql.erb +3 -0
- data/cookbooks/openssl/README.md +37 -0
- data/cookbooks/openssl/libraries/secure_password.rb +37 -0
- data/cookbooks/openssl/metadata.rb +8 -0
- data/cookbooks/openssl/recipes/default.rb +19 -0
- data/cookbooks/passenger_enterprise/README.rdoc +8 -0
- data/cookbooks/passenger_enterprise/attributes/default.rb +28 -0
- data/cookbooks/passenger_enterprise/cc.gemspec +36 -0
- data/cookbooks/passenger_enterprise/metadata.json +44 -0
- data/cookbooks/passenger_enterprise/metadata.rb +16 -0
- data/cookbooks/passenger_enterprise/recipes/apache2.rb +54 -0
- data/cookbooks/passenger_enterprise/recipes/default.rb +30 -0
- data/cookbooks/passenger_enterprise/recipes/nginx.rb +50 -0
- data/cookbooks/passenger_enterprise/templates/default/passenger.conf.erb +2 -0
- data/cookbooks/passenger_enterprise/templates/default/passenger.load.erb +1 -0
- data/cookbooks/passenger_enterprise/templates/default/passenger_nginx.conf.erb +2 -0
- data/cookbooks/ruby_enterprise/README.rdoc +55 -0
- data/cookbooks/ruby_enterprise/attributes/default.rb +33 -0
- data/cookbooks/ruby_enterprise/cc.gemspec +36 -0
- data/cookbooks/ruby_enterprise/definitions/ree_gem.rb +28 -0
- data/cookbooks/ruby_enterprise/metadata.json +45 -0
- data/cookbooks/ruby_enterprise/metadata.rb +13 -0
- data/cookbooks/ruby_enterprise/recipes/default.rb +67 -0
- data/data_bags/deploy/authorized_keys.json +9 -0
- data/dna.json +25 -0
- data/elzar.gemspec +22 -0
- data/lib/elzar.rb +21 -0
- data/lib/elzar/assistant.rb +77 -0
- data/lib/elzar/chef_dna.rb +48 -0
- data/lib/elzar/template.rb +24 -0
- data/lib/elzar/templates/Gemfile +11 -0
- data/lib/elzar/templates/Vagrantfile.erb +16 -0
- data/lib/elzar/templates/dna.json +25 -0
- data/lib/elzar/templates/solo.rb.erb +6 -0
- data/lib/elzar/version.rb +3 -0
- data/roles/enterprise_appstack.rb +4 -0
- data/roles/plumbing.rb +11 -0
- data/roles/postgres_database.rb +4 -0
- data/roles/ruby_appstack.rb +4 -0
- data/script/install_cookbook +6 -0
- data/script/new_cookbook +5 -0
- data/site-cookbooks/.gitkeep +0 -0
- data/site-cookbooks/curl/README.md +17 -0
- data/site-cookbooks/curl/metadata.rb +6 -0
- data/site-cookbooks/curl/recipes/default.rb +11 -0
- data/site-cookbooks/nginx/CHANGELOG.md +11 -0
- data/site-cookbooks/nginx/CONTRIBUTING +29 -0
- data/site-cookbooks/nginx/LICENSE +201 -0
- data/site-cookbooks/nginx/README.md +76 -0
- data/site-cookbooks/nginx/attributes/default.rb +65 -0
- data/site-cookbooks/nginx/definitions/nginx_site.rb +35 -0
- data/site-cookbooks/nginx/files/default/mime.types +73 -0
- data/site-cookbooks/nginx/metadata.rb +89 -0
- data/site-cookbooks/nginx/recipes/default.rb +57 -0
- data/site-cookbooks/nginx/recipes/source.rb +126 -0
- data/site-cookbooks/nginx/templates/default/default-site.erb +11 -0
- data/site-cookbooks/nginx/templates/default/nginx.conf.erb +42 -0
- data/site-cookbooks/nginx/templates/default/nginx.init.erb +91 -0
- data/site-cookbooks/nginx/templates/default/nxdissite.erb +29 -0
- data/site-cookbooks/nginx/templates/default/nxensite.erb +38 -0
- data/site-cookbooks/passenger/README.md +12 -0
- data/site-cookbooks/passenger/attributes/default.rb +3 -0
- data/site-cookbooks/passenger/metadata.rb +6 -0
- data/site-cookbooks/passenger/recipes/default.rb +39 -0
- data/site-cookbooks/passenger/templates/default/passenger_nginx.conf.erb +2 -0
- data/site-cookbooks/postgresql/README.md +150 -0
- data/site-cookbooks/postgresql/attributes/default.rb +72 -0
- data/site-cookbooks/postgresql/metadata.rb +21 -0
- data/site-cookbooks/postgresql/recipes/client.rb +40 -0
- data/site-cookbooks/postgresql/recipes/default.rb +20 -0
- data/site-cookbooks/postgresql/recipes/server.rb +74 -0
- data/site-cookbooks/postgresql/recipes/server_debian.rb +62 -0
- data/site-cookbooks/postgresql/recipes/server_redhat.rb +82 -0
- data/site-cookbooks/postgresql/templates/default/debian.postgresql.conf.erb +499 -0
- data/site-cookbooks/postgresql/templates/default/pg_hba.conf.erb +83 -0
- data/site-cookbooks/postgresql/templates/default/redhat.postgresql.conf.erb +501 -0
- data/site-cookbooks/rails_app/README.md +15 -0
- data/site-cookbooks/rails_app/attributes/default.rb +2 -0
- data/site-cookbooks/rails_app/files/default/sudoers +26 -0
- data/site-cookbooks/rails_app/metadata.rb +6 -0
- data/site-cookbooks/rails_app/recipes/default.rb +143 -0
- data/site-cookbooks/rails_app/recipes/system_libraries.rb +12 -0
- data/site-cookbooks/rails_app/templates/default/pg_hba.conf.erb +84 -0
- data/site-cookbooks/rails_app/templates/default/rails_app_nginx.erb +10 -0
- data/site-cookbooks/ruby/README.md +12 -0
- data/site-cookbooks/ruby/attributes/default.rb +6 -0
- data/site-cookbooks/ruby/metadata.rb +6 -0
- data/site-cookbooks/ruby/recipes/default.rb +54 -0
- data/solo.rb +7 -0
- data/upgrade-chef.sh +8 -0
- metadata +272 -0
data/.chef/knife.rb
ADDED
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
/.vagrant
|
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm gemset use elzar
|
data/Gemfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
source :rubygems
|
2
|
+
|
3
|
+
group "development" do
|
4
|
+
# chef and vagrant require different versions of json, so we have to force the version manually
|
5
|
+
gem "json", "1.5.2"
|
6
|
+
|
7
|
+
gem "vagrant", "0.8.7"
|
8
|
+
gem "chef", "0.10.8"
|
9
|
+
gem "knife-solo", "0.0.4"
|
10
|
+
gem "knife-github-cookbooks", :git => "git://github.com/sumbach/knife-github-cookbooks.git"
|
11
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
GIT
|
2
|
+
remote: git://github.com/sumbach/knife-github-cookbooks.git
|
3
|
+
revision: 13d5d7444b468cab24e6fa2d4b07da6ea45ac088
|
4
|
+
specs:
|
5
|
+
knife-github-cookbooks (0.1.5)
|
6
|
+
chef (~> 0.10.0)
|
7
|
+
launchy (~> 0.4.0)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: http://rubygems.org/
|
11
|
+
specs:
|
12
|
+
archive-tar-minitar (0.5.2)
|
13
|
+
bunny (0.7.9)
|
14
|
+
chef (0.10.8)
|
15
|
+
bunny (>= 0.6.0)
|
16
|
+
erubis
|
17
|
+
highline
|
18
|
+
json (>= 1.4.4, <= 1.6.1)
|
19
|
+
mixlib-authentication (>= 1.1.0)
|
20
|
+
mixlib-cli (>= 1.1.0)
|
21
|
+
mixlib-config (>= 1.1.2)
|
22
|
+
mixlib-log (>= 1.3.0)
|
23
|
+
moneta
|
24
|
+
net-ssh (~> 2.1.3)
|
25
|
+
net-ssh-multi (~> 1.1.0)
|
26
|
+
ohai (>= 0.6.0)
|
27
|
+
rest-client (>= 1.0.4, < 1.7.0)
|
28
|
+
treetop (~> 1.4.9)
|
29
|
+
uuidtools
|
30
|
+
configuration (1.3.1)
|
31
|
+
erubis (2.7.0)
|
32
|
+
ffi (1.0.11)
|
33
|
+
highline (1.6.11)
|
34
|
+
i18n (0.6.0)
|
35
|
+
ipaddress (0.8.0)
|
36
|
+
json (1.5.2)
|
37
|
+
knife-solo (0.0.4)
|
38
|
+
chef (~> 0.10.0)
|
39
|
+
net-ssh (~> 2.1.3)
|
40
|
+
launchy (0.4.0)
|
41
|
+
configuration (>= 0.0.5)
|
42
|
+
rake (>= 0.8.1)
|
43
|
+
mime-types (1.18)
|
44
|
+
mixlib-authentication (1.1.4)
|
45
|
+
mixlib-log
|
46
|
+
mixlib-cli (1.2.2)
|
47
|
+
mixlib-config (1.1.2)
|
48
|
+
mixlib-log (1.3.0)
|
49
|
+
moneta (0.6.0)
|
50
|
+
net-scp (1.0.4)
|
51
|
+
net-ssh (>= 1.99.1)
|
52
|
+
net-ssh (2.1.4)
|
53
|
+
net-ssh-gateway (1.1.0)
|
54
|
+
net-ssh (>= 1.99.1)
|
55
|
+
net-ssh-multi (1.1)
|
56
|
+
net-ssh (>= 2.1.4)
|
57
|
+
net-ssh-gateway (>= 0.99.0)
|
58
|
+
ohai (0.6.12)
|
59
|
+
ipaddress
|
60
|
+
mixlib-cli
|
61
|
+
mixlib-config
|
62
|
+
mixlib-log
|
63
|
+
systemu
|
64
|
+
yajl-ruby
|
65
|
+
polyglot (0.3.3)
|
66
|
+
rake (0.9.2.2)
|
67
|
+
rest-client (1.6.7)
|
68
|
+
mime-types (>= 1.16)
|
69
|
+
systemu (2.5.0)
|
70
|
+
thor (0.14.6)
|
71
|
+
treetop (1.4.10)
|
72
|
+
polyglot
|
73
|
+
polyglot (>= 0.3.1)
|
74
|
+
uuidtools (2.1.2)
|
75
|
+
vagrant (0.8.7)
|
76
|
+
archive-tar-minitar (= 0.5.2)
|
77
|
+
erubis (~> 2.7.0)
|
78
|
+
i18n (~> 0.6.0)
|
79
|
+
json (~> 1.5.1)
|
80
|
+
net-scp (~> 1.0.4)
|
81
|
+
net-ssh (~> 2.1.4)
|
82
|
+
thor (~> 0.14.6)
|
83
|
+
virtualbox (~> 0.9.1)
|
84
|
+
virtualbox (0.9.2)
|
85
|
+
ffi (~> 1.0.9)
|
86
|
+
yajl-ruby (1.1.0)
|
87
|
+
|
88
|
+
PLATFORMS
|
89
|
+
ruby
|
90
|
+
|
91
|
+
DEPENDENCIES
|
92
|
+
chef (= 0.10.8)
|
93
|
+
json (= 1.5.2)
|
94
|
+
knife-github-cookbooks!
|
95
|
+
knife-solo (= 0.0.4)
|
96
|
+
vagrant (= 0.8.7)
|
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# Getting Started
|
2
|
+
|
3
|
+
Download and install VirtualBox (as instructed in the Vagrant
|
4
|
+
[Getting Started guide](http://vagrantup.com/docs/getting-started/index.html)). Then set up
|
5
|
+
your bundle and grab the Ubuntu Lucid VM image.
|
6
|
+
|
7
|
+
gem install bundler
|
8
|
+
bundle install
|
9
|
+
vagrant box add lucid64 http://files.vagrantup.com/lucid64.box
|
10
|
+
|
11
|
+
## Spin up a new VM
|
12
|
+
|
13
|
+
vagrant up
|
14
|
+
|
15
|
+
## SSH into the VM
|
16
|
+
|
17
|
+
vagrant ssh
|
18
|
+
|
19
|
+
## Destroy the VM
|
20
|
+
|
21
|
+
vagrant destroy
|
22
|
+
|
23
|
+
## Re-run Chef recipes on the VM
|
24
|
+
|
25
|
+
vagrant provision
|
26
|
+
|
27
|
+
## Stop/Start the VM
|
28
|
+
|
29
|
+
vagrant suspend
|
30
|
+
vagrant resume
|
31
|
+
|
32
|
+
# Install additional cookbooks
|
33
|
+
|
34
|
+
This script (and the knife extension it invokes) automatically creates a
|
35
|
+
vendor branch for tracking upstream git sources, merges the cookbook into the
|
36
|
+
cookbooks/ directory, and makes it easy to update these cookbook as needed in
|
37
|
+
the future.
|
38
|
+
|
39
|
+
To use this script, the cookbook must be in its own git repository, like those
|
40
|
+
at https://github.com/cookbooks/.
|
41
|
+
|
42
|
+
./script/install_cookbook cookbooks/mysql
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/Vagrantfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'json'
|
2
|
+
Vagrant::Config.run do |config|
|
3
|
+
config.vm.box = "lucid64"
|
4
|
+
config.vm.box_url = "http://files.vagrantup.com/lucid64.box"
|
5
|
+
config.vm.host_name = "elzar.thinkrelevance.com"
|
6
|
+
config.vm.network "172.25.5.5"
|
7
|
+
config.vm.provision :shell, :path => "upgrade-chef.sh"
|
8
|
+
config.vm.provision :chef_solo do |chef|
|
9
|
+
chef.cookbooks_path = ["site-cookbooks", "cookbooks"]
|
10
|
+
chef.roles_path = "roles"
|
11
|
+
chef.data_bags_path = "data_bags"
|
12
|
+
json = JSON.parse File.read('dna.json')
|
13
|
+
chef.run_list = json['run_list']
|
14
|
+
chef.json = json
|
15
|
+
end
|
16
|
+
end
|
data/cookbooks/.gitkeep
ADDED
File without changes
|
@@ -0,0 +1,122 @@
|
|
1
|
+
Description
|
2
|
+
===========
|
3
|
+
|
4
|
+
This cookbook includes recipes to execute apt-get update to ensure the local APT package cache is up to date or manage apt-cacher and cacher clients. It also includes a LWRP for managing APT repositories in /etc/apt/sources.list.d.
|
5
|
+
|
6
|
+
Recipes
|
7
|
+
=======
|
8
|
+
|
9
|
+
default
|
10
|
+
-------
|
11
|
+
|
12
|
+
This recipe installs the `update-notifier-common` package to provide the timestamp file used to only run `apt-get update` if the cache is less than one day old.
|
13
|
+
|
14
|
+
This 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.
|
15
|
+
|
16
|
+
This recipe also sets up a local cache directory for preseeding packages.
|
17
|
+
|
18
|
+
cacher
|
19
|
+
------
|
20
|
+
|
21
|
+
Installs the apt-cacher package and service so the system can provide APT caching. You can check the usage report at http://{hostname}:3142/report. The cacher recipe includes the `cacher-client` recipe, so it helps seed itself.
|
22
|
+
|
23
|
+
cacher-client
|
24
|
+
-------------
|
25
|
+
Configures the node to use the apt-cacher server as a client.
|
26
|
+
|
27
|
+
Resources/Providers
|
28
|
+
===================
|
29
|
+
|
30
|
+
This LWRP provides an easy way to manage additional APT repositories. Adding a new repository will notify running the `execute[apt-get-update]` resource.
|
31
|
+
|
32
|
+
# Actions
|
33
|
+
|
34
|
+
- :add: creates a repository file and builds the repository listing
|
35
|
+
- :remove: removes the repository file
|
36
|
+
|
37
|
+
# Attribute Parameters
|
38
|
+
|
39
|
+
- repo_name: name attribute. The name of the channel to discover
|
40
|
+
- uri: the base of the Debian distribution
|
41
|
+
- distribution: this is usually your release's codename...ie something like `karmic`, `lucid` or `maverick`
|
42
|
+
- components: package groupings..when it doubt use `main`
|
43
|
+
- deb_src: whether or not to add the repository as a source repo as well
|
44
|
+
- key_server: the GPG keyserver where the key for the repo should be retrieved
|
45
|
+
- key: if a `key_server` is provided, this is assumed to be the fingerprint, otherwise it is the URI to the GPG key for the repo
|
46
|
+
|
47
|
+
# Examples
|
48
|
+
|
49
|
+
# add the Zenoss repo
|
50
|
+
apt_repository "zenoss" do
|
51
|
+
uri "http://dev.zenoss.org/deb"
|
52
|
+
components ["main","stable"]
|
53
|
+
action :add
|
54
|
+
end
|
55
|
+
|
56
|
+
# add the Nginx PPA; grab key from keyserver
|
57
|
+
apt_repository "nginx-php" do
|
58
|
+
uri "http://ppa.launchpad.net/nginx/php5/ubuntu"
|
59
|
+
distribution node['lsb']['codename']
|
60
|
+
components ["main"]
|
61
|
+
keyserver "keyserver.ubuntu.com"
|
62
|
+
key "C300EE8C"
|
63
|
+
action :add
|
64
|
+
end
|
65
|
+
|
66
|
+
# add the Cloudkick Repo
|
67
|
+
apt_repository "cloudkick" do
|
68
|
+
uri "http://packages.cloudkick.com/ubuntu"
|
69
|
+
distribution node['lsb']['codename']
|
70
|
+
components ["main"]
|
71
|
+
key "http://packages.cloudkick.com/cloudkick.packages.key"
|
72
|
+
action :add
|
73
|
+
end
|
74
|
+
|
75
|
+
# remove Zenoss repo
|
76
|
+
apt_repository "zenoss" do
|
77
|
+
action :remove
|
78
|
+
end
|
79
|
+
|
80
|
+
Usage
|
81
|
+
=====
|
82
|
+
|
83
|
+
Put `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.:
|
84
|
+
|
85
|
+
template "/etc/apt/sources.list.d/my_apt_sources.list" do
|
86
|
+
notifies :run, resources(:execute => "apt-get update"), :immediately
|
87
|
+
end
|
88
|
+
|
89
|
+
The 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.
|
90
|
+
|
91
|
+
Put `recipe[apt::cacher]` 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.
|
92
|
+
|
93
|
+
Changes
|
94
|
+
=======
|
95
|
+
|
96
|
+
## v1.2.0:
|
97
|
+
|
98
|
+
* COOK-136: Limit apt-get update to one run per day unless notified.
|
99
|
+
* COOK-471: ignore failure on apt-get update
|
100
|
+
* COOK-533: add support for deb and `deb_src` repos with `apt_repository`
|
101
|
+
|
102
|
+
License and Author
|
103
|
+
==================
|
104
|
+
|
105
|
+
Author:: Joshua Timberman (<joshua@opscode.com>)
|
106
|
+
Author:: Matt Ray (<matt@opscode.com>)
|
107
|
+
Author:: Seth Chisamore (<schisamo@opscode.com>)
|
108
|
+
|
109
|
+
Copyright 2009-2011 Opscode, Inc.
|
110
|
+
|
111
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
112
|
+
you may not use this file except in compliance with the License.
|
113
|
+
You may obtain a copy of the License at
|
114
|
+
|
115
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
116
|
+
|
117
|
+
Unless required by applicable law or agreed to in writing, software
|
118
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
119
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
120
|
+
See the License for the specific language governing permissions and
|
121
|
+
limitations under the License.
|
122
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# apt-cacher startup configuration file
|
2
|
+
|
3
|
+
# IMPORTANT: check the apt-cacher.conf file before using apt-cacher as daemon.
|
4
|
+
|
5
|
+
# set to 1 to start the daemon at boot time
|
6
|
+
AUTOSTART=1
|
7
|
+
|
8
|
+
# extra settings to override the ones in apt-cacher.conf
|
9
|
+
# EXTRAOPT=" daemon_port=3142 limit=30 "
|
@@ -0,0 +1,144 @@
|
|
1
|
+
# This file has been modified by ./apt-proxy-to-apt-cacher
|
2
|
+
# Some lines may have been appended at the bottom of this file
|
3
|
+
# This file has been modified by /usr/share/apt-cacher/apt-proxy-to-apt-cacher
|
4
|
+
# Some lines may have been appended at the bottom of this file
|
5
|
+
#################################################################
|
6
|
+
# This is the config file for apt-cacher. On most Debian systems
|
7
|
+
# you can safely leave the defaults alone.
|
8
|
+
#################################################################
|
9
|
+
|
10
|
+
# cache_dir is used to set the location of the local cache. This can
|
11
|
+
# become quite large, so make sure it is somewhere with plenty of space.
|
12
|
+
cache_dir=/var/cache/apt-cacher
|
13
|
+
|
14
|
+
# The email address of the administrator is displayed in the info page
|
15
|
+
# and traffic reports.
|
16
|
+
admin_email=root@localhost
|
17
|
+
|
18
|
+
# For the daemon startup settings please edit the file /etc/default/apt-cacher.
|
19
|
+
|
20
|
+
# Daemon port setting, only useful in stand-alone mode. You need to run the
|
21
|
+
# daemon as root to use privileged ports (<1024).
|
22
|
+
daemon_port = 3142
|
23
|
+
|
24
|
+
# optional settings, user and group to run the daemon as. Make sure they have
|
25
|
+
# sufficient permissions on the cache and log directories. Comment the settings
|
26
|
+
# to run apt-cacher as the native user.
|
27
|
+
group=www-data
|
28
|
+
user=www-data
|
29
|
+
|
30
|
+
# optional setting, binds the listening daemon to one specified IP. Use IP
|
31
|
+
# ranges for more advanced configuration, see below.
|
32
|
+
# daemon_addr=localhost
|
33
|
+
|
34
|
+
# If your apt-cacher machine is directly exposed to the Internet and you are
|
35
|
+
# worried about unauthorised machines fetching packages through it, you can
|
36
|
+
# specify a list of IPv4 addresses which are allowed to use it and another
|
37
|
+
# list of IPv4 addresses which aren't.
|
38
|
+
# Localhost (127.0.0.1) is always allowed. Other addresses must be matched
|
39
|
+
# by allowed_hosts and not by denied_hosts to be permitted to use the cache.
|
40
|
+
# Setting allowed_hosts to "*" means "allow all".
|
41
|
+
# Otherwise the format is a comma-separated list containing addresses,
|
42
|
+
# optionally with masks (like 10.0.0.0/22), or ranges of addresses (two
|
43
|
+
# addresses separated by a hyphen, no masks, like '192.168.0.3-192.168.0.56').
|
44
|
+
allowed_hosts=*
|
45
|
+
denied_hosts=
|
46
|
+
|
47
|
+
# And similiarly for IPv6 with allowed_hosts_6 and denied_hosts_6.
|
48
|
+
# Note that IPv4-mapped IPv6 addresses (::ffff:w.x.y.z) are truncated to
|
49
|
+
# w.x.y.z and are handled as IPv4.
|
50
|
+
allowed_hosts_6=fec0::/16
|
51
|
+
denied_hosts_6=
|
52
|
+
|
53
|
+
# This thing can be done by Apache but is much simplier here - limit access to
|
54
|
+
# Debian mirrors based on server names in the URLs
|
55
|
+
#allowed_locations=ftp.uni-kl.de,ftp.nerim.net,debian.tu-bs.de
|
56
|
+
|
57
|
+
# Apt-cacher can generate usage reports every 24 hours if you set this
|
58
|
+
# directive to 1. You can view the reports in a web browser by pointing
|
59
|
+
# to your cache machine with '/apt-cacher/report' on the end, like this:
|
60
|
+
# http://yourcache.example.com/apt-cacher/report
|
61
|
+
# Generating reports is very fast even with many thousands of logfile
|
62
|
+
# lines, so you can safely turn this on without creating much
|
63
|
+
# additional system load.
|
64
|
+
generate_reports=1
|
65
|
+
|
66
|
+
# Apt-cacher can clean up its cache directory every 24 hours if you set
|
67
|
+
# this directive to 1. Cleaning the cache can take some time to run
|
68
|
+
# (generally in the order of a few minutes) and removes all package
|
69
|
+
# files that are not mentioned in any existing 'Packages' lists. This
|
70
|
+
# has the effect of deleting packages that have been superseded by an
|
71
|
+
# updated 'Packages' list.
|
72
|
+
clean_cache=1
|
73
|
+
|
74
|
+
# The directory to use for apt-cacher access and error logs.
|
75
|
+
# The access log records every request in the format:
|
76
|
+
# date-time|client ip address|HIT/MISS/EXPIRED|object size|object name
|
77
|
+
# The error log is slightly more free-form, and is also used for debug
|
78
|
+
# messages if debug mode is turned on.
|
79
|
+
# Note that the old 'logfile' and 'errorfile' directives are
|
80
|
+
# deprecated: if you set them explicitly they will be honoured, but it's
|
81
|
+
# better to just get rid of them from old config files.
|
82
|
+
logdir=/var/log/apt-cacher
|
83
|
+
|
84
|
+
# apt-cacher can use different methods to decide whether package lists need to
|
85
|
+
# be updated,
|
86
|
+
# A) looking at the age of the cached files
|
87
|
+
# B) getting HTTP header from server and comparing that with cached data. This
|
88
|
+
# method is more reliable and avoids desynchronisation of data and index files
|
89
|
+
# but needs to transfer few bytes from the server every time somebody requests
|
90
|
+
# the files ("apt-get update")
|
91
|
+
# Set the following value to the maximum age (in hours) for method A or to 0
|
92
|
+
# for method B
|
93
|
+
expire_hours=0
|
94
|
+
|
95
|
+
# Apt-cacher can pass all its requests to an external http proxy like
|
96
|
+
# Squid, which could be very useful if you are using an ISP that blocks
|
97
|
+
# port 80 and requires all web traffic to go through its proxy. The
|
98
|
+
# format is 'hostname:port', eg: 'proxy.example.com:8080'.
|
99
|
+
http_proxy=proxy.example.com:8080
|
100
|
+
|
101
|
+
# Use of an external proxy can be turned on or off with this flag.
|
102
|
+
# Value should be either 0 (off) or 1 (on).
|
103
|
+
use_proxy=0
|
104
|
+
|
105
|
+
# External http proxy sometimes need authentication to get full access. The
|
106
|
+
# format is 'username:password'.
|
107
|
+
http_proxy_auth=proxyuser:proxypass
|
108
|
+
|
109
|
+
# Use of external proxy authentication can be turned on or off with this flag.
|
110
|
+
# Value should be either 0 (off) or 1 (on).
|
111
|
+
use_proxy_auth=0
|
112
|
+
|
113
|
+
# Rate limiting sets the maximum bandwidth in bytes per second to use
|
114
|
+
# for fetching packages. Syntax is fully defined in 'man wget'.
|
115
|
+
# Use 'k' or 'm' to use kilobits or megabits / second: eg, 'limit=25k'.
|
116
|
+
# Use 0 or a negative value for no rate limiting.
|
117
|
+
limit=0
|
118
|
+
|
119
|
+
# Debug mode makes apt-cacher spew a lot of extra debug junk to the
|
120
|
+
# error log (whose location is defined with the 'logdir' directive).
|
121
|
+
# Leave this off unless you need it, or your error log will get very
|
122
|
+
# big. Acceptable values are 0 or 1.
|
123
|
+
debug=0
|
124
|
+
|
125
|
+
# Adapt the line in the usage info web page to match your server configuration
|
126
|
+
# example_sources_line=deb http://<b>my.cacher.server:3142/</b>ftp.au.debian.org/debian unstable main contrib non-free
|
127
|
+
|
128
|
+
# Print a 410 (Gone) HTTP message with the specified text when accessed via
|
129
|
+
# CGI. Useful to tell users to adapt their sources.list files when the
|
130
|
+
# apt-cacher server is beeing relocated (via apt-get's error messages while
|
131
|
+
# running "update")
|
132
|
+
#cgi_advise_to_use = Please use http://cacheserver:3142/ as apt-cacher access URL
|
133
|
+
#cgi_advise_to_use = Server relocated. To change sources.list, run perl -pe "s,/apt-cacher\??,:3142," -i /etc/apt/sources.list
|
134
|
+
|
135
|
+
# Server mapping - this allows to hide real server names behind virtual paths
|
136
|
+
# that appear in the access URL. This method is known from apt-proxy. This is
|
137
|
+
# also the only method to use FTP access to the target hosts. The syntax is simple, the part of the beginning to replace, followed by a list of mirror urls, all space separated. Multiple profile are separated by semicolons
|
138
|
+
# path_map = debian ftp.uni-kl.de/pub/linux/debian ftp2.de.debian.org/debian ; ubuntu archive.ubuntu.com/ubuntu ; security security.debian.org/debian-security ftp2.de.debian.org/debian-security
|
139
|
+
# Note that you need to specify all target servers in the allowed_locations
|
140
|
+
# options if you make use of it. Also note that the paths should not overlap
|
141
|
+
# each other. FTP access method not supported yet, maybe in the future.
|
142
|
+
|
143
|
+
# extra setting from apt-proxy configuration
|
144
|
+
path_map = ubuntu us.archive.ubuntu.com/ubuntu ; ubuntu-security security.ubuntu.com/ubuntu ; debian debian.osuosl.org/debian/ ; security security.debian.org/debian-security
|