aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2011-02-10 02:24:21 +0000
committerMichael Scherer <misc@mageia.org>2011-02-10 02:24:21 +0000
commit02c2a0e659a14172ff8b6a168cb99f2055e991fe (patch)
treeb852ae159b241062c6c6e2a7ca452e8d89585d44 /modules/git
parent6da75de997dcb3e48d67c55c5bdf090712ebfc48 (diff)
downloadpuppet-02c2a0e659a14172ff8b6a168cb99f2055e991fe.tar
puppet-02c2a0e659a14172ff8b6a168cb99f2055e991fe.tar.gz
puppet-02c2a0e659a14172ff8b6a168cb99f2055e991fe.tar.bz2
puppet-02c2a0e659a14172ff8b6a168cb99f2055e991fe.tar.xz
puppet-02c2a0e659a14172ff8b6a168cb99f2055e991fe.zip
add basic framework for modifying configuration of a git repository with puppet ( used for mail commit script later )
Diffstat (limited to 'modules/git')
-rw-r--r--modules/git/manifests/init.pp21
-rw-r--r--modules/git/templates/apply_git_puppet_config.sh7
-rw-r--r--modules/git/templates/config.puppet0
3 files changed, 28 insertions, 0 deletions
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
--- /dev/null
+++ b/modules/git/templates/config.puppet