aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/subversion/manifests/hook.pp31
-rw-r--r--modules/subversion/manifests/hook/post_commit.pp6
-rw-r--r--modules/subversion/manifests/hook/pre_commit.pp6
3 files changed, 19 insertions, 24 deletions
diff --git a/modules/subversion/manifests/hook.pp b/modules/subversion/manifests/hook.pp
index 5a347573..08b626ad 100644
--- a/modules/subversion/manifests/hook.pp
+++ b/modules/subversion/manifests/hook.pp
@@ -1,26 +1,9 @@
-class subversion {
- class hook {
- define post_commit($content) {
- commit_hook { $name:
- content => $content,
- type => "post-commit",
- }
- }
- define pre_commit($content) {
- commit_hook { $name:
- content => $content,
- type => "pre-commit",
- }
- }
-
- define commit_hook($content, $type) {
- $array = split($name,'\|')
- $repo = $array[0]
- $script = $array[1]
- file { "$repo/hooks/$type.d/$script":
- content => $content,
- mode => 755,
- }
- }
+define subversion::hook($content, $type) {
+ $array = split($name,'\|')
+ $repo = $array[0]
+ $script = $array[1]
+ file { "$repo/hooks/$type.d/$script":
+ content => $content,
+ mode => '0755',
}
}
diff --git a/modules/subversion/manifests/hook/post_commit.pp b/modules/subversion/manifests/hook/post_commit.pp
new file mode 100644
index 00000000..90d939cd
--- /dev/null
+++ b/modules/subversion/manifests/hook/post_commit.pp
@@ -0,0 +1,6 @@
+define subversion::hook::post_commit($content) {
+ hook { $name:
+ content => $content,
+ type => 'post-commit',
+ }
+}
diff --git a/modules/subversion/manifests/hook/pre_commit.pp b/modules/subversion/manifests/hook/pre_commit.pp
new file mode 100644
index 00000000..fa44b168
--- /dev/null
+++ b/modules/subversion/manifests/hook/pre_commit.pp
@@ -0,0 +1,6 @@
+define subversion::hook::pre_commit($content) {
+ hook { $name:
+ content => $content,
+ type => 'pre-commit',
+ }
+}