OP#414 add service definition
This commit is contained in:
@@ -7,4 +7,9 @@ class confdroid_gitea::main::config (
|
||||
|
||||
) inherits confdroid_gitea::params {
|
||||
include confdroid_gitea::main::service
|
||||
|
||||
exec { 'systemd-daemon-reload':
|
||||
command => '/bin/systemctl daemon-reload',
|
||||
refreshonly => true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,5 +31,14 @@ class confdroid_gitea::main::files (
|
||||
mode => '0640',
|
||||
content => template($ga_config_erb),
|
||||
}
|
||||
|
||||
file { $ga_service_file:
|
||||
ensure => 'file',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
content => template($ga_service_erb),
|
||||
notify => Exec['systemd-daemon-reload'],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,5 +9,14 @@ class confdroid_gitea::main::service (
|
||||
if $ga_host_fqdn == $fqdn {
|
||||
require confdroid_gitea::firewall::iptables
|
||||
require confdroid_gitea::main::files
|
||||
|
||||
service { $ga_service_name:
|
||||
ensure => 'running',
|
||||
enable => true,
|
||||
hasrestart => true,
|
||||
hasstatus => true,
|
||||
require => File[$ga_service_file],
|
||||
subscribe => File[$ga_config_file],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,6 +133,11 @@ class confdroid_gitea::params (
|
||||
# files
|
||||
$ga_config_file = "${ga_conf_dir}/app.ini"
|
||||
$ga_config_erb = 'confdroid_gitea/app.ini.erb'
|
||||
$ga_service_file = '/etc/systemd/system/gitea.service'
|
||||
$ga_service_erb = 'confdroid_gitea/gitea_service.erb'
|
||||
|
||||
# Service
|
||||
$ga_service_name = 'gitea'
|
||||
|
||||
# includes must be last
|
||||
include confdroid_gitea::main::config
|
||||
|
||||
Reference in New Issue
Block a user