puppet-watcher/manifests/db/create_schema.pp
Daniel Pawlik c5ddc31f46 Implement watcher-db-manage commands
Added DB commands: upgrade and create_schema.
Removed sync command.


Change-Id: I1c4e2c36ba675cfbbbde3b038067f73c98c150ff
2016-07-11 19:24:28 +00:00

31 lines
965 B
Puppet

#
# Class to execute watcher-db-manage create_schema
#
# == Parameters
#
# [*extra_params*]
# (optional) String of extra command line parameters to append
# to the watcher-db-manage create_schema command.
# Defaults to '--config-file /etc/watcher/watcher.conf'
#
class watcher::db::create_schema(
$extra_params = '--config-file /etc/watcher/watcher.conf',
) {
exec { 'watcher-db-manage-create_schema':
command => "watcher-db-manage ${extra_params} create_schema",
path => '/usr/bin',
user => 'watcher',
refreshonly => true,
subscribe => [
Package['watcher'],
Watcher_config['database/connection'],
Anchor['watcher::install::end'],
Anchor['watcher::config::end'],
Anchor['watcher::db::create_schema::begin']
],
notify => Anchor['watcher::db::create_schema::end'],
}
Exec['watcher-db-manage-create_schema'] ~> Service<| title == 'watcher-db-manage-create_schema' |>
}