Bolt: How to upload a downloaded file?

18 views
Skip to first unread message

Helmut Rickel

unread,
Apr 27, 2022, 8:24:03 AM4/27/22
to Puppet Users
Hello,
this surely is a beginners question:
Using bolt, I want to download a file from one server and upload it to a another server. Problem: The function download_file uses a destination path relative to the project directory, but upload_file needs an absolute source path. How do I get this absolute source path?

Thanks for your help!

Kind regards
Helmut

Martin Alfke

unread,
Apr 27, 2022, 9:30:14 AM4/27/22
to puppet...@googlegroups.com
Hi,

You can reference the actual path by using pwd:

bolt file upload $(pwd)/inventory.yaml /root/ -t login

Hth,
Martin


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/de6003ab-cb05-46fb-b22c-c57ce5a07a05n%40googlegroups.com.

Helmut Rickel

unread,
Apr 27, 2022, 10:53:44 AM4/27/22
to Puppet Users
Hello Martin,

my problem was how to implement this in a plan.  In the meantime, a colleague told me to use <module_name>/downloads/<download_folder>/<source_servername>/<filename>  . This is fine for me.

Anyway: Thanks a lot for your answer!!!

Kind regards
Helmut
Reply all
Reply to author
Forward
0 new messages