summaryrefslogtreecommitdiff
path: root/manifests/expire/sqlite.pp
blob: b1724e1be2716052065ed54aec5f427a3db83803 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class dovecot::expire::sqlite {

  include dovecot::sql::sqlite

  file {
    '/var/lib/dovecot/expire.db':
      ensure => file,
      replace => false,
      require => Package['sqlite'],
      owner => root, group => 0, mode => 0600;

    '/var/lib/dovecot/expire.sql':
      source => "puppet:///modules/dovecot/expire/expire.sqlite.sql",
      require => File['/var/lib/dovecot/expire.db'],
      notify => Exec['create_expire_db'],
      owner => root, group => 0, mode => 0600;
  }

  exec { 'create_expire_db':
    command => 'cat /var/lib/dovecot/expire.sql | sqlite3 /var/lib/dovecot/expire.db',
    refreshonly => true,
  }
}