Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service: hasrestart/hasstatus: use Puppet defaults #335

Merged
merged 1 commit into from
Apr 16, 2024
Merged
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
8 changes: 5 additions & 3 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,19 @@ Default value: `'running'`

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

Data type: `Boolean`
Data type: `Optional[Boolean]`



Default value: `undef`

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

Data type: `Boolean`
Data type: `Optional[Boolean]`



Default value: `true`
Default value: `undef`

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

Expand Down
1 change: 0 additions & 1 deletion data/os/Debian.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
keepalived::sysconf_dir: 'default'
keepalived::sysconf_options: ''
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,4 +1,3 @@
---
keepalived::sysconf_dir: 'conf.d'
keepalived::sysconf_options: '-D'
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,4 +1,3 @@
---
keepalived::sysconf_dir: 'sysconfig'
keepalived::sysconf_options: '-D'
keepalived::service_hasrestart: true
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
class keepalived (
String[1] $sysconf_dir,
String $sysconf_options,
Boolean $service_hasrestart,
Boolean $service_hasstatus = true,
Optional[Boolean] $service_hasrestart = undef,
Optional[Boolean] $service_hasstatus = undef,

Stdlib::Absolutepath $config_dir = '/etc/keepalived',
Stdlib::Filemode $config_dir_mode = '0755',
Expand Down
26 changes: 6 additions & 20 deletions spec/classes/keepalived_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,12 @@
)
}

case facts[:osfamily]
when 'Debian'
it {
is_expected.to contain_service('keepalived').with(
'ensure' => 'running',
'enable' => 'true',
'hasrestart' => 'false',
'hasstatus' => 'true'
)
}
else
it {
is_expected.to contain_service('keepalived').with(
'ensure' => 'running',
'enable' => 'true',
'hasrestart' => 'true',
'hasstatus' => 'true'
)
}
end
it {
is_expected.to contain_service('keepalived').with(
'ensure' => 'running',
'enable' => 'true'
)
}
end

describe 'with parameter: config_dir' do
Expand Down