├── .gitignore ├── cookbooks ├── apt │ ├── .gitignore │ ├── Gemfile │ ├── templates │ │ └── default │ │ │ ├── 01proxy.erb │ │ │ └── acng.conf.erb │ ├── attributes │ │ └── default.rb │ ├── metadata.rb │ ├── resources │ │ ├── preference.rb │ │ └── repository.rb │ ├── recipes │ │ ├── cacher-ng.rb │ │ ├── cacher-client.rb │ │ └── default.rb │ ├── CONTRIBUTING │ ├── files │ │ └── default │ │ │ └── apt-proxy-v2.conf │ ├── providers │ │ ├── preference.rb │ │ └── repository.rb │ ├── CHANGELOG.md │ ├── metadata.json │ ├── README.md │ └── LICENSE ├── build-essential │ ├── .gitignore │ ├── Gemfile │ ├── metadata.rb │ ├── CHANGELOG.md │ ├── metadata.json │ ├── CONTRIBUTING │ ├── attributes │ │ └── default.rb │ ├── recipes │ │ └── default.rb │ ├── README.md │ └── LICENSE ├── git │ ├── templates │ │ └── default │ │ │ ├── sv-git-daemon-log-run.erb │ │ │ └── sv-git-daemon-run.erb │ ├── metadata.rb │ ├── recipes │ │ ├── default.rb │ │ └── server.rb │ └── README.md └── vagrant_main │ ├── README.md │ ├── recipes │ └── default.rb │ ├── attributes │ └── default.rb │ └── metadata.rb ├── .gitmodules ├── .chef └── knife.rb ├── README.md └── Vagrantfile /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vagrant -------------------------------------------------------------------------------- /cookbooks/apt/.gitignore: -------------------------------------------------------------------------------- 1 | .bundle 2 | .cache 3 | .kitchen 4 | bin 5 | -------------------------------------------------------------------------------- /cookbooks/apt/Gemfile: -------------------------------------------------------------------------------- 1 | source :rubygems 2 | 3 | gem 'test-kitchen', '< 1.0' 4 | -------------------------------------------------------------------------------- /cookbooks/build-essential/.gitignore: -------------------------------------------------------------------------------- 1 | .bundle 2 | .cache 3 | .kitchen 4 | bin 5 | -------------------------------------------------------------------------------- /cookbooks/build-essential/Gemfile: -------------------------------------------------------------------------------- 1 | source :rubygems 2 | 3 | gem 'test-kitchen', '<= 1.0' 4 | -------------------------------------------------------------------------------- /cookbooks/git/templates/default/sv-git-daemon-log-run.erb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec svlogd -tt ./main 3 | -------------------------------------------------------------------------------- /cookbooks/apt/templates/default/01proxy.erb: -------------------------------------------------------------------------------- 1 | Acquire::http::Proxy "http://<%= @proxy %>:<%= @port %>"; 2 | Acquire::https::Proxy "DIRECT"; 3 | -------------------------------------------------------------------------------- /cookbooks/apt/attributes/default.rb: -------------------------------------------------------------------------------- 1 | default['apt']['cacher-client']['restrict_environment'] = false 2 | default['apt']['cacher_port'] = 3142 3 | default['apt']['key_proxy'] = '' 4 | -------------------------------------------------------------------------------- /cookbooks/git/templates/default/sv-git-daemon-run.erb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec 2>&1 3 | exec /usr/bin/git daemon --export-all --user=nobody --group=daemon --base-path=/srv/git /srv/git 4 | -------------------------------------------------------------------------------- /cookbooks/vagrant_main/README.md: -------------------------------------------------------------------------------- 1 | Description 2 | =========== 3 | 4 | Requirements 5 | ============ 6 | 7 | Attributes 8 | ========== 9 | 10 | Usage 11 | ===== 12 | 13 | -------------------------------------------------------------------------------- /cookbooks/vagrant_main/recipes/default.rb: -------------------------------------------------------------------------------- 1 | include_recipe 'apt' 2 | include_recipe 'git' 3 | include_recipe "build-essential" 4 | include_recipe "ruby_build" 5 | include_recipe "rbenv::system" 6 | 7 | rbenv_global "2.0.0-p0" -------------------------------------------------------------------------------- /cookbooks/vagrant_main/attributes/default.rb: -------------------------------------------------------------------------------- 1 | set['rbenv']['rubies'] = [ "2.0.0-p0" ] 2 | 3 | set['rbenv']['gems'] = { 4 | '2.0.0-p0' => [ 5 | { 'name' => 'bundler' } 6 | ] 7 | } 8 | 9 | set['ruby_build']['upgrade'] = true -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "cookbooks/rbenv"] 2 | path = cookbooks/rbenv 3 | url = git://github.com/fnichol/chef-rbenv.git 4 | [submodule "cookbooks/ruby_build"] 5 | path = cookbooks/ruby_build 6 | url = git://github.com/fnichol/chef-ruby_build.git 7 | -------------------------------------------------------------------------------- /.chef/knife.rb: -------------------------------------------------------------------------------- 1 | current_dir = File.dirname(__FILE__) 2 | log_level :info 3 | log_location STDOUT 4 | cache_type 'BasicFile' 5 | cache_options( :path => "#{ENV['HOME']}/.chef/checksums" ) 6 | cookbook_path ["#{current_dir}/../cookbooks"] -------------------------------------------------------------------------------- /cookbooks/vagrant_main/metadata.rb: -------------------------------------------------------------------------------- 1 | maintainer "YOUR_COMPANY_NAME" 2 | maintainer_email "YOUR_EMAIL" 3 | license "All rights reserved" 4 | description "Installs/Configures vagrant_main" 5 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) 6 | version "0.0.1" 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Vagrant with rbenv and ruby 2.0 installed. 2 | 3 | [chef-rbenv](https://github.com/fnichol/chef-rbenv.git) and [chef-ruby_build](https://github.com/fnichol/chef-ruby_build) are added as git submodules in the /cookbooks directory. 4 | 5 | Usage 6 | ----- 7 | 8 | 1. Clone the repo: `git clone https://github.com/zhengjia/vagrant-rbenv.git` 9 | 2. Use Vagrant box Precise64]: `vagrant box add precise64 http://files.vagrantup.com/precise64.box` 10 | 3. Initialize the git submodule: `git submodule init` `git submodule update` 11 | 4. `vagrant up` 12 | 13 | -------------------------------------------------------------------------------- /cookbooks/git/metadata.rb: -------------------------------------------------------------------------------- 1 | maintainer "Opscode, Inc." 2 | maintainer_email "cookbooks@opscode.com" 3 | license "Apache 2.0" 4 | description "Installs git and/or sets up a Git server daemon" 5 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) 6 | version "0.10.0" 7 | recipe "git", "Installs git" 8 | recipe "git::server", "Sets up a runit_service for git daemon" 9 | 10 | %w{ ubuntu debian arch centos }.each do |os| 11 | supports os 12 | end 13 | 14 | %w{ runit yum }.each do |cb| 15 | depends cb 16 | end 17 | -------------------------------------------------------------------------------- /cookbooks/build-essential/metadata.rb: -------------------------------------------------------------------------------- 1 | name "build-essential" 2 | maintainer "Opscode, Inc." 3 | maintainer_email "cookbooks@opscode.com" 4 | license "Apache 2.0" 5 | description "Installs C compiler / build tools" 6 | version "1.3.4" 7 | recipe "build-essential", "Installs packages required for compiling C software from source." 8 | 9 | %w{ fedora redhat centos ubuntu debian amazon suse scientific oracle smartos}.each do |os| 10 | supports os 11 | end 12 | 13 | supports "mac_os_x", ">= 10.6.0" 14 | supports "mac_os_x_server", ">= 10.6.0" 15 | suggests "pkgin" 16 | -------------------------------------------------------------------------------- /cookbooks/apt/metadata.rb: -------------------------------------------------------------------------------- 1 | name "apt" 2 | maintainer "Opscode, Inc." 3 | maintainer_email "cookbooks@opscode.com" 4 | license "Apache 2.0" 5 | description "Configures apt and apt services and LWRPs for managing apt repositories and preferences" 6 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) 7 | version "1.9.0" 8 | recipe "apt", "Runs apt-get update during compile phase and sets up preseed directories" 9 | recipe "apt::cacher-ng", "Set up an apt-cacher-ng caching proxy" 10 | recipe "apt::cacher-client", "Client for the apt::cacher-ng caching proxy" 11 | 12 | %w{ ubuntu debian }.each do |os| 13 | supports os 14 | end 15 | -------------------------------------------------------------------------------- /cookbooks/git/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: git 3 | # Recipe:: default 4 | # 5 | # Copyright 2008-2009, 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 | case node[:platform] 20 | when "debian", "ubuntu" 21 | package "git-core" 22 | when "centos","redhat","scientific","fedora" 23 | case node[:platform_version].to_i 24 | when 5 25 | include_recipe "yum::epel" 26 | end 27 | package "git" 28 | else 29 | package "git" 30 | end 31 | -------------------------------------------------------------------------------- /cookbooks/build-essential/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## v1.3.4: 2 | 3 | * [COOK-2272] - Complete `platform_family` conversion in build-essential 4 | 5 | ## v1.3.2: 6 | 7 | * [COOK-2069] - build-essential will install osx-gcc-installer when 8 | Xcode is present 9 | 10 | ## v1.3.0: 11 | 12 | * [COOK-1895] - support smartos 13 | 14 | ## v1.2.0: 15 | 16 | * Add test-kitchen support (source repo only) 17 | * [COOK-1677] - build-essential cookbook support for OpenSuse and SLES 18 | * [COOK-1718] - build-essential cookbook metadata should include scientific 19 | * [COOK-1768] - The apt-get update in build-essentials needs to be renamed 20 | 21 | ## v1.1.2: 22 | 23 | * [COOK-1620] - support OS X 10.8 24 | 25 | ## v1.1.0: 26 | 27 | * [COOK-1098] - support amazon linux 28 | * [COOK-1149] - support Mac OS X 29 | * [COOK-1296] - allow for compile-time installation of packages 30 | through an attribute (see README) 31 | 32 | ## v1.0.2: 33 | 34 | * [COOK-1098] - Add Amazon Linux platform support 35 | * [COOK-1149] - Add OS X platform support 36 | -------------------------------------------------------------------------------- /cookbooks/apt/resources/preference.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: apt 3 | # Resource:: preference 4 | # 5 | # Copyright 2010-2011, 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 | actions :add, :remove 21 | 22 | def initialize(*args) 23 | super 24 | @action = :add 25 | end 26 | 27 | attribute :package_name, :kind_of => String, :name_attribute => true 28 | attribute :glob, :kind_of => String 29 | attribute :pin, :kind_of => String 30 | attribute :pin_priority, :kind_of => String 31 | -------------------------------------------------------------------------------- /cookbooks/build-essential/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "build-essential", 3 | "description": "Installs C compiler / build tools", 4 | "long_description": "", 5 | "maintainer": "Opscode, Inc.", 6 | "maintainer_email": "cookbooks@opscode.com", 7 | "license": "Apache 2.0", 8 | "platforms": { 9 | "fedora": ">= 0.0.0", 10 | "redhat": ">= 0.0.0", 11 | "centos": ">= 0.0.0", 12 | "ubuntu": ">= 0.0.0", 13 | "debian": ">= 0.0.0", 14 | "amazon": ">= 0.0.0", 15 | "suse": ">= 0.0.0", 16 | "scientific": ">= 0.0.0", 17 | "oracle": ">= 0.0.0", 18 | "smartos": ">= 0.0.0", 19 | "mac_os_x": ">= 10.6.0", 20 | "mac_os_x_server": ">= 10.6.0" 21 | }, 22 | "dependencies": { 23 | }, 24 | "recommendations": { 25 | }, 26 | "suggestions": { 27 | "pkgin": ">= 0.0.0" 28 | }, 29 | "conflicting": { 30 | }, 31 | "providing": { 32 | }, 33 | "replacing": { 34 | }, 35 | "attributes": { 36 | }, 37 | "groupings": { 38 | }, 39 | "recipes": { 40 | "build-essential": "Installs packages required for compiling C software from source." 41 | }, 42 | "version": "1.3.4" 43 | } -------------------------------------------------------------------------------- /cookbooks/git/recipes/server.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: git 3 | # Recipe:: server 4 | # 5 | # Copyright 2009, 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 | include_recipe "git" 20 | 21 | directory "/srv/git" do 22 | owner "root" 23 | group "root" 24 | mode 0755 25 | end 26 | 27 | case node[:platform] 28 | when "debian", "ubuntu" 29 | include_recipe "runit" 30 | runit_service "git-daemon" 31 | else 32 | log "Platform requires setting up a git daemon service script." 33 | log "Hint: /usr/bin/git daemon --export-all --user=nobody --group=daemon --base-path=/srv/git" 34 | end 35 | -------------------------------------------------------------------------------- /cookbooks/apt/recipes/cacher-ng.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: apt 3 | # Recipe:: cacher-ng 4 | # 5 | # Copyright 2008-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 | package "apt-cacher-ng" do 21 | action :install 22 | end 23 | 24 | service "apt-cacher-ng" do 25 | supports :restart => true, :status => false 26 | action :enable 27 | end 28 | 29 | template "/etc/apt-cacher-ng/acng.conf" do 30 | source "acng.conf.erb" 31 | owner "root" 32 | group "root" 33 | mode 00644 34 | notifies :restart, "service[apt-cacher-ng]" 35 | end 36 | 37 | # Reopen resource w/ start in case config issue causes startup to fail 38 | service "apt-cacher-ng" do 39 | action :start 40 | end 41 | 42 | #this will help seed the proxy 43 | include_recipe "apt::cacher-client" 44 | -------------------------------------------------------------------------------- /cookbooks/apt/CONTRIBUTING: -------------------------------------------------------------------------------- 1 | If you would like to contribute, please open a ticket in JIRA: 2 | 3 | * http://tickets.opscode.com 4 | 5 | Create the ticket in the COOK project and use the cookbook name as the 6 | component. 7 | 8 | For all code contributions, we ask that contributors sign a 9 | contributor license agreement (CLA). Instructions may be found here: 10 | 11 | * http://wiki.opscode.com/display/chef/How+to+Contribute 12 | 13 | When contributing changes to individual cookbooks, please do not 14 | modify the version number in the metadata.rb. Also please do not 15 | update the CHANGELOG.md for a new version. Not all changes to a 16 | cookbook may be merged and released in the same versions. Opscode will 17 | handle the version updates during the release process. You are welcome 18 | to correct typos or otherwise make updates to documentation in the 19 | README. 20 | 21 | If a contribution adds new platforms or platform versions, indicate 22 | such in the body of the commit message(s), and update the relevant 23 | COOK ticket. When writing commit messages, it is helpful for others if 24 | you indicate the COOK ticket. For example: 25 | 26 | git commit -m '[COOK-1041] Updated pool resource to correctly delete.' 27 | 28 | In the ticket itself, it is also helpful if you include log output of 29 | a successful Chef run, but this is not absolutely required. 30 | -------------------------------------------------------------------------------- /cookbooks/apt/files/default/apt-proxy-v2.conf: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | ;; All times are in seconds, but you can add a suffix 3 | ;; for minutes(m), hours(h) or days(d) 4 | 5 | ;; commented out address so apt-proxy will listen on all IPs 6 | ;; address = 127.0.0.1 7 | port = 9999 8 | cache_dir = /var/cache/apt-proxy 9 | 10 | ;; Control files (Packages/Sources/Contents) refresh rate 11 | min_refresh_delay = 1s 12 | complete_clientless_downloads = 1 13 | 14 | ;; Debugging settings. 15 | debug = all:4 db:0 16 | 17 | time = 30 18 | passive_ftp = on 19 | 20 | ;;-------------------------------------------------------------- 21 | ;; Cache housekeeping 22 | 23 | cleanup_freq = 1d 24 | max_age = 120d 25 | max_versions = 3 26 | 27 | ;;--------------------------------------------------------------- 28 | ;; Backend servers 29 | ;; 30 | ;; Place each server in its own [section] 31 | 32 | [ubuntu] 33 | ; Ubuntu archive 34 | backends = 35 | http://us.archive.ubuntu.com/ubuntu 36 | 37 | [ubuntu-security] 38 | ; Ubuntu security updates 39 | backends = http://security.ubuntu.com/ubuntu 40 | 41 | [debian] 42 | ;; Backend servers, in order of preference 43 | backends = 44 | http://debian.osuosl.org/debian/ 45 | 46 | [security] 47 | ;; Debian security archive 48 | backends = 49 | http://security.debian.org/debian-security 50 | http://ftp2.de.debian.org/debian-security 51 | -------------------------------------------------------------------------------- /cookbooks/build-essential/CONTRIBUTING: -------------------------------------------------------------------------------- 1 | If you would like to contribute, please open a ticket in JIRA: 2 | 3 | * http://tickets.opscode.com 4 | 5 | Create the ticket in the COOK project and use the cookbook name as the 6 | component. 7 | 8 | For all code contributions, we ask that contributors sign a 9 | contributor license agreement (CLA). Instructions may be found here: 10 | 11 | * http://wiki.opscode.com/display/chef/How+to+Contribute 12 | 13 | When contributing changes to individual cookbooks, please do not 14 | modify the version number in the metadata.rb. Also please do not 15 | update the CHANGELOG.md for a new version. Not all changes to a 16 | cookbook may be merged and released in the same versions. Opscode will 17 | handle the version updates during the release process. You are welcome 18 | to correct typos or otherwise make updates to documentation in the 19 | README. 20 | 21 | If a contribution adds new platforms or platform versions, indicate 22 | such in the body of the commit message(s), and update the relevant 23 | COOK ticket. When writing commit messages, it is helpful for others if 24 | you indicate the COOK ticket. For example: 25 | 26 | git commit -m '[COOK-1041] Updated pool resource to correctly delete.' 27 | 28 | In the ticket itself, it is also helpful if you include log output of 29 | a successful Chef run, but this is not absolutely required. 30 | -------------------------------------------------------------------------------- /cookbooks/git/README.md: -------------------------------------------------------------------------------- 1 | Description 2 | =========== 3 | 4 | Installs git and optionally sets up a git server as a daemon under runit. 5 | 6 | Changes 7 | ======= 8 | 9 | ## v0.10.0: 10 | 11 | * [COOK-853] - Git client installation on CentOS 12 | 13 | ## v0.9.0: 14 | 15 | * Current public release. 16 | 17 | Requirements 18 | ============ 19 | 20 | ## Platform: 21 | 22 | * Debian/Ubuntu 23 | * ArchLinux 24 | 25 | ## Cookbooks: 26 | 27 | * runit 28 | 29 | Usage 30 | ===== 31 | 32 | This cookbook primarily installs git core packages. It can also be 33 | used to serve git repositories. 34 | 35 | include_recipe "git::server" 36 | 37 | This creates the directory /srv/git and starts a git daemon, exporting 38 | all repositories found. Repositories need to be added manually, but 39 | will be available once they are created. 40 | 41 | License and Author 42 | ================== 43 | 44 | Author:: Joshua Timberman () 45 | 46 | Copyright:: 2009, Opscode, Inc 47 | 48 | Licensed under the Apache License, Version 2.0 (the "License"); 49 | you may not use this file except in compliance with the License. 50 | You may obtain a copy of the License at 51 | 52 | http://www.apache.org/licenses/LICENSE-2.0 53 | 54 | Unless required by applicable law or agreed to in writing, software 55 | distributed under the License is distributed on an "AS IS" BASIS, 56 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 57 | See the License for the specific language governing permissions and 58 | limitations under the License. 59 | -------------------------------------------------------------------------------- /cookbooks/build-essential/attributes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: build-essential 3 | # Attributes:: default 4 | # 5 | # Copyright 2008-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 | default['build_essential']['compiletime'] = false 21 | 22 | case node['platform_family'] 23 | when "mac_os_x" 24 | case 25 | when Chef::VersionConstraint.new("~> 10.7.0").include?(node['platform_version']), 26 | Chef::VersionConstraint.new("~> 10.8.0").include?(node['platform_version']) 27 | default['build_essential']['osx']['gcc_installer_url'] = "https://github.com/downloads/kennethreitz/osx-gcc-installer/GCC-10.7-v2.pkg" 28 | default['build_essential']['osx']['gcc_installer_checksum'] = "df36aa87606feb99d0db9ac9a492819e" 29 | when Chef::VersionConstraint.new("~> 10.6.0").include?(node['platform_version']) 30 | default['build_essential']['osx']['gcc_installer_url'] = "https://github.com/downloads/kennethreitz/osx-gcc-installer/GCC-10.6.pkg" 31 | default['build_essential']['osx']['gcc_installer_checksum'] = "d1db5bab6a3f6b9f3b5577a130baeefa" 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /cookbooks/apt/resources/repository.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: apt 3 | # Resource:: repository 4 | # 5 | # Copyright 2010-2011, 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 | actions :add, :remove 21 | 22 | def initialize(*args) 23 | super 24 | @action = :add 25 | end 26 | 27 | #name of the repo, used for source.list filename 28 | attribute :repo_name, :kind_of => String, :name_attribute => true 29 | attribute :uri, :kind_of => String 30 | attribute :distribution, :kind_of => String 31 | attribute :components, :kind_of => Array, :default => [] 32 | attribute :arch, :kind_of => String, :default => nil 33 | #whether or not to add the repository as a source repo as well 34 | attribute :deb_src, :default => false 35 | attribute :keyserver, :kind_of => String, :default => nil 36 | attribute :key, :kind_of => String, :default => nil 37 | attribute :cookbook, :kind_of => String, :default => nil 38 | #trigger cache rebuild 39 | #If not you can trigger in the recipe itself after checking the status of resource.updated{_by_last_action}? 40 | attribute :cache_rebuild, :kind_of => [TrueClass, FalseClass], :default => true 41 | -------------------------------------------------------------------------------- /cookbooks/apt/providers/preference.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: apt 3 | # Provider:: preference 4 | # 5 | # Copyright 2010-2011, 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 | # Build preferences.d file contents 21 | def build_pref(package_name, pin, pin_priority) 22 | preference_content = "Package: #{package_name}\nPin: #{pin}\nPin-Priority: #{pin_priority}\n" 23 | end 24 | 25 | action :add do 26 | new_resource.updated_by_last_action(false) 27 | 28 | preference = build_pref(new_resource.glob || new_resource.package_name, 29 | new_resource.pin, 30 | new_resource.pin_priority) 31 | 32 | preference_dir = directory "/etc/apt/preferences.d" do 33 | owner "root" 34 | group "root" 35 | mode 00755 36 | recursive true 37 | action :nothing 38 | end 39 | 40 | preference_file = file "/etc/apt/preferences.d/#{new_resource.name}" do 41 | owner "root" 42 | group "root" 43 | mode 00644 44 | content preference 45 | action :nothing 46 | end 47 | 48 | preference_dir.run_action(:create) 49 | # write out the preference file, replace it if it already exists 50 | preference_file.run_action(:create) 51 | end 52 | 53 | action :remove do 54 | if ::File.exists?("/etc/apt/preferences.d/#{new_resource.name}") 55 | Chef::Log.info "Un-pinning #{new_resource.name} from /etc/apt/preferences.d/" 56 | file "/etc/apt/preferences.d/#{new_resource.name}" do 57 | action :delete 58 | end 59 | new_resource.updated_by_last_action(true) 60 | end 61 | end 62 | -------------------------------------------------------------------------------- /cookbooks/apt/recipes/cacher-client.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: apt 3 | # Recipe:: cacher-client 4 | # 5 | # Copyright 2011, 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 | #remove Acquire::http::Proxy lines from /etc/apt/apt.conf since we use 01proxy 21 | #these are leftover from preseed installs 22 | execute 'Remove proxy from /etc/apt/apt.conf' do 23 | command "sed --in-place '/^Acquire::http::Proxy/d' /etc/apt/apt.conf" 24 | only_if "grep Acquire::http::Proxy /etc/apt/apt.conf" 25 | end 26 | 27 | servers = [] 28 | if node['apt'] && node['apt']['cacher_ipaddress'] 29 | cacher = Chef::Node.new 30 | cacher.name(node['apt']['cacher_ipaddress']) 31 | cacher.ipaddress(node['apt']['cacher_ipaddress']) 32 | servers << cacher 33 | end 34 | 35 | unless Chef::Config[:solo] 36 | query = 'recipes:apt\:\:cacher-ng' 37 | query += " AND chef_environment:#{node.chef_environment}" if node['apt']['cacher-client']['restrict_environment'] 38 | Chef::Log.debug("apt::cacher-client searching for '#{query}'") 39 | servers += search(:node, query) 40 | end 41 | 42 | if servers.length > 0 43 | Chef::Log.info("apt-cacher-ng server found on #{servers[0]}.") 44 | template '/etc/apt/apt.conf.d/01proxy' do 45 | source '01proxy.erb' 46 | owner 'root' 47 | group 'root' 48 | mode 00644 49 | variables( 50 | :proxy => servers[0]['ipaddress'], 51 | :port => node['apt']['cacher_port'] 52 | ) 53 | end.run_action(:create) 54 | else 55 | Chef::Log.info('No apt-cacher-ng server found.') 56 | file '/etc/apt/apt.conf.d/01proxy' do 57 | action :delete 58 | end 59 | end 60 | -------------------------------------------------------------------------------- /cookbooks/apt/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: apt 3 | # Recipe:: default 4 | # 5 | # Copyright 2008-2011, Opscode, Inc. 6 | # Copyright 2009, Bryan McLellan 7 | # 8 | # Licensed under the Apache License, Version 2.0 (the "License"); 9 | # you may not use this file except in compliance with the License. 10 | # You may obtain a copy of the License at 11 | # 12 | # http://www.apache.org/licenses/LICENSE-2.0 13 | # 14 | # Unless required by applicable law or agreed to in writing, software 15 | # distributed under the License is distributed on an "AS IS" BASIS, 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | # See the License for the specific language governing permissions and 18 | # limitations under the License. 19 | # 20 | 21 | # Run apt-get update to create the stamp file 22 | execute "apt-get-update" do 23 | command "apt-get update" 24 | ignore_failure true 25 | not_if do ::File.exists?('/var/lib/apt/periodic/update-success-stamp') end 26 | end 27 | 28 | # For other recipes to call to force an update 29 | execute "apt-get update" do 30 | command "apt-get update" 31 | ignore_failure true 32 | action :nothing 33 | end 34 | 35 | # Automatically remove packages that are no longer needed for dependencies 36 | execute "apt-get autoremove" do 37 | command "apt-get -y autoremove" 38 | action :nothing 39 | end 40 | 41 | # Automatically remove .deb files for packages no longer on your system 42 | execute "apt-get autoclean" do 43 | command "apt-get -y autoclean" 44 | action :nothing 45 | end 46 | 47 | # provides /var/lib/apt/periodic/update-success-stamp on apt-get update 48 | package "update-notifier-common" do 49 | notifies :run, resources(:execute => "apt-get-update"), :immediately 50 | end 51 | 52 | execute "apt-get-update-periodic" do 53 | command "apt-get update" 54 | ignore_failure true 55 | only_if do 56 | ::File.exists?('/var/lib/apt/periodic/update-success-stamp') && 57 | ::File.mtime('/var/lib/apt/periodic/update-success-stamp') < Time.now - 86400 58 | end 59 | end 60 | 61 | %w{/var/cache/local /var/cache/local/preseeding}.each do |dirname| 62 | directory dirname do 63 | owner "root" 64 | group "root" 65 | mode 00755 66 | action :create 67 | end 68 | end 69 | -------------------------------------------------------------------------------- /cookbooks/apt/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## v1.9.0: 2 | 3 | * [COOK-2185] - Proxy for apt-key 4 | * [COOK-2338] - Support pinning by glob() or regexp 5 | 6 | ## v1.8.4: 7 | 8 | * [COOK-2171] - Update README to clarify required Chef version: 10.18.0 9 | or higher. 10 | 11 | ## v1.8.2: 12 | 13 | * [COOK-2112] - need [] around "arch" in sources.list entries 14 | * [COOK-2171] - fixes a regression in the notification 15 | 16 | ## v1.8.0: 17 | 18 | * [COOK-2143] - Allow for a custom cacher-ng port 19 | * [COOK-2171] - On `apt_repository.run_action(:add)` the source file 20 | is not created. 21 | * [COOK-2184] - apt::cacher-ng, use `cacher_port` attribute in 22 | acng.conf 23 | 24 | ## v1.7.0: 25 | 26 | * [COOK-2082] - add "arch" parameter to apt_repository LWRP 27 | 28 | ## v1.6.0: 29 | 30 | * [COOK-1893] - `apt_preference` use "`package_name`" resource instead of "name" 31 | * [COOK-1894] - change filename for sources.list.d files 32 | * [COOK-1914] - Wrong dir permissions for /etc/apt/preferences.d/ 33 | * [COOK-1942] - README.md has wrong name for the keyserver attribute 34 | * [COOK-2019] - create 01proxy before any other apt-get updates get executed 35 | 36 | ## v1.5.2: 37 | 38 | * [COOK-1682] - use template instead of file resource in apt::cacher-client 39 | * [COOK-1875] - cacher-client should be Environment-aware 40 | 41 | ## V1.5.0: 42 | 43 | * [COOK-1500] - Avoid triggering apt-get update 44 | * [COOK-1548] - Add execute commands for autoclean and autoremove 45 | * [COOK-1591] - Setting up the apt proxy should leave https 46 | connections direct 47 | * [COOK-1596] - execute[apt-get-update-periodic] never runs 48 | * [COOK-1762] - create /etc/apt/preferences.d directory 49 | * [COOK-1776] - apt key check isn't idempotent 50 | 51 | ## v1.4.8: 52 | 53 | * Adds test-kitchen support 54 | * [COOK-1435] - repository lwrp is not idempotent with http key 55 | 56 | ## v1.4.6: 57 | 58 | * [COOK-1530] - apt_repository isn't aware of update-success-stamp 59 | file (also reverts COOK-1382 patch). 60 | 61 | ## v1.4.4: 62 | 63 | * [COOK-1229] - Allow cacher IP to be set manually in non-Chef Solo 64 | environments 65 | * [COOK-1530] - Immediately update apt-cache when sources.list file is dropped off 66 | 67 | ## v1.4.2: 68 | 69 | * [COOK-1155] - LWRP for apt pinning 70 | 71 | ## v1.4.0: 72 | 73 | * [COOK-889] - overwrite existing repo source files 74 | * [COOK-921] - optionally use cookbook\_file or remote\_file for key 75 | * [COOK-1032] - fixes problem with apt repository key installation 76 | -------------------------------------------------------------------------------- /cookbooks/build-essential/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: build-essential 3 | # Recipe:: default 4 | # 5 | # Copyright 2008-2009, 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 | require 'chef/shell_out' 21 | 22 | compiletime = node['build_essential']['compiletime'] 23 | 24 | case node['platform_family'] 25 | when "rhel", "suse", "fedora", "debian" 26 | 27 | # on apt-based platforms when first provisioning we need to force 28 | # apt-get update at compiletime if we are going to try to install at compiletime 29 | if node['platform_family'] == "debian" 30 | execute "apt-get-update-build-essentials" do 31 | command "apt-get update" 32 | action :nothing 33 | # tip: to suppress this running every time, just use the apt cookbook 34 | not_if do 35 | ::File.exists?('/var/lib/apt/periodic/update-success-stamp') && 36 | ::File.mtime('/var/lib/apt/periodic/update-success-stamp') > Time.now - 86400*2 37 | end 38 | end.run_action(:run) if compiletime 39 | end 40 | 41 | packages = case node['platform_family'] 42 | when "debian" 43 | %w{build-essential binutils-doc} 44 | when "rhel", "fedora" 45 | %w{gcc gcc-c++ kernel-devel make} 46 | when "suse" 47 | %w{gcc gcc-c++ kernel-default-devel make m4} # in SLES there is no kernel-devel 48 | end 49 | 50 | packages.each do |pkg| 51 | r = package pkg do 52 | action ( compiletime ? :nothing : :install ) 53 | end 54 | r.run_action(:install) if compiletime 55 | end 56 | 57 | %w{autoconf flex bison}.each do |pkg| 58 | r = package pkg do 59 | action ( compiletime ? :nothing : :install ) 60 | end 61 | r.run_action(:install) if compiletime 62 | end 63 | 64 | when "smartos" 65 | include_recipe 'pkgin' 66 | %w{gcc47 gcc47-runtime scmgit-base gmake pkg-config binutils}.each do |package| 67 | pkgin_package package do 68 | action :install 69 | end 70 | end 71 | 72 | when "mac_os_x" 73 | result = Chef::ShellOut.new("pkgutil --pkgs").run_command 74 | osx_gcc_installer_installed = result.stdout.split("\n").include?("com.apple.pkg.gcc4.2Leo") 75 | developer_tools_cli_installed = result.stdout.split("\n").include?("com.apple.pkg.DeveloperToolsCLI") 76 | pkg_filename = File.basename(node['build_essential']['osx']['gcc_installer_url']) 77 | pkg_path = "#{Chef::Config[:file_cache_path]}/#{pkg_filename}" 78 | 79 | r = remote_file pkg_path do 80 | source node['build_essential']['osx']['gcc_installer_url'] 81 | checksum node['build_essential']['osx']['gcc_installer_checksum'] 82 | action ( compiletime ? :nothing : :create ) 83 | not_if { osx_gcc_installer_installed or developer_tools_cli_installed } 84 | end 85 | r.run_action(:create) if compiletime 86 | 87 | r = execute "sudo installer -pkg \"#{pkg_path}\" -target /" do 88 | action ( compiletime ? :nothing : :run ) 89 | not_if { osx_gcc_installer_installed or developer_tools_cli_installed } 90 | end 91 | r.run_action(:run) if compiletime 92 | end 93 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant::Config.run do |config| 5 | # All Vagrant configuration is done here. The most common configuration 6 | # options are documented and commented below. For a complete reference, 7 | # please see the online documentation at vagrantup.com. 8 | 9 | # Every Vagrant virtual environment requires a box to build off of. 10 | config.vm.box = "precise64" 11 | 12 | # The url from where the 'config.vm.box' box will be fetched if it 13 | # doesn't already exist on the user's system. 14 | # config.vm.box_url = "http://domain.com/path/to/above.box" 15 | 16 | # Boot with a GUI so you can see the screen. (Default is headless) 17 | # config.vm.boot_mode = :gui 18 | 19 | # Assign this VM to a host-only network IP, allowing you to access it 20 | # via the IP. Host-only networks can talk to the host machine as well as 21 | # any other machines on the same network, but cannot be accessed (through this 22 | # network interface) by any external networks. 23 | # config.vm.network :hostonly, "192.168.33.10" 24 | 25 | # Assign this VM to a bridged network, allowing you to connect directly to a 26 | # network using the host's network device. This makes the VM appear as another 27 | # physical device on your network. 28 | # config.vm.network :bridged 29 | 30 | # Forward a port from the guest to the host, which allows for outside 31 | # computers to access the VM, whereas host only networking does not. 32 | # config.vm.forward_port 80, 8080 33 | 34 | # Share an additional folder to the guest VM. The first argument is 35 | # an identifier, the second is the path on the guest to mount the 36 | # folder, and the third is the path on the host to the actual folder. 37 | # config.vm.share_folder "v-data", "/vagrant_data", "../data" 38 | 39 | # Enable provisioning with Puppet stand alone. Puppet manifests 40 | # are contained in a directory path relative to this Vagrantfile. 41 | # You will need to create the manifests directory and a manifest in 42 | # the file base.pp in the manifests_path directory. 43 | # 44 | # An example Puppet manifest to provision the message of the day: 45 | # 46 | # # group { "puppet": 47 | # # ensure => "present", 48 | # # } 49 | # # 50 | # # File { owner => 0, group => 0, mode => 0644 } 51 | # # 52 | # # file { '/etc/motd': 53 | # # content => "Welcome to your Vagrant-built virtual machine! 54 | # # Managed by Puppet.\n" 55 | # # } 56 | # 57 | # config.vm.provision :puppet do |puppet| 58 | # puppet.manifests_path = "manifests" 59 | # puppet.manifest_file = "base.pp" 60 | # end 61 | 62 | # Enable provisioning with chef solo, specifying a cookbooks path, roles 63 | # path, and data_bags path (all relative to this Vagrantfile), and adding 64 | # some recipes and/or roles. 65 | # 66 | # config.vm.provision :chef_solo do |chef| 67 | # chef.cookbooks_path = "../my-recipes/cookbooks" 68 | # chef.roles_path = "../my-recipes/roles" 69 | # chef.data_bags_path = "../my-recipes/data_bags" 70 | # chef.add_recipe "mysql" 71 | # chef.add_role "web" 72 | # 73 | # # You may also specify custom JSON attributes: 74 | # chef.json = { :mysql_password => "foo" } 75 | # end 76 | 77 | config.vm.provision :chef_solo do |chef| 78 | chef.cookbooks_path = "cookbooks" 79 | chef.add_recipe "vagrant_main" 80 | end 81 | 82 | # Enable provisioning with chef server, specifying the chef server URL, 83 | # and the path to the validation key (relative to this Vagrantfile). 84 | # 85 | # The Opscode Platform uses HTTPS. Substitute your organization for 86 | # ORGNAME in the URL and validation key. 87 | # 88 | # If you have your own Chef Server, use the appropriate URL, which may be 89 | # HTTP instead of HTTPS depending on your configuration. Also change the 90 | # validation key to validation.pem. 91 | # 92 | # config.vm.provision :chef_client do |chef| 93 | # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME" 94 | # chef.validation_key_path = "ORGNAME-validator.pem" 95 | # end 96 | # 97 | # If you're using the Opscode platform, your validator client is 98 | # ORGNAME-validator, replacing ORGNAME with your organization name. 99 | # 100 | # IF you have your own Chef Server, the default validation client name is 101 | # chef-validator, unless you changed the configuration. 102 | # 103 | # chef.validation_client_name = "ORGNAME-validator" 104 | end 105 | -------------------------------------------------------------------------------- /cookbooks/apt/providers/repository.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: apt 3 | # Provider:: repository 4 | # 5 | # Copyright 2010-2011, 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 | def whyrun_supported? 21 | true 22 | end 23 | 24 | # install apt key from keyserver 25 | def install_key_from_keyserver(key, keyserver) 26 | execute "install-key #{key}" do 27 | if !node['apt']['key_proxy'].empty? 28 | command "apt-key adv --keyserver-options http-proxy=#{node['apt']['key_proxy']} --keyserver #{keyserver} --recv #{key}" 29 | else 30 | command "apt-key adv --keyserver #{keyserver} --recv #{key}" 31 | end 32 | action :run 33 | not_if "apt-key list | grep #{key}" 34 | end 35 | end 36 | 37 | # run command and extract gpg ids 38 | def extract_gpg_ids_from_cmd(cmd) 39 | so = Mixlib::ShellOut.new(cmd) 40 | so.run_command 41 | so.stdout.split(/\n/).collect do |t| 42 | if z = t.match(/^pub\s+\d+\w\/([0-9A-F]{8})/) 43 | z[1] 44 | end 45 | end.compact 46 | end 47 | 48 | # install apt key from URI 49 | def install_key_from_uri(uri) 50 | key_name = uri.split(/\//).last 51 | cached_keyfile = "#{Chef::Config[:file_cache_path]}/#{key_name}" 52 | if new_resource.key =~ /http/ 53 | remote_file cached_keyfile do 54 | source new_resource.key 55 | mode 00644 56 | action :create 57 | end 58 | else 59 | cookbook_file cached_keyfile do 60 | source new_resource.key 61 | cookbook new_resource.cookbook 62 | mode 00644 63 | action :create 64 | end 65 | end 66 | 67 | execute "install-key #{key_name}" do 68 | command "apt-key add #{cached_keyfile}" 69 | action :run 70 | not_if do 71 | installed_ids = extract_gpg_ids_from_cmd("apt-key finger") 72 | key_ids = extract_gpg_ids_from_cmd("gpg --with-fingerprint #{cached_keyfile}") 73 | (installed_ids & key_ids).sort == key_ids.sort 74 | end 75 | end 76 | end 77 | 78 | # build repo file contents 79 | def build_repo(uri, distribution, components, arch, add_deb_src) 80 | components = components.join(' ') if components.respond_to?(:join) 81 | repo_info = "#{uri} #{distribution} #{components}\n" 82 | repo_info = "[arch=#{arch}] #{repo_info}" if arch 83 | repo = "deb #{repo_info}" 84 | repo << "deb-src #{repo_info}" if add_deb_src 85 | repo 86 | end 87 | 88 | action :add do 89 | new_resource.updated_by_last_action(false) 90 | @repo_file = nil 91 | 92 | recipe_eval do 93 | # add key 94 | if new_resource.keyserver && new_resource.key 95 | install_key_from_keyserver(new_resource.key, new_resource.keyserver) 96 | elsif new_resource.key 97 | install_key_from_uri(new_resource.key) 98 | end 99 | 100 | file "/var/lib/apt/periodic/update-success-stamp" do 101 | action :nothing 102 | end 103 | 104 | execute "apt-get update" do 105 | ignore_failure true 106 | action :nothing 107 | end 108 | 109 | # build repo file 110 | repository = build_repo(new_resource.uri, 111 | new_resource.distribution, 112 | new_resource.components, 113 | new_resource.arch, 114 | new_resource.deb_src) 115 | 116 | @repo_file = file "/etc/apt/sources.list.d/#{new_resource.name}.list" do 117 | owner "root" 118 | group "root" 119 | mode 00644 120 | content repository 121 | action :create 122 | notifies :delete, "file[/var/lib/apt/periodic/update-success-stamp]", :immediately 123 | notifies :run, "execute[apt-get update]", :immediately if new_resource.cache_rebuild 124 | end 125 | end 126 | 127 | raise RuntimeError, "The repository file to create is nil, cannot continue." if @repo_file.nil? 128 | new_resource.updated_by_last_action(@repo_file.updated?) 129 | end 130 | 131 | action :remove do 132 | if ::File.exists?("/etc/apt/sources.list.d/#{new_resource.name}.list") 133 | Chef::Log.info "Removing #{new_resource.name} repository from /etc/apt/sources.list.d/" 134 | file "/etc/apt/sources.list.d/#{new_resource.name}.list" do 135 | action :delete 136 | end 137 | end 138 | end 139 | -------------------------------------------------------------------------------- /cookbooks/build-essential/README.md: -------------------------------------------------------------------------------- 1 | Description 2 | =========== 3 | 4 | Installs packages required for compiling C software from source. Use 5 | this cookbook if you wish to compile C programs, or install RubyGems 6 | with native extensions. 7 | 8 | Requirements 9 | ============ 10 | 11 | Chef version 0.10.10+ and Ohai 0.6.12+ are required. 12 | 13 | ## Platform 14 | 15 | Supported platforms by platform family: 16 | 17 | * Linux (fedora redhat centos ubuntu debian amazon scientific) 18 | * Darwin (`mac_os_x` 10.6+) 19 | * SmartOs 20 | 21 | ## Cookbooks 22 | 23 | Requires `pkgin` cookbook on SmartOS 24 | 25 | Attributes 26 | ========== 27 | 28 | * `node['build_essential']['compiletime']` - Whether the resources in 29 | the default recipe should be configured at the "Compile" phase of the 30 | Chef run. Defaults to false, see __Usage__ for more information. 31 | * `node['build_essential']['osx']['gcc_installer_url']` - The URL of 32 | the OS X GCC package installer (.pkg). 33 | * `node['build_essential']['osx']['gcc_installer_checksum']` - The 34 | SHA256 checksum of the OS X GCC installer. 35 | 36 | Recipes 37 | ======= 38 | 39 | This cookbook has one recipe, default. 40 | 41 | On Linux platforms (see __Platform__ above for a supported list of 42 | families), packages required to build C source projects are installed. 43 | This includes GCC, make, autconf and others. On Debian-family 44 | distributions, the apt-cache may need to be updated, especially during 45 | compile time installation. See __Usage__ for further information. 46 | 47 | On Mac OS X, the GCC standalone installer by Kenneth Reitz is 48 | installed. Note that this is *not* the Xcode CLI package, as that does 49 | not include all programs and headers required to build some common 50 | GNU-style C projects, such as those that are available from projects 51 | such as MacPorts or Homebrew. Changing the attributes for the GCC 52 | installer URL and checksum to the Xcode values may work, but this is 53 | untested. 54 | 55 | Usage 56 | ===== 57 | 58 | Simply include the `build-essential` and the required tools will be 59 | installed to the system, and later recipes will be able to compile 60 | software from C source code. 61 | 62 | For RubyGems that include native C extensions you wish to use with 63 | Chef, you should do two things. 64 | 65 | 0. Ensure that the C libraries, include files and other assorted "dev" 66 | type packages are installed. You should do this in the compile phase 67 | after the build-essential recipe. 68 | 1. Use the `chef_gem` resource in your recipes. This requires Chef version 0.10.10+. 69 | 2. Set the `compiletime` attribute in roles where such recipes are 70 | required. This will ensure that the build tools are available to 71 | compile the RubyGems' extensions, as `chef_gem` happens during the 72 | compile phase, too. 73 | 74 | Example installation of a devel package at compile-time in a recipe: 75 | 76 | package "mypackage-dev" do 77 | action :nothing 78 | end.run_action(:install) 79 | 80 | Example use of `chef_gem`: 81 | 82 | chef_gem "mygem" 83 | 84 | Example role: 85 | 86 | name "myapp" 87 | run_list( 88 | "recipe[build-essential]", 89 | "recipe[myapp]" 90 | ) 91 | default_attributes( 92 | "build_essential" => { 93 | "compiletime" => true 94 | } 95 | ) 96 | 97 | The compile time option (via the attribute) is to ensure that the 98 | proper packages are available at the right time in the Chef run. It is 99 | recommended that the build-essential recipe appear early in the run 100 | list. 101 | 102 | The Chef wiki has documentation on 103 | [the anatomy of a chef run](http://wiki.opscode.com/display/chef/Anatomy+of+a+Chef+Run). 104 | 105 | Limitations 106 | =========== 107 | 108 | It is not in the scope of this cookbook to handle installing the 109 | required headers for individual software projects in order to compile 110 | them, or to compile RubyGems with native C extensions. You should 111 | create a cookbook for handling that. 112 | 113 | License and Author 114 | ================== 115 | 116 | Author:: Joshua Timberman () 117 | Author:: Seth Chisamore () 118 | 119 | Copyright 2009-2011, Opscode, Inc. () 120 | 121 | Licensed under the Apache License, Version 2.0 (the "License"); 122 | you may not use this file except in compliance with the License. 123 | You may obtain a copy of the License at 124 | 125 | http://www.apache.org/licenses/LICENSE-2.0 126 | 127 | Unless required by applicable law or agreed to in writing, software 128 | distributed under the License is distributed on an "AS IS" BASIS, 129 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 130 | See the License for the specific language governing permissions and 131 | limitations under the License. 132 | -------------------------------------------------------------------------------- /cookbooks/apt/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "apt", 3 | "description": "Configures apt and apt services and LWRPs for managing apt repositories and preferences", 4 | "long_description": "Description\n===========\n\nThis cookbook includes recipes to execute apt-get update to ensure the\nlocal APT package cache is up to date. There are recipes for managing\nthe apt-cacher-ng caching proxy and proxy clients. It also includes a\nLWRP for managing APT repositories in /etc/apt/sources.list.d as well as\nan LWRP for pinning packages via /etc/apt/preferences.d.\n\nRequirements\n============\n\nVersion 1.8.2+ 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\nthis cookbook.\n\nSee [CHEF-3493](http://tickets.opscode.com/browse/CHEF-3493) and\n[this code comment](http://bit.ly/VgvCgf) for more information on this\nrequirement.\n\nPlatform\n--------\n\n* Debian\n* Ubuntu\n\nMay work with or without modification on other Debian derivatives.\n\nRecipes\n=======\n\ndefault\n-------\n\nThis recipe installs the `update-notifier-common` package to provide\nthe timestamp file used to only run `apt-get update` if the cache is\nmore than one day old.\n\nThis recipe should appear first in the run list of Debian or Ubuntu\nnodes to ensure that the package cache is up to date before managing\nany `package` resources with Chef.\n\nThis recipe also sets up a local cache directory for preseeding packages.\n\ncacher-ng\n---------\n\nInstalls the `apt-cacher-ng` package and service so the system can\nprovide APT caching. You can check the usage report at\nhttp://{hostname}:3142/acng-report.html. The `cacher-ng` recipe\nincludes the `cacher-client` recipe, so it helps seed itself.\n\ncacher-client\n-------------\nConfigures the node to use the `apt-cacher-ng` server as a client. If you\nwant to restrict your node to using the `apt-cacher-ng` server in your\nEnvironment, set `['apt']['cacher-client']['restrict_environment']` to `true`.\nTo use a cacher server (or standard proxy server) not available via search\nset the atttribute `['apt']['cacher-ipaddress']` and for a custom port\nset `['apt']['cacher_port']`\n\nResources/Providers\n===================\n\nManaging repositories\n---------------------\n\nThis LWRP provides an easy way to manage additional APT repositories.\nAdding a new repository will notify running the `execute[apt-get-update]`\nresource immediately.\n\n# Actions\n\n- :add: creates a repository file and builds the repository listing\n- :remove: removes the repository file\n\n# Attribute Parameters\n\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\n like `karmic`, `lucid` or `maverick`\n- components: package groupings..when it doubt use `main`\n- arch: constrain package to a particular arch like `i386`, `amd64` or\n even `armhf` or `powerpc`. Defaults to nil.\n- deb_src: whether or not to add the repository as a source repo as\n 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\n fingerprint, otherwise it can be either the URI to the GPG key for\n 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\n the key is located for files/default. Defaults to nil, so it will\n use the cookbook where the resource is used.\n\n# Examples\n\n # add the Zenoss repo\n apt_repository \"zenoss\" do\n uri \"http://dev.zenoss.org/deb\"\n components [\"main\",\"stable\"]\n end\n\n # add the Nginx PPA; grab key from keyserver\n apt_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 end\n\n # add the Nginx PPA; grab key from keyserver, also add source repo\n apt_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\n end\n\n # add the Cloudkick Repo\n apt_repository \"cloudkick\" do\n uri \"http://packages.cloudkick.com/ubuntu\"\n distribution node['lsb']['codename']\n components [\"main\"]\n key \"http://packages.cloudkick.com/cloudkick.packages.key\"\n end\n\n # add the Cloudkick Repo with the key downloaded in the cookbook\n apt_repository \"cloudkick\" do\n uri \"http://packages.cloudkick.com/ubuntu\"\n distribution node['lsb']['codename']\n components [\"main\"]\n key \"cloudkick.packages.key\"\n end\n\n # add the Cloudera Repo of CDH4 packages for Ubuntu 12.04 on AMD64\n apt_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\"\n end\n\n # remove Zenoss repo\n apt_repository \"zenoss\" do\n action :remove\n end\n\nPinning packages\n----------------\n\nThis LWRP provides an easy way to pin packages in /etc/apt/preferences.d.\nAlthough apt-pinning is quite helpful from time to time please note that Debian\ndoes not encourage its use without thorough consideration.\n\nFurther information regarding apt-pinning is available via\nhttp://wiki.debian.org/AptPreferences.\n\n# Actions\n\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\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\n\n # Pin libmysqlclient16 to version 5.1.49-3\n apt_preference \"libmysqlclient16\" do\n pin \"version 5.1.49-3\"\n pin_priority \"700\"\n end\n\n # Unpin libmysqlclient16\n apt_preference \"libmysqlclient16\" do\n action :remove\n end\n\n # Pin all packages from dotdeb.org\n apt_preference \"dotdeb\" do\n glob \"*\"\n pin \"origin packages.dotdeb.org \"\n pin_priority \"700\"\n end\n\nUsage\n=====\n\nPut `recipe[apt]` first in the run list. If you have other recipes\nthat you want to use to configure how apt behaves, like new sources,\nnotify the execute resource to run, e.g.:\n\n template \"/etc/apt/sources.list.d/my_apt_sources.list\" do\n notifies :run, resources(:execute => \"apt-get update\"), :immediately\n end\n\nThe above will run during execution phase since it is a normal\ntemplate resource, and should appear before other package resources\nthat need the sources in the template.\n\nPut `recipe[apt::cacher-ng]` in the run_list for a server to provide\nAPT caching and add `recipe[apt::cacher-client]` on the rest of the\nDebian-based nodes to take advantage of the caching server.\n\nIf you want to cleanup unused packages, there is also the `apt-get autoclean`\nand `apt-get autoremove` resources provided for automated cleanup.\n\nLicense and Author\n==================\n\nAuthor:: Joshua Timberman ()\nAuthor:: Matt Ray ()\nAuthor:: Seth Chisamore ()\n\nCopyright 2009-2012 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", 5 | "maintainer": "Opscode, Inc.", 6 | "maintainer_email": "cookbooks@opscode.com", 7 | "license": "Apache 2.0", 8 | "platforms": { 9 | "ubuntu": ">= 0.0.0", 10 | "debian": ">= 0.0.0" 11 | }, 12 | "dependencies": { 13 | }, 14 | "recommendations": { 15 | }, 16 | "suggestions": { 17 | }, 18 | "conflicting": { 19 | }, 20 | "providing": { 21 | }, 22 | "replacing": { 23 | }, 24 | "attributes": { 25 | }, 26 | "groupings": { 27 | }, 28 | "recipes": { 29 | "apt": "Runs apt-get update during compile phase and sets up preseed directories", 30 | "apt::cacher-ng": "Set up an apt-cacher-ng caching proxy", 31 | "apt::cacher-client": "Client for the apt::cacher-ng caching proxy" 32 | }, 33 | "version": "1.9.0" 34 | } -------------------------------------------------------------------------------- /cookbooks/apt/README.md: -------------------------------------------------------------------------------- 1 | Description 2 | =========== 3 | 4 | This cookbook includes recipes to execute apt-get update to ensure the 5 | local APT package cache is up to date. There are recipes for managing 6 | the apt-cacher-ng caching proxy and proxy clients. It also includes a 7 | LWRP for managing APT repositories in /etc/apt/sources.list.d as well as 8 | an LWRP for pinning packages via /etc/apt/preferences.d. 9 | 10 | Requirements 11 | ============ 12 | 13 | Version 1.8.2+ of this cookbook requires **Chef 10.16.4** or later. 14 | 15 | If your Chef version is earlier than 10.16.4, use version 1.7.0 of 16 | this cookbook. 17 | 18 | See [CHEF-3493](http://tickets.opscode.com/browse/CHEF-3493) and 19 | [this code comment](http://bit.ly/VgvCgf) for more information on this 20 | requirement. 21 | 22 | Platform 23 | -------- 24 | 25 | * Debian 26 | * Ubuntu 27 | 28 | May work with or without modification on other Debian derivatives. 29 | 30 | Recipes 31 | ======= 32 | 33 | default 34 | ------- 35 | 36 | This recipe installs the `update-notifier-common` package to provide 37 | the timestamp file used to only run `apt-get update` if the cache is 38 | more than one day old. 39 | 40 | This recipe should appear first in the run list of Debian or Ubuntu 41 | nodes to ensure that the package cache is up to date before managing 42 | any `package` resources with Chef. 43 | 44 | This recipe also sets up a local cache directory for preseeding packages. 45 | 46 | cacher-ng 47 | --------- 48 | 49 | Installs the `apt-cacher-ng` package and service so the system can 50 | provide APT caching. You can check the usage report at 51 | http://{hostname}:3142/acng-report.html. The `cacher-ng` recipe 52 | includes the `cacher-client` recipe, so it helps seed itself. 53 | 54 | cacher-client 55 | ------------- 56 | Configures the node to use the `apt-cacher-ng` server as a client. If you 57 | want to restrict your node to using the `apt-cacher-ng` server in your 58 | Environment, set `['apt']['cacher-client']['restrict_environment']` to `true`. 59 | To use a cacher server (or standard proxy server) not available via search 60 | set the atttribute `['apt']['cacher-ipaddress']` and for a custom port 61 | set `['apt']['cacher_port']` 62 | 63 | Resources/Providers 64 | =================== 65 | 66 | Managing repositories 67 | --------------------- 68 | 69 | This LWRP provides an easy way to manage additional APT repositories. 70 | Adding a new repository will notify running the `execute[apt-get-update]` 71 | resource immediately. 72 | 73 | # Actions 74 | 75 | - :add: creates a repository file and builds the repository listing 76 | - :remove: removes the repository file 77 | 78 | # Attribute Parameters 79 | 80 | - repo_name: name attribute. The name of the channel to discover 81 | - uri: the base of the Debian distribution 82 | - distribution: this is usually your release's codename...ie something 83 | like `karmic`, `lucid` or `maverick` 84 | - components: package groupings..when it doubt use `main` 85 | - arch: constrain package to a particular arch like `i386`, `amd64` or 86 | even `armhf` or `powerpc`. Defaults to nil. 87 | - deb_src: whether or not to add the repository as a source repo as 88 | well - value can be `true` or `false`, default `false`. 89 | - keyserver: the GPG keyserver where the key for the repo should be retrieved 90 | - key: if a `keyserver` is provided, this is assumed to be the 91 | fingerprint, otherwise it can be either the URI to the GPG key for 92 | the repo, or a cookbook_file. 93 | - key_proxy: if set, pass the specified proxy via `http-proxy=` to GPG. 94 | - cookbook: if key should be a cookbook_file, specify a cookbook where 95 | the key is located for files/default. Defaults to nil, so it will 96 | use the cookbook where the resource is used. 97 | 98 | # Examples 99 | 100 | # add the Zenoss repo 101 | apt_repository "zenoss" do 102 | uri "http://dev.zenoss.org/deb" 103 | components ["main","stable"] 104 | end 105 | 106 | # add the Nginx PPA; grab key from keyserver 107 | apt_repository "nginx-php" do 108 | uri "http://ppa.launchpad.net/nginx/php5/ubuntu" 109 | distribution node['lsb']['codename'] 110 | components ["main"] 111 | keyserver "keyserver.ubuntu.com" 112 | key "C300EE8C" 113 | end 114 | 115 | # add the Nginx PPA; grab key from keyserver, also add source repo 116 | apt_repository "nginx-php" do 117 | uri "http://ppa.launchpad.net/nginx/php5/ubuntu" 118 | distribution node['lsb']['codename'] 119 | components ["main"] 120 | keyserver "keyserver.ubuntu.com" 121 | key "C300EE8C" 122 | deb_src true 123 | end 124 | 125 | # add the Cloudkick Repo 126 | apt_repository "cloudkick" do 127 | uri "http://packages.cloudkick.com/ubuntu" 128 | distribution node['lsb']['codename'] 129 | components ["main"] 130 | key "http://packages.cloudkick.com/cloudkick.packages.key" 131 | end 132 | 133 | # add the Cloudkick Repo with the key downloaded in the cookbook 134 | apt_repository "cloudkick" do 135 | uri "http://packages.cloudkick.com/ubuntu" 136 | distribution node['lsb']['codename'] 137 | components ["main"] 138 | key "cloudkick.packages.key" 139 | end 140 | 141 | # add the Cloudera Repo of CDH4 packages for Ubuntu 12.04 on AMD64 142 | apt_repository "cloudera" do 143 | uri "http://archive.cloudera.com/cdh4/ubuntu/precise/amd64/cdh" 144 | arch "amd64" 145 | distribution "precise-cdh4" 146 | components ["contrib"] 147 | key "http://archive.cloudera.com/debian/archive.key" 148 | end 149 | 150 | # remove Zenoss repo 151 | apt_repository "zenoss" do 152 | action :remove 153 | end 154 | 155 | Pinning packages 156 | ---------------- 157 | 158 | This LWRP provides an easy way to pin packages in /etc/apt/preferences.d. 159 | Although apt-pinning is quite helpful from time to time please note that Debian 160 | does not encourage its use without thorough consideration. 161 | 162 | Further information regarding apt-pinning is available via 163 | http://wiki.debian.org/AptPreferences. 164 | 165 | # Actions 166 | 167 | - :add: creates a preferences file under /etc/apt/preferences.d 168 | - :remove: Removes the file, therefore unpin the package 169 | 170 | # Attribute Parameters 171 | 172 | - package_name: name attribute. The name of the package 173 | - glob: Pin by glob() expression or regexp surrounded by /. 174 | - pin: The package version/repository to pin 175 | - pin_priority: The pinning priority aka "the highest package version wins" 176 | 177 | # Examples 178 | 179 | # Pin libmysqlclient16 to version 5.1.49-3 180 | apt_preference "libmysqlclient16" do 181 | pin "version 5.1.49-3" 182 | pin_priority "700" 183 | end 184 | 185 | # Unpin libmysqlclient16 186 | apt_preference "libmysqlclient16" do 187 | action :remove 188 | end 189 | 190 | # Pin all packages from dotdeb.org 191 | apt_preference "dotdeb" do 192 | glob "*" 193 | pin "origin packages.dotdeb.org " 194 | pin_priority "700" 195 | end 196 | 197 | Usage 198 | ===== 199 | 200 | Put `recipe[apt]` first in the run list. If you have other recipes 201 | that you want to use to configure how apt behaves, like new sources, 202 | notify the execute resource to run, e.g.: 203 | 204 | template "/etc/apt/sources.list.d/my_apt_sources.list" do 205 | notifies :run, resources(:execute => "apt-get update"), :immediately 206 | end 207 | 208 | The above will run during execution phase since it is a normal 209 | template resource, and should appear before other package resources 210 | that need the sources in the template. 211 | 212 | Put `recipe[apt::cacher-ng]` in the run_list for a server to provide 213 | APT caching and add `recipe[apt::cacher-client]` on the rest of the 214 | Debian-based nodes to take advantage of the caching server. 215 | 216 | If you want to cleanup unused packages, there is also the `apt-get autoclean` 217 | and `apt-get autoremove` resources provided for automated cleanup. 218 | 219 | License and Author 220 | ================== 221 | 222 | Author:: Joshua Timberman () 223 | Author:: Matt Ray () 224 | Author:: Seth Chisamore () 225 | 226 | Copyright 2009-2012 Opscode, Inc. 227 | 228 | Licensed under the Apache License, Version 2.0 (the "License"); 229 | you may not use this file except in compliance with the License. 230 | You may obtain a copy of the License at 231 | 232 | http://www.apache.org/licenses/LICENSE-2.0 233 | 234 | Unless required by applicable law or agreed to in writing, software 235 | distributed under the License is distributed on an "AS IS" BASIS, 236 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 237 | See the License for the specific language governing permissions and 238 | limitations under the License. 239 | -------------------------------------------------------------------------------- /cookbooks/apt/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /cookbooks/build-essential/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /cookbooks/apt/templates/default/acng.conf.erb: -------------------------------------------------------------------------------- 1 | 2 | # Letter case in directive names does not matter. Must be separated with colons. 3 | # Valid boolean values are a zero number for false, non-zero numbers for true. 4 | 5 | CacheDir: /var/cache/apt-cacher-ng 6 | 7 | # set empty to disable logging 8 | LogDir: /var/log/apt-cacher-ng 9 | 10 | # place to look for additional configuration and resource files if they are not 11 | # found in the configuration directory 12 | # SupportDir: /usr/lib/apt-cacher-ng 13 | 14 | # TCP (http) port 15 | # Set to 9999 to emulate apt-proxy 16 | Port:<%= node['apt']['cacher_port'] %> 17 | 18 | # Addresses or hostnames to listen on. Multiple addresses must be separated by 19 | # spaces. Each entry must be an exact local address which is associated with a 20 | # local interface. DNS resolution is performed using getaddrinfo(3) for all 21 | # available protocols (IPv4, IPv6, ...). Using a protocol specific format will 22 | # create binding(s) only on protocol specific socket(s) (e.g. 0.0.0.0 will listen 23 | # only to IPv4). 24 | # 25 | # Default: not set, will listen on all interfaces and protocols 26 | # 27 | # BindAddress: localhost 192.168.7.254 publicNameOnMainInterface 28 | 29 | # The specification of another proxy which shall be used for downloads. 30 | # Username and password are, and see manual for limitations. 31 | # 32 | #Proxy: http://www-proxy.example.net:80 33 | #proxy: username:proxypassword@proxy.example.net:3128 34 | 35 | # Repository remapping. See manual for details. 36 | # In this example, some backends files might be generated during package 37 | # installation using information collected on the system. 38 | Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian # Debian Archives 39 | Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu # Ubuntu Archives 40 | Remap-debvol: file:debvol_mirror*.gz /debian-volatile ; file:backends_debvol # Debian Volatile Archives 41 | Remap-cygwin: file:cygwin_mirrors /cygwin # ; file:backends_cygwin # incomplete, please create this file or specify preferred mirrors here 42 | Remap-sfnet: file:sfnet_mirrors # ; file:backends_sfnet # incomplete, please create this file or specify preferred mirrors here 43 | Remap-alxrep: file:archlx_mirrors /archlinux # ; file:backend_archlx # Arch Linux 44 | Remap-fedora: file:fedora_mirrors # Fedora Linux 45 | Remap-epel: file:epel_mirrors # Fedora EPEL 46 | Remap-slrep: file:sl_mirrors # Scientific Linux 47 | 48 | # This is usually not needed for security.debian.org because it's always the 49 | # same DNS hostname. However, it might be enabled in order to use hooks, 50 | # ForceManaged mode or special flags in this context. 51 | # Remap-secdeb: security.debian.org 52 | 53 | # Virtual page accessible in a web browser to see statistics and status 54 | # information, i.e. under http://localhost:3142/acng-report.html 55 | ReportPage: acng-report.html 56 | 57 | # Socket file for accessing through local UNIX socket instead of TCP/IP. Can be 58 | # used with inetd bridge or cron client. 59 | # SocketPath:/var/run/apt-cacher-ng/socket 60 | 61 | # Forces log file to be written to disk after every line when set to 1. Default 62 | # is 0, buffers are flushed when the client disconnects. 63 | # 64 | # (technically, alias to the Debug option, see its documentation for details) 65 | # 66 | # UnbufferLogs: 0 67 | 68 | # Set to 0 to store only type, time and transfer sizes. 69 | # 1 -> client IP and relative local path are logged too 70 | # VerboseLog: 1 71 | 72 | # Don't detach from the console 73 | # ForeGround: 0 74 | 75 | # Store the pid of the daemon process therein 76 | # PidFile: /var/run/apt-cacher-ng/pid 77 | 78 | # Forbid outgoing connections, work around them or respond with 503 error 79 | # offlinemode:0 80 | 81 | # Forbid all downloads that don't run through preconfigured backends (.where) 82 | #ForceManaged: 0 83 | 84 | # Days before considering an unreferenced file expired (to be deleted). 85 | # Warning: if the value is set too low and particular index files are not 86 | # available for some days (mirror downtime) there is a risk of deletion of 87 | # still useful package files. 88 | ExTreshold: 4 89 | 90 | # Stop expiration when a critical problem appeared. Currently only failed 91 | # refresh of an index file is considered as critical. 92 | # 93 | # WARNING: don't touch this option or set to zero. 94 | # Anything else is DANGEROUS and may cause data loss. 95 | # 96 | # ExAbortOnProblems: 1 97 | 98 | # Replace some Windows/DOS-FS incompatible chars when storing 99 | # StupidFs: 0 100 | 101 | # Experimental feature for apt-listbugs: pass-through SOAP requests and 102 | # responses to/from bugs.debian.org. If not set, default is true if 103 | # ForceManaged is enabled and false otherwise. 104 | # ForwardBtsSoap: 1 105 | 106 | # The daemon has a small cache for DNS data, to speed up resolution. The 107 | # expiration time of the DNS entries can be configured in seconds. 108 | # DnsCacheSeconds: 3600 109 | 110 | # Don't touch the following values without good consideration! 111 | # 112 | # Max. count of connection threads kept ready (for faster response in the 113 | # future). Should be a sane value between 0 and average number of connections, 114 | # and depend on the amount of spare RAM. 115 | # MaxStandbyConThreads: 8 116 | # 117 | # Hard limit of active thread count for incoming connections, i.e. operation 118 | # is refused when this value is reached (below zero = unlimited). 119 | # MaxConThreads: -1 120 | # 121 | # Pigeonholing files with regular expressions (static/volatile). Can be 122 | # overriden here but not should not be done permanently because future update 123 | # of default settings would not be applied later. 124 | # VfilePattern = (^|.*?/)(Index|Packages(\.gz|\.bz2|\.lzma|\.xz)?|InRelease|Release|Release\.gpg|Sources(\.gz|\.bz2|\.lzma|\.xz)?|release|index\.db-.*\.gz|Contents-[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|pkglist[^/]*\.bz2|rclist[^/]*\.bz2|/meta-release[^/]*|Translation[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|MD5SUMS|SHA1SUMS|((setup|setup-legacy)(\.ini|\.bz2|\.hint)(\.sig)?)|mirrors\.lst|repo(index|md)\.xml(\.asc|\.key)?|directory\.yast|products|content(\.asc|\.key)?|media|filelists\.xml\.gz|filelists\.sqlite\.bz2|repomd\.xml|packages\.[a-zA-Z][a-zA-Z]\.gz|info\.txt|license\.tar\.gz|license\.zip|.*\.db(\.tar\.gz)?|.*\.files\.tar\.gz|.*\.abs\.tar\.gz|metalink\?repo|.*prestodelta\.xml\.gz)$|/dists/.*/installer-[^/]+/[^0-9][^/]+/images/.* 125 | # PfilePattern = .*(\.d?deb|\.rpm|\.dsc|\.tar(\.gz|\.bz2|\.lzma|\.xz)(\.gpg)?|\.diff(\.gz|\.bz2|\.lzma|\.xz)|\.jigdo|\.template|changelog|copyright|\.udeb|\.debdelta|\.diff/.*\.gz|(Devel)?ReleaseAnnouncement(\?.*)?|[a-f0-9]+-(susedata|updateinfo|primary|deltainfo).xml.gz|fonts/(final/)?[a-z]+32.exe(\?download.*)?|/dists/.*/installer-[^/]+/[0-9][^/]+/images/.*)$ 126 | # Whitelist for expiration, file types not to be removed even when being 127 | # unreferenced. Default: many parts from VfilePattern where no parent index 128 | # exists or might be unknown. 129 | # WfilePattern = (^|.*?/)(Release|InRelease|Release\.gpg|(Packages|Sources)(\.gz|\.bz2|\.lzma|\.xz)?|Translation[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|MD5SUMS|SHA1SUMS|.*\.xml|.*\.db\.tar\.gz|.*\.files\.tar\.gz|.*\.abs\.tar\.gz|[a-z]+32.exe)$|/dists/.*/installer-.*/images/.* 130 | 131 | # Higher modes only working with the debug version 132 | # Warning, writes a lot into apt-cacher.err logfile 133 | # Value overwrites UnbufferLogs setting (aliased) 134 | # Debug:3 135 | 136 | # Usually, general purpose proxies like Squid expose the IP address of the 137 | # client user to the remote server using the X-Forwarded-For HTTP header. This 138 | # behaviour can be optionally turned on with the Expose-Origin option. 139 | # ExposeOrigin: 0 140 | 141 | # When logging the originating IP address, trust the information supplied by 142 | # the client in the X-Forwarded-For header. 143 | # LogSubmittedOrigin: 0 144 | 145 | # The version string reported to the peer, to be displayed as HTTP client (and 146 | # version) in the logs of the mirror. 147 | # WARNING: some archives use this header to detect/guess capabilities of the 148 | # client (i.e. redirection support) and change the behaviour accordingly, while 149 | # ACNG might not support the expected features. Expect side effects. 150 | # 151 | # UserAgent: Yet Another HTTP Client/1.2.3p4 152 | 153 | # In some cases the Import and Expiration tasks might create fresh volatile 154 | # data for internal use by reconstructing them using patch files. This 155 | # by-product might be recompressed with bzip2 and with some luck the resulting 156 | # file becomes identical to the *.bz2 file on the server, usable for APT 157 | # clients trying to fetch the full .bz2 compressed version. Injection of the 158 | # generated files into the cache has however a disadvantage on underpowered 159 | # servers: bzip2 compression can create high load on the server system and the 160 | # visible download of the busy .bz2 files also becomes slower. 161 | # 162 | # RecompBz2: 0 163 | 164 | # Network timeout for outgoing connections. 165 | # NetworkTimeout: 60 166 | 167 | # Sometimes it makes sense to not store the data in cache and just return the 168 | # package data to client as it comes in. DontCache parameters can enable this 169 | # behaviour for certain URL types. The tokens are extended regular expressions 170 | # that URLs are matched against. 171 | # 172 | # DontCacheRequested is applied to the URL as it comes in from the client. 173 | # Example: exclude packages built with kernel-package for x86 174 | # DontCacheRequested: linux-.*_10\...\.Custo._i386 175 | # Example usecase: exclude popular private IP ranges from caching 176 | # DontCacheRequested: 192.168.0 ^10\..* 172.30 177 | # 178 | # DontCacheResolved is applied to URLs after mapping to the target server. If 179 | # multiple backend servers are specified then it's only matched against the 180 | # download link for the FIRST possible source (due to implementation limits). 181 | # Example usecase: all Ubuntu stuff comes from a local mirror (specified as 182 | # backend), don't cache it again: 183 | # DontCacheResolved: ubuntumirror.local.net 184 | # 185 | # DontCache directive sets (overrides) both, DontCacheResolved and 186 | # DontCacheRequested. Provided for convenience, see those directives for 187 | # details. 188 | # 189 | # Default permission set of freshly created files and directories, as octal 190 | # numbers (see chmod(1) for details). 191 | # Can by limited by the umask value (see umask(2) for details) if it's set in 192 | # the environment of the starting shell, e.g. in apt-cacher-ng init script or 193 | # in its configuration file. 194 | # DirPerms: 00755 195 | # FilePerms: 00664 196 | # 197 | # 198 | # It's possible to use use apt-cacher-ng as a regular web server with limited 199 | # feature set, i.e. 200 | # including directory browsing and download of any file; 201 | # excluding sorting, mime types/encodings, CGI execution, index page 202 | # redirection and other funny things. 203 | # To get this behavior, mappings between virtual directories and real 204 | # directories on the server must be defined with the LocalDirs directive. 205 | # Virtual and real dirs are separated by spaces, multiple pairs are separated 206 | # by semi-colons. Real directories must be absolute paths. 207 | # NOTE: Since the names of that key directories share the same namespace as 208 | # repository names (see Remap-...) it's administrators job to avoid such 209 | # collisions on them (unless created deliberately). 210 | # 211 | # LocalDirs: woo /data/debarchive/woody ; hamm /data/debarchive/hamm 212 | 213 | # Precache a set of files referenced by specified index files. This can be used 214 | # to create a partial mirror usable for offline work. There are certain limits 215 | # and restrictions on the path specification, see manual for details. A list of 216 | # (maybe) relevant index files could be retrieved via 217 | # "apt-get --print-uris update" on a client machine. 218 | # 219 | # PrecacheFor: debrep/dists/unstable/*/source/Sources* debrep/dists/unstable/*/binary-amd64/Packages* 220 | 221 | # Arbitrary set of data to append to request headers sent over the wire. Should 222 | # be a well formated HTTP headers part including newlines (DOS style) which 223 | # can be entered as escape sequences (\r\n). 224 | # RequestAppendix: X-Tracking-Choice: do-not-track\r\n 225 | 226 | # Specifies the IP protocol families to use for remote connections. Order does 227 | # matter, first specified are considered first. Possible combinations: 228 | # v6 v4 229 | # v4 v6 230 | # v6 231 | # v4 232 | # (empty or not set: use system default) 233 | # 234 | # ConnectProto: v6 v4 235 | 236 | # Regular expiration algorithm finds package files which are no longer listed 237 | # in any index file and removes them of them after a safety period. 238 | # This option allows to keep more versions of a package in the cache after 239 | # safety period is over. 240 | # KeepExtraVersions: 1 241 | 242 | # Optionally uses TCP access control provided by libwrap, see hosts_access(5) 243 | # for details. Daemon name is apt-cacher-ng. Default if not set: decided on 244 | # startup by looking for explicit mentioning of apt-cacher-ng in 245 | # /etc/hosts.allow or /etc/hosts.deny files. 246 | # UseWrap: 0 247 | 248 | # If many machines from the same local network attempt to update index files 249 | # (apt-get update) at nearly the same time, the known state of these index file 250 | # is temporarily frozen and multiple requests receive the cached response 251 | # without contacting the server. This parameter (in seconds) specifies the 252 | # length of this period before the files are considered outdated. 253 | # Setting it too low transfers more data and increases remote server load, 254 | # setting it too high (more than a couple of minutes) increases the risk of 255 | # delivering inconsistent responses to the clients. 256 | # FreshIndexMaxAge: 27 257 | 258 | # Usually the users are not allowed to specify custom TCP ports of remote 259 | # mirrors in the requests, only the default HTTP port can be used (instead, 260 | # proxy administrator can create Remap- rules with custom ports). This 261 | # restriction can be disabled by specifying a list of allowed ports or 0 for 262 | # any port. 263 | # 264 | # AllowUserPorts: 80 265 | 266 | # Normally the HTTP redirection responses are forwarded to the original caller 267 | # (i.e. APT) which starts a new download attempt from the new URL. This 268 | # solution is ok for client configurations with proxy mode but doesn't work 269 | # well with configurations using URL prefixes. To work around this the server 270 | # can restart its own download with another URL. However, this might be used to 271 | # circumvent download source policies by malicious users. 272 | # The RedirMax option specifies how many such redirects the server should 273 | # follow per request, 0 disables the internal redirection. If not set, 274 | # default value is 0 if ForceManaged is used and 5 otherwise. 275 | # 276 | # RedirMax: 5 --------------------------------------------------------------------------------