Run hindsight on ubuntu 16.04

Change-Id: I4fa43e890dd99eab970a990410e4d9df27687357
This commit is contained in:
Mykyta Karpin 2017-03-27 18:52:10 +03:00
parent 6cda677c89
commit 4ffa31b4ad
2 changed files with 47 additions and 5 deletions

View File

@ -151,14 +151,42 @@ $scripts = {
create_resources(file, $scripts, $files_defaults)
file { '/etc/init/telemetry-collector-hindsight.conf':
content => template( "${templates}/init.conf.erb"),
before => Service['telemetry-collector-hindsight'],
if $::operatingsystem == 'Ubuntu' {
if versioncmp($::operatingsystemmajrelease, '16') >= 0 {
$hindsight_provider = 'systemd'
file { 'hindsight-service-unit':
ensure => present,
path => '/lib/systemd/system/telemetry-collector-hindsight.service',
mode => '0644',
content => template("${templates}/hindsight.unit.erb"),
}
exec { 'systemctl-daemon-reload':
command => 'systemctl daemon-reload',
refreshonly => true,
path => $::path,
}
File['hindsight-service-unit'] ~> Exec['systemctl-daemon-reload'] -> Service['telemetry-collector-hindsight']
} else {
$hindsight_provider = 'upstart'
file { '/etc/init/telemetry-collector-hindsight.conf':
content => template( "${templates}/init.conf.erb"),
}
File['/etc/init/telemetry-collector-hindsight.conf'] ~> Service['telemetry-collector-hindsight']
}
} else {
$hindsight_provider = undef
}
service { 'telemetry-collector-hindsight':
ensure => 'running',
enable => true,
provider => 'upstart',
require => File['/etc/init/telemetry-collector-hindsight.conf'],
provider => $hindsight_provider,
}

View File

@ -0,0 +1,14 @@
# Autogenerated by Puppet
# Do not edit
[Unit]
Description=Telemetry collector hindsight service
[Service]
Type=simple
User=hindsight
ExecStart=/usr/bin/hindsight <%= @conf_dir %>/hindsight.cfg
Restart=always
[Install]
WantedBy=multi-user.target