Run hindsight on ubuntu 16.04
Change-Id: I4fa43e890dd99eab970a990410e4d9df27687357
This commit is contained in:
parent
6cda677c89
commit
4ffa31b4ad
|
@ -151,14 +151,42 @@ $scripts = {
|
||||||
|
|
||||||
create_resources(file, $scripts, $files_defaults)
|
create_resources(file, $scripts, $files_defaults)
|
||||||
|
|
||||||
file { '/etc/init/telemetry-collector-hindsight.conf':
|
if $::operatingsystem == 'Ubuntu' {
|
||||||
content => template( "${templates}/init.conf.erb"),
|
if versioncmp($::operatingsystemmajrelease, '16') >= 0 {
|
||||||
before => Service['telemetry-collector-hindsight'],
|
|
||||||
|
$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':
|
service { 'telemetry-collector-hindsight':
|
||||||
ensure => 'running',
|
ensure => 'running',
|
||||||
enable => true,
|
enable => true,
|
||||||
provider => 'upstart',
|
provider => $hindsight_provider,
|
||||||
require => File['/etc/init/telemetry-collector-hindsight.conf'],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue