From 37a106c5de610ceae70c0f6d1719223a31735683 Mon Sep 17 00:00:00 2001 From: Shim Shtein Date: Thu, 20 Jun 2024 18:47:44 +0300 Subject: [PATCH] Fixes #37706 - Add a template that enables download and run of a script The main idea is to execute scripts from the Foreman server, similar to https://github.com/theforeman/foreman/pull/10208. --- .../templates/script/run_downloaded_script.erb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/views/templates/script/run_downloaded_script.erb diff --git a/app/views/templates/script/run_downloaded_script.erb b/app/views/templates/script/run_downloaded_script.erb new file mode 100644 index 000000000..4b0826358 --- /dev/null +++ b/app/views/templates/script/run_downloaded_script.erb @@ -0,0 +1,15 @@ +<%# +kind: job_template +name: Download and run a script +model: JobTemplate +job_category: Commands +description_format: "Download the script from %{url} and run it locally" +provider_type: script +template_inputs: +- name: url + description: URL of the script to download and execute + input_type: user + required: true +%> + +set -o pipefail && curl -sS '<%= input("url") %>' | bash