From 02c2a0e659a14172ff8b6a168cb99f2055e991fe Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Thu, 10 Feb 2011 02:24:21 +0000 Subject: add basic framework for modifying configuration of a git repository with puppet ( used for mail commit script later ) --- modules/git/manifests/init.pp | 21 +++++++++++++++++++++ modules/git/templates/apply_git_puppet_config.sh | 7 +++++++ modules/git/templates/config.puppet | 0 3 files changed, 28 insertions(+) create mode 100644 modules/git/templates/apply_git_puppet_config.sh create mode 100644 modules/git/templates/config.puppet (limited to 'modules/git') diff --git a/modules/git/manifests/init.pp b/modules/git/manifests/init.pp index c4847c3b..eab748d4 100644 --- a/modules/git/manifests/init.pp +++ b/modules/git/manifests/init.pp @@ -24,6 +24,14 @@ class git { content => template('git/create_git_repo.sh') } + file { "/usr/local/bin/apply_git_puppet_config.sh": + ensure => present, + owner => root, + group => root, + mode => 755, + content => template('git/apply_git_puppet_config.sh') + } + # TODO # define common syntax check, see svn @@ -65,6 +73,19 @@ class git { content => $description, require => File["$name/git-daemon-export-ok"] } + + file { "$name/config.puppet": + ensure => present, + require => File["$name/git-daemon-export-ok"], + notify => Exec['/usr/local/bin/apply_git_puppet_config.sh'], + content => template('git/config.puppet'), + } + + exec { "/usr/local/bin/apply_git_puppet_config.sh": + cwd => $name, + user => "root", + refreshonly => true + } } define svn_repository($source, diff --git a/modules/git/templates/apply_git_puppet_config.sh b/modules/git/templates/apply_git_puppet_config.sh new file mode 100644 index 00000000..29ede998 --- /dev/null +++ b/modules/git/templates/apply_git_puppet_config.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +while read line +do + # --local is a option for the newer git + git config --add $line +done < config.puppet diff --git a/modules/git/templates/config.puppet b/modules/git/templates/config.puppet new file mode 100644 index 00000000..e69de29b -- cgit v1.2.1