1 |
misc |
83 |
# should be replaced by vcsrepo |
2 |
|
|
# https://github.com/reductivelabs/puppet-vcsrepo |
3 |
|
|
# but not integrated in puppet directly for the moment |
4 |
|
|
class subversion { |
5 |
misc |
2593 |
class server { |
6 |
misc |
810 |
include subversion::tools |
7 |
misc |
2205 |
|
8 |
misc |
2593 |
package { 'subversion-server': } |
9 |
|
|
|
10 |
misc |
1722 |
$svn_base_path = '/svn/' |
11 |
dmorgan |
131 |
|
12 |
misc |
2593 |
xinetd::service { 'svnserve': |
13 |
misc |
1722 |
content => template('subversion/xinetd') |
14 |
|
|
} |
15 |
|
|
|
16 |
misc |
2593 |
file { $svn_base_path: |
17 |
misc |
1725 |
ensure => directory, |
18 |
misc |
1722 |
} |
19 |
|
|
|
20 |
misc |
2593 |
package { ['perl-SVN-Notify-Config', 'perl-SVN-Notify-Mirror']: } |
21 |
|
|
|
22 |
|
|
$local_dir = '/usr/local/share/subversion/' |
23 |
|
|
$local_dirs = ["$local_dir/pre-commit.d", "$local_dir/post-commit.d"] |
24 |
misc |
311 |
file { [$local_dir,$local_dirs]: |
25 |
misc |
2593 |
ensure => directory, |
26 |
misc |
299 |
} |
27 |
misc |
306 |
|
28 |
misc |
2205 |
# workaround the lack of umask command in puppet < 2.7 |
29 |
boklm |
3254 |
mga_common::local_script { 'create_svn_repo.sh': |
30 |
misc |
2593 |
content => template('subversion/create_svn_repo.sh') |
31 |
misc |
2205 |
} |
32 |
misc |
323 |
|
33 |
boklm |
650 |
file { "$local_dir/pre-commit.d/no_binary": |
34 |
misc |
2593 |
mode => '0755', |
35 |
|
|
content => template('subversion/no_binary') |
36 |
boklm |
650 |
} |
37 |
|
|
|
38 |
misc |
307 |
file { "$local_dir/pre-commit.d/no_root_commit": |
39 |
misc |
2593 |
mode => '0755', |
40 |
|
|
content => template('subversion/no_root_commit') |
41 |
misc |
307 |
} |
42 |
|
|
|
43 |
|
|
file { "$local_dir/pre-commit.d/no_empty_message": |
44 |
misc |
2593 |
mode => '0755', |
45 |
|
|
content => template('subversion/no_empty_message') |
46 |
misc |
307 |
} |
47 |
|
|
|
48 |
misc |
1809 |
file { "$local_dir/pre-commit.d/single_word_commit": |
49 |
misc |
2593 |
mode => '0755', |
50 |
|
|
content => template('subversion/single_word_commit') |
51 |
misc |
1809 |
} |
52 |
|
|
|
53 |
misc |
809 |
file { "$local_dir/pre-revprop-change": |
54 |
misc |
2593 |
mode => '0755', |
55 |
|
|
content => template('subversion/pre-revprop-change') |
56 |
misc |
809 |
} |
57 |
|
|
|
58 |
colin |
3318 |
file { "$local_dir/pre-commit.d/converted_to_git": |
59 |
|
|
mode => '0755', |
60 |
|
|
content => template('subversion/converted_to_git') |
61 |
|
|
} |
62 |
|
|
|
63 |
misc |
309 |
# TODO : add check for |
64 |
|
|
# - ym perl -MYAML -e 'YAML::LoadFile("-");' |
65 |
|
|
# - tt ( do not seem to be possible, but this would be great ) |
66 |
|
|
# - php php -l |
67 |
|
|
# - python |
68 |
|
|
# - named named-checkzone/named-checkconf ( may requires some interaction with facter/erb ) |
69 |
|
|
# - po msgfmt -c |
70 |
|
|
# - openldap , like named |
71 |
|
|
|
72 |
misc |
324 |
define syntax_check($regexp_ext,$check_cmd) { |
73 |
boklm |
2932 |
file { "${subversion::server::local_dir}/pre-commit.d/$name": |
74 |
misc |
2593 |
mode => '0755', |
75 |
|
|
content => template('subversion/syntax_check.sh') |
76 |
misc |
324 |
} |
77 |
|
|
} |
78 |
|
|
|
79 |
|
|
|
80 |
misc |
2593 |
syntax_check{'check_perl': |
81 |
misc |
1758 |
regexp_ext => '\.p[lm]$', |
82 |
misc |
2593 |
check_cmd => 'perl -c' |
83 |
misc |
306 |
} |
84 |
misc |
318 |
|
85 |
misc |
2593 |
syntax_check{'check_puppet': |
86 |
misc |
1758 |
regexp_ext => '\.pp$', |
87 |
misc |
2593 |
check_cmd => 'puppet parser validate -' |
88 |
misc |
318 |
} |
89 |
|
|
|
90 |
misc |
2593 |
syntax_check{'check_ruby': |
91 |
misc |
1758 |
regexp_ext => '\.rb$', |
92 |
misc |
2593 |
check_cmd => 'ruby -c' |
93 |
misc |
318 |
} |
94 |
|
|
|
95 |
misc |
2593 |
syntax_check{'check_puppet_templates': |
96 |
misc |
1758 |
regexp_ext => 'modules/.*/templates/.*$', |
97 |
misc |
2593 |
check_cmd => 'erb -P -x -T - | ruby -c' |
98 |
misc |
318 |
} |
99 |
misc |
1587 |
|
100 |
misc |
2593 |
syntax_check{'check_po': |
101 |
misc |
1758 |
regexp_ext => '\.po$', |
102 |
misc |
2593 |
check_cmd => 'msgfmt -c -' |
103 |
misc |
1587 |
} |
104 |
|
|
|
105 |
misc |
2593 |
syntax_check{'check_php': |
106 |
misc |
1758 |
regexp_ext => '\.php$', |
107 |
misc |
2593 |
check_cmd => 'php -d display_errors=1 -d error_reporting="E_ALL|E_STRICT" -l' |
108 |
misc |
1692 |
} |
109 |
misc |
1587 |
|
110 |
misc |
2593 |
# needed for check_php |
111 |
|
|
package { 'php-cli': } |
112 |
misc |
83 |
} |
113 |
misc |
2593 |
# TODO |
114 |
misc |
309 |
# deploy a cronjob to make a backup file ( ie, dump in some directory ) |
115 |
misc |
83 |
} |