Use creates property of exec

... instead of unless + test command, to leverage the built-in feature
and simplify the logic in our own modules.

Change-Id: I0d5e98fcfcada5637dd0c3cc60e503b73241f3fd
This commit is contained in:
Takashi Kajinami
2024-03-14 12:31:55 +09:00
parent 4105195a3b
commit 722d68b036

View File

@@ -62,7 +62,7 @@ define swift::storage::loopback(
exec { "create_partition-${name}":
command => "dd if=/dev/zero of=${base_dir}/${name} bs=${byte_size} count=0 seek=${seek}",
path => ['/usr/bin/', '/bin'],
unless => "test -f ${base_dir}/${name}",
creates => "${base_dir}/${name}",
before => Anchor['swift::config::end'],
}