diff options
Diffstat (limited to 'modules/etckeeper/manifests/init.pp')
-rw-r--r-- | modules/etckeeper/manifests/init.pp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/modules/etckeeper/manifests/init.pp b/modules/etckeeper/manifests/init.pp new file mode 100644 index 0000000..d7039a2 --- /dev/null +++ b/modules/etckeeper/manifests/init.pp | |||
@@ -0,0 +1,31 @@ | |||
1 | class etckeeper { | ||
2 | ensure_packages('etckeeper') | ||
3 | |||
4 | exec { 'etckeeper-gitignore': | ||
5 | environment => ['VCS=git', 'LOWLEVEL_PACKAGE_MANAGER=pacman'], | ||
6 | path => '/usr/bin', | ||
7 | command => 'mkdir -p /tmp/etckeeper/.git && cd /tmp/etckeeper && /etc/etckeeper/update-ignore.d/01update-ignore && cp /tmp/etckeeper/.gitignore /etc/.gitignore_etckeeper && rm -r /tmp/etckeeper/', | ||
8 | cwd => '/tmp', | ||
9 | creates => '/etc/.gitignore_etckeeper' | ||
10 | } | ||
11 | |||
12 | file { 'etckeeper-additional_gitignore': | ||
13 | source => 'puppet:///modules/etckeeper/additional_gitignore', | ||
14 | path => '/etc/.gitignore_additional' | ||
15 | } | ||
16 | |||
17 | exec { 'etckeeper-concat_files': | ||
18 | path => '/usr/bin', | ||
19 | command => 'cat /etc/.gitignore_etckeeper /etc/.gitignore_additional > /etc/.gitignore', | ||
20 | refreshonly => true, | ||
21 | subscribe => [Exec['etckeeper-gitignore'], File['etckeeper-additional_gitignore']] | ||
22 | } | ||
23 | |||
24 | exec { 'etckeeper-init': | ||
25 | command => 'etckeeper init', | ||
26 | path => '/usr/bin', | ||
27 | cwd => '/etc', | ||
28 | creates => '/etc/.git' | ||
29 | } | ||
30 | |||
31 | } | ||