Skip to content

Commit

Permalink
redis::instance: do not exec cp if source and destination are equal
Browse files Browse the repository at this point in the history
  • Loading branch information
trefzer committed Dec 11, 2021
1 parent 4a8d781 commit 0c52693
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions manifests/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,6 @@
if $title != 'default' {
$real_service_ensure = $service_ensure == 'running'
$real_service_enable = $service_enable

Exec["cp -p ${redis_file_name_orig} ${redis_file_name}"] ~> Service["${service_name}.service"]
} else {
$real_service_ensure = undef
$real_service_enable = undef
Expand Down Expand Up @@ -496,9 +494,15 @@
),
}

exec { "cp -p ${redis_file_name_orig} ${redis_file_name}":
path => '/usr/bin:/bin',
subscribe => File[$redis_file_name_orig],
refreshonly => true,
if $redis_file_name_orig != $redis_file_name {
exec { "cp -p ${redis_file_name_orig} ${redis_file_name}":
path => '/usr/bin:/bin',
subscribe => File[$redis_file_name_orig],
refreshonly => true,
}

if $title != 'default' and $manage_service_file {
Exec["cp -p ${redis_file_name_orig} ${redis_file_name}"] ~> Service["${service_name}.service"]
}
}
}

0 comments on commit 0c52693

Please sign in to comment.