Running Python scripts in Provisioners

Hello everybody!

First time here. We have loads of Python scripts we have built over time and the question came up today if we could reuse those scripts through Packer on remote hosts. I have searched the entire afternoon and cannot find any satisfying answer.

Any help is greatly appreciated.

Thank you!

William

Hello,

You can upload those scripts with the file provisioner and use the shell provisioner to run them. Would that work for you?

1 Like

Hello @sylviamoss I have just been introduced to Packer so I can’t tell but reading through that I can’t think why it wouldn’t work. I will certainly try it.

Thank you for the response!

Great! Hope it will be useful to you. Let me know if you need anything else :slight_smile:

Hey @sylviamoss I just included your solution into our Packer instance and it worked flawless. Thank you again! :smiley:

2 Likes

Nice!! Glad to hear that it worked :slight_smile: