Skip to content

Commit

Permalink
etckeeper cookbook added
Browse files Browse the repository at this point in the history
  • Loading branch information
mdxp committed Aug 22, 2010
1 parent 34b92d9 commit d755c22
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
8 changes: 8 additions & 0 deletions etckeeper/README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
= DESCRIPTION:

= REQUIREMENTS:

= ATTRIBUTES:

= USAGE:

34 changes: 34 additions & 0 deletions etckeeper/files/default/etckeeper.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# The VCS to use.
# VCS="hg"
VCS="git"
# VCS="bzr"
# VCS="darcs"

# Options passed to git commit when run by etckeeper.
#GIT_COMMIT_OPTIONS=""

# Options passed to hg commit when run by etckeeper.
#HG_COMMIT_OPTIONS=""

# Options passed to bzr commit when run by etckeeper.
#BZR_COMMIT_OPTIONS=""

# Options passed to darcs commit when run by etckeeper.
#DARCS_COMMIT_OPTIONS=""

# Uncomment to avoid etckeeper committing existing changes
# to /etc automatically once per day.
#AVOID_DAILY_AUTOCOMMITS=1

# Uncomment to avoid etckeeper committing existing changes to
# /etc before installation. It will cancel the installation,
# so you can commit the changes by hand.
#AVOID_COMMIT_BEFORE_INSTALL=1

# The high-level package manager that's being used.
# (apt, pacman-g2, yum etc)
HIGHLEVEL_PACKAGE_MANAGER=apt

# The low-level package manager that's being used.
# (dpkg, rpm, pacman-g2, etc)
LOWLEVEL_PACKAGE_MANAGER=dpkg
12 changes: 12 additions & 0 deletions etckeeper/metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
maintainer "Promet Solutions"
maintainer_email "[email protected]"
license "Apache 2.0"
description "Installs/Configures etckeeper"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version "0.1"
depends "git"

%w{ ubuntu debian }.each do |os|
supports os
end

41 changes: 41 additions & 0 deletions etckeeper/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#
# Cookbook Name:: etckeeper
# Recipe:: default
#
# Copyright 2010, Promet Solutions
#
# 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.
#

include_recipe "git"

return unless ["ubuntu", "debian"].include?(node[:platform])

package "etckeeper"

cookbook_file "/etc/etckeeper/etckeeper.conf" do
source "etckeeper.conf"
mode 0644
end

#Initialize the etckeeper repo for /etc
script "init_etckeeper" do
interpreter "bash"
user "root"
code <<-EOH
etckeeper init
cd /etc
git commit -a -m "initial import"
EOH
not_if "test -d /etc/.git"
end

0 comments on commit d755c22

Please sign in to comment.