Forum: CFEngine Help Subject: copy_from: would like priority list of sources, then silent fail Author: davidlee Link to topic: https://cfengine.com/forum/read.php?3,25584,25584#msg-25584
(RHEL 5.x (~35 and growing); cfengine: mostly community 3.1.4; starting migration to 3.3.0) We have several instances where our client machines use "copy_from" to import a file or a hierarchy from a single source on the central repository, and for which the absence of the file or hierarchy root in that source should be reported an error. That's fine. But there is one particular case where I'd like the source to be something like: try-file-location-1 fall-back-to-file-location-2 fall-back-to-file-location-3 ... silently skip So two aspects: (a) a preferentially-ordered list of source file locations on the central repo (b) if none exist, then silently skip. But I don't see anything in the "copy_from" body template that assists with either of these aspects. Have I missed something? The nearest I saw was the "files_single_copy"; but that seems: (a) to be global across all copy operations (not targetable to just the few we want); (b) not to be applicable where the sources are on the remote hub; (c) unclear about whether it would "silently skip" if all source locations are non-existent. (If the "silent skip" aspect would be tricky or breach promise theory, then I think I might be able to side-step that with a final-case "null hierarchy" source.) Hints and guidance welcome! _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine