diff --git a/app/controllers/concerns/foreman/controller/parameters/job_template_extensions.rb b/app/controllers/concerns/foreman/controller/parameters/job_template_extensions.rb index 36f54661..41f4712a 100644 --- a/app/controllers/concerns/foreman/controller/parameters/job_template_extensions.rb +++ b/app/controllers/concerns/foreman/controller/parameters/job_template_extensions.rb @@ -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 diff --git a/app/controllers/foreman_ansible/api/v2/job_templates_controller_extensions.rb b/app/controllers/foreman_ansible/api/v2/job_templates_controller_extensions.rb index f973e580..0a11a56f 100644 --- a/app/controllers/foreman_ansible/api/v2/job_templates_controller_extensions.rb +++ b/app/controllers/foreman_ansible/api/v2/job_templates_controller_extensions.rb @@ -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 diff --git a/app/models/foreman_ansible/ansible_provider.rb b/app/models/foreman_ansible/ansible_provider.rb index 2c37a658..4c0eae08 100644 --- a/app/models/foreman_ansible/ansible_provider.rb +++ b/app/models/foreman_ansible/ansible_provider.rb @@ -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, :cleanup_working_dirs => cleanup_working_dirs?(host) ) end diff --git a/app/views/api/v2/job_templates/job_templates.json.rabl b/app/views/api/v2/job_templates/job_templates.json.rabl index 6037682e..999ffec1 100644 --- a/app/views/api/v2/job_templates/job_templates.json.rabl +++ b/app/views/api/v2/job_templates/job_templates.json.rabl @@ -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 diff --git a/app/views/job_templates/_job_template_callback_tab_content.html.erb b/app/views/job_templates/_job_template_callback_tab_content.html.erb index d180dbd2..ff24c86a 100644 --- a/app/views/job_templates/_job_template_callback_tab_content.html.erb +++ b/app/views/job_templates/_job_template_callback_tab_content.html.erb @@ -1,4 +1,5 @@