Skip to content

Commit

Permalink
Install rsync-daemon in CentOS >= 8 when not using xinetd
Browse files Browse the repository at this point in the history
Since CentOS 8, rsyncd systemd unit is shipped in a different package,
rsync-dameon. When setting use_xinetd to false in rsync::server, this
package should be installed for CentOS >= 8.
  • Loading branch information
amoralej committed Sep 24, 2021
1 parent ebc7ecd commit 8f6a965
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
stage: deploy
branches:
only:
- master
- main
- /^v\d/
notifications:
email: false
9 changes: 9 additions & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@
require => Package['rsync'],
}
} else {
if ($facts['os']['family'] == 'RedHat') and
(Integer($facts['os']['release']['major']) >= 8) and
($rsync::manage_package) {
package { 'rsync-daemon':
ensure => $rsync::package_ensure,
notify => Service[$servicename],
}
}

service { $servicename:
ensure => running,
enable => true,
Expand Down
5 changes: 3 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">=4.2.0 <7.0.0"
"version_requirement": ">=4.2.0 <9.0.0"
},
{
"name": "puppetlabs/xinetd",
Expand All @@ -26,7 +26,8 @@
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"6.0",
"7.0"
"7.0",
"8.0"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
'rsync'
end
it { is_expected.to contain_service(servicename) }
if facts[:os][:family] == 'RedHat' && Integer(facts[:os][:release][:major]) >= 8
it { is_expected.to contain_package('rsync-daemon') }
end
end

describe 'when setting an motd' do
Expand Down

0 comments on commit 8f6a965

Please sign in to comment.