Skip to content

Commit 6202c31

Browse files
committed
plugin/discovery: use refreshonly on the untar exec
Previously, if you change the image_name (such as for updating the Foreman Discovery Image version), the new tar file would be downloaded but not untarred because the content of the previous tar file would be there and pass the `creates` check. If we use `refreshonly` instead of `creates`, the untar exec will be executed when the tar file is updated, as expected. See also: theforeman#774 (comment)
1 parent 69c038e commit 6202c31

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

manifests/plugin/discovery.pp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
remote_location => "${source_url}${image_name}",
4343
mode => '0644',
4444
} ~> exec { "untar ${image_name}":
45-
command => "tar xf ${image_name}",
46-
path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
47-
cwd => "${tftp_root_clean}/boot",
48-
creates => "${tftp_root_clean}/boot/fdi-image/initrd0.img",
45+
command => "tar xf ${image_name}",
46+
path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
47+
cwd => "${tftp_root_clean}/boot",
48+
refreshonly => true,
4949
}
5050
}
5151
}

0 commit comments

Comments
 (0)