diff options
author | Benedikt Boehm <hollow@gentoo.org> | 2010-07-03 12:42:13 +0000 |
---|---|---|
committer | Benedikt Boehm <hollow@gentoo.org> | 2010-07-03 12:42:13 +0000 |
commit | b45197aedd785df54464bf809095cbb7f0c53ba5 (patch) | |
tree | 16cc1c3e8266d98773f7928aa39ef568ef7ebdc1 /app-admin/chef-server-api | |
parent | sparc stable wrt #326395 (diff) | |
download | gentoo-2-b45197aedd785df54464bf809095cbb7f0c53ba5.tar.gz gentoo-2-b45197aedd785df54464bf809095cbb7f0c53ba5.tar.bz2 gentoo-2-b45197aedd785df54464bf809095cbb7f0c53ba5.zip |
initial ebuild, thanks to Gábor Vészi
(Portage version: 2.2_rc67/cvs/Linux i686)
Diffstat (limited to 'app-admin/chef-server-api')
-rw-r--r-- | app-admin/chef-server-api/ChangeLog | 11 | ||||
-rw-r--r-- | app-admin/chef-server-api/chef-server-api-0.9.6.ebuild | 65 | ||||
-rw-r--r-- | app-admin/chef-server-api/files/confd/chef-server-api | 23 | ||||
-rw-r--r-- | app-admin/chef-server-api/files/initd/chef-server-api | 41 | ||||
-rw-r--r-- | app-admin/chef-server-api/files/server.rb | 130 | ||||
-rw-r--r-- | app-admin/chef-server-api/metadata.xml | 10 |
6 files changed, 280 insertions, 0 deletions
diff --git a/app-admin/chef-server-api/ChangeLog b/app-admin/chef-server-api/ChangeLog new file mode 100644 index 000000000000..99f065f10c7d --- /dev/null +++ b/app-admin/chef-server-api/ChangeLog @@ -0,0 +1,11 @@ +# ChangeLog for app-admin/chef-server-api +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/chef-server-api/ChangeLog,v 1.1 2010/07/03 12:42:13 hollow Exp $ + +*chef-server-api-0.9.6 (03 Jul 2010) + + 03 Jul 2010; Benedikt Böhm <hollow@gentoo.org> + +chef-server-api-0.9.6.ebuild, +files/confd/chef-server-api, + +files/initd/chef-server-api, +files/server.rb, +metadata.xml: + initial ebuild, thanks to Gábor Vészi + diff --git a/app-admin/chef-server-api/chef-server-api-0.9.6.ebuild b/app-admin/chef-server-api/chef-server-api-0.9.6.ebuild new file mode 100644 index 000000000000..a7e72bd29d1e --- /dev/null +++ b/app-admin/chef-server-api/chef-server-api-0.9.6.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/chef-server-api/chef-server-api-0.9.6.ebuild,v 1.1 2010/07/03 12:42:13 hollow Exp $ + +EAPI="2" +USE_RUBY="ruby18" + +RUBY_FAKEGEM_TASK_DOC="" +RUBY_FAKEGEM_TASK_TEST="" + +inherit ruby-fakegem + +DESCRIPTION="Configuration management tool" +HOMEPAGE="http://wiki.opscode.com/display/chef" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +ruby_add_rdepend "=app-admin/chef-${PV} + <=dev-ruby/json-1.4.2 + >=dev-ruby/merb-assets-1.1.0 + >=dev-ruby/merb-core-1.1.0 + >=dev-ruby/merb-helpers-1.1.0 + >=dev-ruby/merb-param-protection-1.1.0 + >=dev-ruby/merb-slices-1.1.0 + >=dev-ruby/uuidtools-2.1.1 + www-servers/thin" + +pkg_setup() { + enewgroup chef + enewuser chef -1 -1 /var/lib/chef chef +} + +each_ruby_install() { + each_fakegem_install + ruby_fakegem_doins -r app + ruby_fakegem_doins -r config + ruby_fakegem_doins -r public +} + +all_ruby_install() { + all_fakegem_install + + doinitd "${FILESDIR}/initd/chef-server-api" + doconfd "${FILESDIR}/confd/chef-server-api" + + keepdir /etc/chef /var/lib/chef /var/log/chef /var/run/chef \ + /etc/chef/certificates + + insinto /etc/chef + doins "${FILESDIR}/server.rb" + + fperms 0700 /etc/chef/certificates + fowners chef:chef /etc/chef/{,server.rb,certificates} + fowners chef:chef /var/{lib,log,run}/chef +} + +pkg_postinst() { + elog + elog "You should edit /etc/chef/server.rb before starting the service with" + elog "/etc/init.d/chef-server-api start" + elog +} diff --git a/app-admin/chef-server-api/files/confd/chef-server-api b/app-admin/chef-server-api/files/confd/chef-server-api new file mode 100644 index 000000000000..ffdc122c24f0 --- /dev/null +++ b/app-admin/chef-server-api/files/confd/chef-server-api @@ -0,0 +1,23 @@ +# /etc/conf.d/chef-server-api: config file for /etc/init.d/chef-server-api + +# The configuration file to use. +#CONFIGFILE="/etc/chef/server.rb" + +# Number of merb daemons to run for chef-server. +#CLUSTER_NODES=1 + +# The user and group to set privilege to. +#CHEF_USER="chef" +#CHEF_GROUP="chef" + +# Log file location. +#CHEF_SERVER_LOGFILE="/var/log/chef/server.log" + +# Any radom options you want to pass to chef-server. +#CHEF_SERVER_OPTS="" + +# Path to the chef server binary. +#CHEF_SERVER_BINARY="/usr/bin/chef-server" + +# PID file location. +#CHEF_SERVER_PIDFILE="/var/run/chef/server.%s.pid" diff --git a/app-admin/chef-server-api/files/initd/chef-server-api b/app-admin/chef-server-api/files/initd/chef-server-api new file mode 100644 index 000000000000..81b0dea916dc --- /dev/null +++ b/app-admin/chef-server-api/files/initd/chef-server-api @@ -0,0 +1,41 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net couchdb rabbitmq chef-solr-indexer + before chef-client +} + +CHEF_SERVER_BINARY=${CHEF_SERVER_BINARY:-/usr/bin/chef-server} +CHEF_SERVER_PIDFILE=${CHEF_SERVER_PIDFILE:-/var/run/chef/server.%s.pid} +CHEF_SERVER_LOGFILE=${CHEF_SERVER_LOGFILE:-/var/log/chef/server.log} +CONFIGFILE=${CONFIGFILE:-/etc/chef/server.rb} +CLUSTER_NODES=${CLUSTER_NODES:-1} +CHEF_USER=${CHEF_USER:-chef} +CHEF_GROUP=${CHEF_GROUP:-chef} + +# TODO: this could be nicer +DEFAULT_CHEF_DIRS=( /etc/chef /var/lib/chef /var/log/chef /var/run/chef ) +CHEF_DIRS=( ${CHEF_DIRS[@]:-${DEFAULT_CHEF_DIRS[@]}} ) + +fix_dir_owners() { + for DIR in ${CHEF_DIRS[@]}; do + chown ${CHEF_USER}:${CHEF_GROUP} ${DIR} + done +} + +start() { + ebegin "Starting Chef server" + fix_dir_owners + ${CHEF_SERVER_BINARY} -d -P ${CHEF_SERVER_PIDFILE} -C ${CONFIGFILE} \ + -u ${CHEF_USER} -G ${CHEF_GROUP} --name chef-server \ + -c ${CLUSTER_NODES} -L ${CHEF_SERVER_LOGFILE} > /dev/null + eend $? +} + +stop() { + ebegin "Shutting down Chef server" + ${CHEF_SERVER_BINARY} -K all -P ${CHEF_SERVER_PIDFILE} > /dev/null + eend $? +} diff --git a/app-admin/chef-server-api/files/server.rb b/app-admin/chef-server-api/files/server.rb new file mode 100644 index 000000000000..003bafcdaaee --- /dev/null +++ b/app-admin/chef-server-api/files/server.rb @@ -0,0 +1,130 @@ +# Configuration File For Chef (chef-server) +# +# chef-server is a Merb application slice. By default it is configured to +# run via Thin, the default Merb adapter. It can be run as: +# +# chef-server -p 4000 -e production -a thin +# +# This starts up the RESTful Chef Server API on port 4000 in production mode +# using the thin server adapter. +# +# This file configures the behavior of the running server itself. +# +# Chef uses a Ruby DSL for configuration, and this file contains a few +# Ruby idioms. First, symbols. These are designated by a colon sigil, ie, +# :value. Second, in Ruby, everything but false and nil (no quotes or other +# designations) is true, including true, the integer 0 and the string "false". +# So to set the value of a setting to false, write: +# +# some_setting false +# +# Third, Ruby class methods can be used, for example we tell the log to show +# the current time stamp with Chef::Log::Formatter.show_time, below. +# +# log_level specifies the level of verbosity for output. +# valid values are: :debug, :info, :warn, :error, :fatal + +log_level :info + +# log_location specifies where the server should log to. +# valid values are: a quoted string specifying a file, or STDOUT with +# no quotes. This is the application log for the Merb workers that get +# spawned. + +log_location "/var/log/chef/server.log" + +# ssl_verify_mode specifies if the REST client should verify SSL certificates. +# valid values are :verify_none, :verify_peer. The default Chef Server +# installation will use a self-generated SSL certificate so this should be +# :verify_none unless you replace the certificate. + +ssl_verify_mode :verify_none + +# chef_server_url specifies the URL for the server API. The process actually +# listens on 0.0.0.0:PORT. +# valid values are any HTTP URL. + +chef_server_url "http://localhost:4000" + +# cookbook_path is a Ruby array of filesystem locations to search for cookbooks. +# valid value is a string, or an array of strings of filesystem directory +# locations. This setting is searched beginning (index 0) to end in order. You +# might specify multiple search paths for cookbooks if you want to use an +# upstream source, and provide localised "site" overrides. These should come +# after the 'upstream' source. The default value, /var/lib/chef/cookbooks does +# not contain any cookbooks by default. +# See the Chef Wiki for more information about setting up a local repository +# for working on cookbooks. +# http://wiki.opscode.com/display/chef/Chef+Repository + +cookbook_path [ "/var/lib/chef/cookbooks" ] +cookbook_tarball_path "/var/lib/chef/cookbook-tarballs" + +# file_cache_path specifies where the client should cache cookbooks, server +# cookie ID, and openid registration data. +# valid value is any filesystem directory location. + +file_cache_path "/var/lib/chef/cache" + +# node_path specifies a location for where to find node-specific recipes. +# valid values are any filesystem direcory location. + +node_path "/var/lib/chef/nodes" + +# openid_store_path specifies a location where to keep openid nonces for clients. +# valid values are any filesystem directory location. +# +# NOTE: OpenID is deprecated and this option may not be used, kept for +# historical purposes. + +openid_store_path "/var/lib/chef/openid/store" + +# openid_store_path specifies a location where to keep openid nonces for clients. +# valid values are any filesystem directory location. +# +# NOTE: OpenID is deprecated and this option may not be used, kept for +# historical purposes and may be removed. + +openid_cstore_path "/var/lib/chef/openid/cstore" + +# role_path designates where the server should load role JSON and Ruby DSL +# files from. +# valid values are any filesystem directory location. Roles are a feature +# that allow you to easily reuse lists of recipes and attribute settings. +# Please see the Chef Wiki page for information on how to utilize the feature. +# http://wiki.opscode.com/display/chef/Roles +# +# NOTE: The role_path setting is deprecated on the chef-server, as the +# roles are now stored directly in CouchDB rather than on the filesystem. +# This option is kept for historical purposes and may be removed. + +role_path "/var/lib/chef/roles" + +# cache_options sets options used by the moneta library for local cache for +# checksums of compared objects. + +cache_options({ + :path => "/var/lib/chef/cache/checksums", + :skip_expires => true +}) + +# Mixlib::Log::Formatter.show_time specifies whether the chef-client log should +# contain timestamps. +# valid values are true or false (no quotes, see above about Ruby idioms). The +# printed timestamp is rfc2822, for example: +# Fri, 31 Jul 2009 19:19:46 -0600 + +Mixlib::Log::Formatter.show_time = true + +# The following options configure the signing CA so it can be read by +# non-privileged user for the server daemon. + +signing_ca_path "/etc/chef/certificates" +signing_ca_cert "/etc/chef/certificates/cert.pem" +signing_ca_key "/etc/chef/certificates/key.pem" + +sandbox_path "/var/lib/chef/sandboxes" +checksum_path "/var/lib/chef/checksums" + +openid_store_path "/var/lib/chef/openid/store" +search_index_path "/var/lib/chef/search_index" diff --git a/app-admin/chef-server-api/metadata.xml b/app-admin/chef-server-api/metadata.xml new file mode 100644 index 000000000000..b263a5bc4f28 --- /dev/null +++ b/app-admin/chef-server-api/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>no-herd</herd> + <maintainer> + <email>hollow@gentoo.org</email> + <name>Benedikt Böhm</name> + </maintainer> +</pkgmetadata> + |