Skip to content

Commit

Permalink
Add a template that enables download and execution of a script
Browse files Browse the repository at this point in the history
The main idea is to execute scripts from the Foreman server, similar to theforeman/foreman#10208.
  • Loading branch information
ShimShtein committed Jun 20, 2024
1 parent 88ed856 commit af70107
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<%#
name: Download and execute a script
job_category: Ansible Commands
description_format: Download script from %{url} and execute it
snippet: false
template_inputs:
- name: url
required: true
input_type: user
description: "URL of the script to download e.g: http://example.com/unattended/anonymous/my_script"
advanced: false
provider_type: Ansible
kind: job_template
model: JobTemplate
%>

---
- hosts: all
tasks:
- shell:
cmd: |
<%= indent(10) { "set -o pipefail && curl -sS #{input("url")} | bash" } %>
register: out
- debug: var=out

0 comments on commit af70107

Please sign in to comment.