Defined Type: sqlite::db
- Defined in:
- modules/sqlite/manifests/db.pp
Summary
define to create and manage sqlite dbOverview
SPDX-License-Identifier: Apache-2.0
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'modules/sqlite/manifests/db.pp', line 9
define sqlite::db (
Wmflib::Ensure $ensure = 'present',
String $owner = 'root',
String $group = 'root',
Stdlib::Filemode $mode = '0660',
Optional[Stdlib::Unixpath] $db_path = undef,
Optional[Stdlib::Unixpath] $sql_schema = undef,
) {
include sqlite
$_db_path = $db_path ? {
undef => "${sqlite::default_db_path}/${title}.db",
default => $db_path,
}
file {$_db_path:
ensure => $ensure,
owner => $owner,
group => $group,
}
if $sql_schema {
exec{"sqlite_initialist_db_${title}":
path => ['/bin', '/usr/bin'],
user => $owner,
group => $group,
command => "cat ${sql_schema} | ${sqlite::sqlite_cmd} ${_db_path}",
refreshonly => true,
subscribe => File[$_db_path],
require => Package[$sqlite::package],
}
}
}
|