Skip to content

Commit

Permalink
Gentoo/Debian: Enable hasstatus for service
Browse files Browse the repository at this point in the history
The services are deployed as proper systemd services on all OSes. When
hasstatus is true, Puppet will use systemctl to check if the service is
running. If it's false, Puppet will try to grep within `ps` for the
service. That's unreliable and doesn't make any sense. See:
https://www.puppet.com/docs/puppet/8/types/service.html#service-description

it's not clear why this ever was introduced: ace4ed6
  • Loading branch information
bastelfreak committed Apr 16, 2024
1 parent 827e41c commit 86b83d3
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ Data type: `Boolean`



Default value: `true`

##### <a name="-keepalived--service_manage"></a>`service_manage`

Data type: `Boolean`
Expand Down
1 change: 0 additions & 1 deletion data/os/Debian.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
keepalived::sysconf_dir: 'default'
keepalived::sysconf_options: ''
keepalived::service_hasstatus: false
keepalived::service_hasrestart: false
1 change: 0 additions & 1 deletion data/os/Gentoo.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
keepalived::sysconf_dir: 'conf.d'
keepalived::sysconf_options: '-D'
keepalived::service_hasstatus: false
keepalived::service_hasrestart: false
1 change: 0 additions & 1 deletion data/os/RedHat.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
keepalived::sysconf_dir: 'sysconfig'
keepalived::sysconf_options: '-D'
keepalived::service_hasstatus: true
keepalived::service_hasrestart: true
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
String[1] $sysconf_dir,
String $sysconf_options,
Boolean $service_hasrestart,
Boolean $service_hasstatus,
Boolean $service_hasstatus = true,

Stdlib::Absolutepath $config_dir = '/etc/keepalived',
Stdlib::Filemode $config_dir_mode = '0755',
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/keepalived_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
'ensure' => 'running',
'enable' => 'true',
'hasrestart' => 'false',
'hasstatus' => 'false'
'hasstatus' => 'true'
)
}
else
Expand Down

0 comments on commit 86b83d3

Please sign in to comment.