RedHat Satellite Job Templates render_template()

Posted on

Hi together,

i am currently trying to put together a JobTemplate.
I have my main JobTemplate called "RenderTest" and another one called "Service_Ops".

Service_Ops looks like this:

tasks:
<% if input('action') == 'stop' %>
- name: Print stop
ansible.builtin.debug:
msg: "stop"

<% elsif input('action') == 'start' %>
- name: Print start
ansible.builtin.debug:
msg: "start"
<% end -%>

In my RenderTest i have:

  • hosts: all

<%= render_template('Service_Ops'), :action => 'stop' %>
<%= render_template('Service_Ops'), :action => 'start' %>

My expected result would be that it prints both "stop" and "start", however it only prints "start" and i cant really wrap my head around why that is.

The input "action" does exist within the template (see Screenshot).
Template Inputs for "Service_Ops"

Can anyone explain what causes this behavior and how i can work it out?

Thank you so much!

Responses