# == Class: vigie
#
# Vigie base package & configuration
#
# === Parameters
#
# [*package_ensure*]
#   (Optional) Ensure state for package.
#   Defaults to 'present'.
#
# [*purge_config*]
#   (optional) Whether to set only the specified config options
#   in the vigie config.
#   Defaults to false.
#
# [*sync_db*]
#   (Optional) Enable dbsync
#   Defaults to true.
#
class vigie(
  $package_ensure                     = 'present',
  Boolean $purge_config               = false,
  Boolean $sync_db                    = true,
  Boolean $accept_legacy_tls          = false,
){

  include vigie::deps
  include vigie::params
  include vigie::db

  package { 'vigie-common':
    ensure => $package_ensure,
    name   => $::vigie::params::common_package_name,
    tag    => ['openstack', 'vigie-package'],
  }

  resources { 'vigie_config':
    purge => $purge_config,
  }

  vigie_config {
    'DEFAULT/accept_legacy_tls':          value => $accept_legacy_tls;
  }

  if $sync_db {
    include vigie::db::sync
  }
}
