Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions modules/profile/manifests/github_runner/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
$github_runner_user = $user
$github_runner_group = $group
$systemd_file = '/etc/systemd/system/actions-runner.service'
$service_check_file = '/usr/local/bin/actions-runner-check.sh'
file { $systemd_file:
ensure => file,
content => template('profile/github_runner/actions-runner.service.erb'),
Expand All @@ -20,6 +21,14 @@
notify => Exec['daemon-reload'],
}

file { $service_check_file:
ensure => file,
content => template('profile/github_runner/actions-runner-check.sh.erb'),
owner => $user,
group => $group,
mode => 'a+x',
}

exec { 'daemon-reload':
command => '/usr/bin/systemctl daemon-reload',
refreshonly => true,
Expand All @@ -46,4 +55,17 @@
user => 'root',
minute => '*/5',
}

cron { 'check-status':
command => [
'bash',
$service_check_file,
].join(' '),
environment => [
'PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin',
"MAILTO=${mailto}"
],
user => 'root',
minute => '*/5',
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

SERVICE="actions-runner"

# Check if the service is active
if ! systemctl is-active --quiet $SERVICE; then
ih-aws autoscaling mark-unhealthy
fi
if systemctl is-failed --quiet $SERVICE; then
ih-aws autoscaling mark-unhealthy
fi