Skip to content

Commit

Permalink
merge conflict on json
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed May 3, 2010
2 parents 570aba8 + 0d92d21 commit 76799db
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 43 deletions.
47 changes: 47 additions & 0 deletions logrotate/README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
= DESCRIPTION:

Logrotate configuration

= REQUIREMENTS:

Debian or Ubuntu preferred.

Red Hat/CentOS and Fedora can be used but will be converted to a Debian/Ubuntu style Apache as it's far easier to manage with chef.

= ATTRIBUTES:

* none

General settings and prefork/worker attributes are tunable.

= USAGE:

include the recipe and it will install a default logrotate, if you want it to do more however...

make a recipe such as,

logrotate_app "chef" do
paths "/var/log/chef/*.log"
rotate 4
end

== Defines:

* logrotate_app:: sets up a logrotate configuration file

= LICENSE & AUTHOR:

Author:: Scott M. Likens (<scott@likens.us>)
Copyright:: 2009, Scott M. Likens

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.
42 changes: 42 additions & 0 deletions logrotate/definitions/logrotate_app.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Cookbook Name:: logrotate
# Definition:: logrotate_instance
#
# Copyright 2009, Scott M. Likens
#
# 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.
#

define :logrotate_app, :enable => true do
include_recipe "logrotate"

if params[:enable]
template "/etc/logrotate.d/#{params[:name]}" do
source "logrotate.erb"
mode 0440
owner "root"
group "root"
backup false
variables(
:paths => params[:paths],
:rotate => params[:rotate]
)
end
else
execute "rm /etc/logrotate.d/#{params[:name]}" do
only_if FileTest.exists?("/etc/logrotate.d/#{params[:name]}")
command "rm /etc/logrotate.d/#{params[:name]}"
end
end
end

88 changes: 48 additions & 40 deletions logrotate/metadata.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,49 @@
{
"dependencies": {
},
"replacing": {
},
"description": "Installs logrotate",
"groupings": {
},
"platforms": {
"ubuntu": [

],
"centos": [

],
"debian": [

],
"redhat": [

]
},
"version": "0.7.0",
"recommendations": {
},
"name": "logrotate",
"maintainer": "Opscode, Inc.",
"long_description": "",
"recipes": {
},
"suggestions": {
},
"maintainer_email": "cookbooks@opscode.com",
"attributes": {
},
"conflicting": {
},
"license": "Apache 2.0",
"providing": {
}
}
"license": "Apache 2.0",
"conflicting": {

},
"dependencies": {

},
"providing": {
"logrotate": [

]
},
"long_description": "= DESCRIPTION:\n\nLogrotate configuration\n\n= REQUIREMENTS:\n\nDebian or Ubuntu preferred.\n\nRed Hat\/CentOS and Fedora can be used but will be converted to a Debian\/Ubuntu style Apache as it's far easier to manage with chef. \n\n= ATTRIBUTES:\n\n* none\n\nGeneral settings and prefork\/worker attributes are tunable.\n\n= USAGE:\n\ninclude the recipe and it will install a default logrotate, if you want it to do more however...\n\nmake a recipe such as,\n\nlogrotate_app \"chef\" do\n paths \"\/var\/log\/chef\/*.log\"\n rotate 4\nend\n\n== Defines:\n\n* logrotate_app:: sets up a logrotate configuration file\n\n= LICENSE & AUTHOR:\n\nAuthor:: Scott M. Likens (<scott@likens.us>)\nCopyright:: 2009, Scott M. Likens\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",
"description": "Installs logrotate",
"replacing": {

},
"platforms": {
"debian": [

],
"centos": [

],
"ubuntu": [

],
"redhat": [

]
},
"version": "0.8.0",
"recipes": {
"logrotate": ""
},
"maintainer": "Scott M. Likens",
"recommendations": {

},
"name": "logrotate",
"maintainer_email": "scott@likens.us",
"attributes": {

},
"suggestions": {

}
}
7 changes: 4 additions & 3 deletions logrotate/metadata.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
maintainer "Opscode, Inc."
maintainer_email "cookbooks@opscode.com"
maintainer "Scott M. Likens"
maintainer_email "scott@likens.us"
license "Apache 2.0"
description "Installs logrotate"
version "0.7"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version "0.8"

%w{ redhat centos debian ubuntu }.each do |os|
supports os
Expand Down
9 changes: 9 additions & 0 deletions logrotate/templates/default/logrotate.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<%= @paths %> {
weekly
missingok
rotate <%= @rotate %>
compress
delaycompress
copytruncate
}

0 comments on commit 76799db

Please sign in to comment.