summaryrefslogtreecommitdiff
path: root/manifests/expire/sqlite.pp
blob: a9fed4b30e8ae98b8bdb0c685ba508c14ee53a35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class dovecot::expire::sqlite {
  include ::sqlite
  file{'/var/lib/dovecot/expire.db':
    ensure => file,
    replace => false,
    require => Package['sqlite'],
    owner => root, group => 0, mode => 0600;
  }
  file{'/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,
  }
}