mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 01:43:45 +08:00
f3bcbd8bc3
This introduces two configuration management runs into the Vagrant provisioning phase. The first chef-solo run ensures that a current version of chef is installed using the omnibus updater. The second chef-solo run installs vim and phantomjs. Much more is possible, this is a proof of concept. Cookbooks are stored in the chef directory, and managed by librarian-chef, which is like a bundler for cookbooks. Chef is run when VM is first downloaded and booted, but not on subsequent halt/up cycles. To force chef to run again, use `vagrant provision`.
34 lines
8.4 KiB
JSON
34 lines
8.4 KiB
JSON
{
|
|
"name": "apt",
|
|
"description": "Configures apt and apt services and LWRPs for managing apt repositories and preferences",
|
|
"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- 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- 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\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 (<joshua@opscode.com>)\nAuthor:: Matt Ray (<matt@opscode.com>)\nAuthor:: Seth Chisamore (<schisamo@opscode.com>)\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",
|
|
"maintainer": "Opscode, Inc.",
|
|
"maintainer_email": "cookbooks@opscode.com",
|
|
"license": "Apache 2.0",
|
|
"platforms": {
|
|
"ubuntu": ">= 0.0.0",
|
|
"debian": ">= 0.0.0"
|
|
},
|
|
"dependencies": {
|
|
},
|
|
"recommendations": {
|
|
},
|
|
"suggestions": {
|
|
},
|
|
"conflicting": {
|
|
},
|
|
"providing": {
|
|
},
|
|
"replacing": {
|
|
},
|
|
"attributes": {
|
|
},
|
|
"groupings": {
|
|
},
|
|
"recipes": {
|
|
"apt": "Runs apt-get update during compile phase and sets up preseed directories",
|
|
"apt::cacher-ng": "Set up an apt-cacher-ng caching proxy",
|
|
"apt::cacher-client": "Client for the apt::cacher-ng caching proxy"
|
|
},
|
|
"version": "1.8.4"
|
|
} |