Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module JobTemplateExtensions
class_methods do
def job_template_params_filter
super.tap do |filter|
filter.permit :ansible_callback_enabled, :ansible_check_mode
filter.permit :ansible_callback_enabled, :ansible_check_mode, :ansible_diff_mode
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module JobTemplatesControllerExtensions
param :job_template, Hash do
param :ansible_callback_enabled, :bool, :desc => N_('Enable the callback plugin for this template')
param :ansible_check_mode, :bool, :desc => N_('Enable Ansible Check Mode for this template')
param :ansible_diff_mode, :bool, :desc => N_('Enable Ansible Diff Mode for this template')
end
end
end
Expand Down
1 change: 1 addition & 0 deletions app/models/foreman_ansible/ansible_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def proxy_command_options(template_invocation, host)
:name => host.name,
:check_mode => host.host_param('ansible_roles_check_mode'),
:job_check_mode => template_invocation.template.ansible_check_mode,
:job_diff_mode => template_invocation.template.ansible_diff_mode,
Comment on lines 35 to +37
Copy link
Member

@ofedoren ofedoren Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just looking at the pattern here: don't we need to add diff_mode here as well?.. Nervermind, I found it in another PR.

:cleanup_working_dirs => cleanup_working_dirs?(host)
)
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/api/v2/job_templates/job_templates.json.rabl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# frozen_string_literal: true

attributes :ansible_callback_enabled, :ansible_check_mode
attributes :ansible_callback_enabled, :ansible_check_mode, :ansible_diff_mode
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="tab-pane" id="ansible_callback_enabled">
<%= checkbox_f f, :ansible_callback_enabled, :label => _('Enable Ansible Callback'), :disabled => @template.locked? %>
<%= checkbox_f f, :ansible_check_mode, :label => _('Enable Ansible Check Mode'), :disabled => @template.locked? %>
<%= checkbox_f f, :ansible_diff_mode, :label => _('Enable Ansible Diff Mode'), :disabled => @template.locked? %>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddAnsibleDiffModeToTemplates < ActiveRecord::Migration[7.0]
def change
add_column :templates, :ansible_diff_mode, :boolean, default: false
end
end