Looking in the Bolt documentation, I didn't find how to check the existence of a file on the remote machine using Puppet plans.
Using get_resources could be used but the problem is that it requires the Puppet agent to be installed on the remote machine which is something I want to avoid for the moment.
Another way to do is to use a shell script with run_command and it will probably be my way to handle this.
Any other idea ?
Developer on Bolt here, very excited to see your question asked here! I actually think
run_command
would most likely be more efficient for this use case thanget_resources
, all other things being equal. Not sure if you're on Windows, *nix, or both, but assuming *nix I think you'll want something like:There isn't any better or more "native" way to check for the file existence on remote systems than that. The
file::exist
plan function is for the local machine only since it uses the same file-finder in Bolt that we use to find modules, Bolt configuration, etc. But that file-finder isn't available on the remote systems.