aboutsummaryrefslogtreecommitdiff
path: root/modules/etckeeper/manifests/init.pp
blob: d7039a255f3d809d5ccbea19b280cdb05ca54ab4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class etckeeper {
  ensure_packages('etckeeper')

  exec { 'etckeeper-gitignore':
    environment => ['VCS=git', 'LOWLEVEL_PACKAGE_MANAGER=pacman'],
    path        => '/usr/bin',
    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/',
    cwd         => '/tmp',
    creates     => '/etc/.gitignore_etckeeper'
  }

  file { 'etckeeper-additional_gitignore':
    source  => 'puppet:///modules/etckeeper/additional_gitignore',
    path    => '/etc/.gitignore_additional'
  }

  exec { 'etckeeper-concat_files':
    path        => '/usr/bin',
    command     => 'cat /etc/.gitignore_etckeeper /etc/.gitignore_additional > /etc/.gitignore',
    refreshonly => true,
    subscribe   => [Exec['etckeeper-gitignore'], File['etckeeper-additional_gitignore']]
  }

  exec { 'etckeeper-init':
    command => 'etckeeper init',
    path    => '/usr/bin',
    cwd     => '/etc',
    creates => '/etc/.git'
  }

}