From 64b7667b86d794828dd1c777d24035e5f1b993bf Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 10 Jan 2024 15:13:09 +0900 Subject: [PATCH] Use ensure_resource to declare rsync::server ... instead of skipping the 2nd declaration, to detect conflicting definitions. Change-Id: I7370f740da55bc7128fbef21599907365c49cd93 --- manifests/ringserver.pp | 12 +++++------- manifests/storage.pp | 12 +++++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/manifests/ringserver.pp b/manifests/ringserver.pp index 62cc43d6..c7c05243 100644 --- a/manifests/ringserver.pp +++ b/manifests/ringserver.pp @@ -42,13 +42,11 @@ class swift::ringserver( fail('xinetd is not available in this distro') } - if !defined(Class['rsync::server']) { - class { 'rsync::server': - use_xinetd => $rsync_use_xinetd, - address => $local_net_ip, - use_chroot => 'no', - } - } + ensure_resource('class', 'rsync::server', { + 'use_xinetd' => $rsync_use_xinetd, + 'address' => $local_net_ip, + 'use_chroot' => 'no', + }) rsync::server::module { 'swift_server': path => '/etc/swift', diff --git a/manifests/storage.pp b/manifests/storage.pp index 2400627a..0d752da2 100644 --- a/manifests/storage.pp +++ b/manifests/storage.pp @@ -35,11 +35,9 @@ class swift::storage( fail('xinetd is not available in this distro') } - if !defined(Class['rsync::server']){ - class{ 'rsync::server': - use_xinetd => $rsync_use_xinetd, - address => $storage_local_net_ip, - use_chroot => 'no', - } - } + ensure_resource('class', 'rsync::server', { + 'use_xinetd' => $rsync_use_xinetd, + 'address' => $storage_local_net_ip, + 'use_chroot' => 'no', + }) }