Skip to content

Commit

Permalink
don't use active true, it does more harm than it's useful
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed May 21, 2024
1 parent 1ecc0df commit 26de9dc
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,20 @@
enable => bool2str($deployment_mode == 'package', $foreman_service_enable, 'false'),
}

if $deployment_mode == 'package' {
# podman::quadlet already creates a service with the same name
service { "${foreman_service}.service":
ensure => $foreman_service_ensure,
enable => $foreman_service_enable,
before => Service["${foreman_service}.socket"],
}
service { $foreman_service:
ensure => $foreman_service_ensure,
enable => $foreman_service_enable,
before => Service["${foreman_service}.socket"],
}

if $deployment_mode == 'container' {
file { '/etc/containers/systemd':
ensure => directory,
}
File['/etc/containers/systemd/foreman.container'] ~> Service[$foreman_service]
Systemd::Daemon_reload['foreman.container'] ~> Service[$foreman_service]
}

$quadlet_active = $deployment_mode ? { 'container' => true, default => undef }

podman::quadlet { 'foreman.container':
ensure => bool2str($deployment_mode == 'container', 'present', 'absent'),
unit_entry => {
Expand All @@ -78,6 +75,6 @@
install_entry => {
'WantedBy' => 'default.target',
},
active => $quadlet_active,
# don't set active true here, it makes podman::quadlet create a service that clashes with ours
}
}

0 comments on commit 26de9dc

Please sign in to comment.