2 Star 0 Fork 0

mirrors_hfeeki/apt-cookbook

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Description

Configures various APT components on Debian-like systems. Also includes a LWRP.

Requires the chef-extensions gem.

Recipes

default

The default recipe runs apt-get update during the Compile Phase of the Chef run to ensure that the system's package cache is updated with the latest. It is recommended that this recipe appear first in a node's run list (directly or through a role) to ensure that when installing packages, Chef will be able to download the latest version available on the remote APT repository.

This recipe also sets up a local cache directory for preseeding packages.

cacher

Installs the apt-cacher package and service so the system can provide APT caching. You can check the usage report at http://{hostname}:3142/report. The cacher recipe includes the cacher-client recipe, so it helps seed itself.

cacher-client

Configures the node to use the apt-cacher server as a client.

Resources/Providers

This cookbook contains an LWRP, apt_repository, which provides the add and remove actions for managing additional software repositories with entries in the /etc/apt/sources.list.d/ directory. The LWRP also supports passing in a key and keyserver as attributes.

  • add takes a number of attributes and creates a repository file and builds the repository listing.
  • remove deletes the /etc/apt/sources.list.d/#{new_resource.repo_name}-sources.list file identified by the repo_name passed as the resource name.

Usage

Put recipe[apt] first in the run list. If you have other recipes that you want to use to configure how apt behaves, like new sources, notify the execute resource to run, e.g.:

template "/etc/apt/sources.list.d/my_apt_sources.list" do
  notifies :run, resources(:execute => "apt-get update"), :immediately
end

The above will run during execution phase since it is a normal template resource, and should appear before other package resources that need the sources in the template.

Put recipe[apt::cacher] in the run_list for a server to provide APT caching and add recipe[apt::cacher-client] on the rest of the Debian-based nodes to take advantage of the caching server.

An example of The LWRP apt_repository add action:

apt_repository "zenoss" do
  uri "http://dev.zenoss.org/deb"
  distribution "main"
  components ["stable"]
  action :add
end

and the remove action:

apt_repository "zenoss" do
  action :remove
end

License and Author

Author:: Joshua Timberman (joshua@opscode.com) Author:: Matt Ray (matt@opscode.com) Author:: Gerhard Lazu (gerhard@lazu.co.uk)

Copyright 2009-2011 Opscode, Inc. Copyright 2012 Gerhard Lazu

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

空文件

简介

取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_hfeeki/apt-cookbook.git
git@gitee.com:mirrors_hfeeki/apt-cookbook.git
mirrors_hfeeki
apt-cookbook
apt-cookbook
master

搜索帮助