Skip to content

Commit

Permalink
Merge pull request #6688 from martinpovolny/more_a_methods
Browse files Browse the repository at this point in the history
Load inputs for Ansible* methods.

(cherry picked from commit 9c9e879)

https://bugzilla.redhat.com/show_bug.cgi?id=1794780
  • Loading branch information
mzazrivec authored and simaishi committed Apr 3, 2020
1 parent 8e8c426 commit e541c43
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions app/controllers/miq_ae_class_controller.rb
Expand Up @@ -1021,19 +1021,21 @@ def method_form_fields
:managers => list_of_managers,
:manager_id => manager_id,
:available_datatypes => MiqAeField.available_datatypes_for_ui,
:config_info => { :repository_id => method.options[:repository_id] || '',
:ansible_template_id => method.options[:ansible_template_id] || '',
:playbook_id => method.options[:playbook_id] || '',
:credential_id => method.options[:credential_id] || '',
:vault_credential_id => method.options[:vault_credential_id] || '',
:network_credential_id => method.options[:network_credential_id] || '',
:cloud_credential_id => method.options[:cloud_credential_id] || '',
:verbosity => method.options[:verbosity],
:become_enabled => method.options[:become_enabled] || false,
:execution_ttl => method.options[:execution_ttl] || '',
:hosts => method.options[:hosts] || 'localhost',
:log_output => method.options[:log_output] || 'on_error',
:extra_vars => location == 'playbook' && method.inputs }
:config_info => {
:repository_id => method.options[:repository_id] || '',
:ansible_template_id => method.options[:ansible_template_id] || '',
:playbook_id => method.options[:playbook_id] || '',
:credential_id => method.options[:credential_id] || '',
:vault_credential_id => method.options[:vault_credential_id] || '',
:network_credential_id => method.options[:network_credential_id] || '',
:cloud_credential_id => method.options[:cloud_credential_id] || '',
:verbosity => method.options[:verbosity],
:become_enabled => method.options[:become_enabled] || false,
:execution_ttl => method.options[:execution_ttl] || '',
:hosts => method.options[:hosts] || 'localhost',
:log_output => method.options[:log_output] || 'on_error',
:extra_vars => playbook_style_location?(location) && method.inputs
}
}
render :json => method_hash
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/miq_ae_class/_method_inputs.html.haml
Expand Up @@ -63,7 +63,7 @@
.form-group
= format_form_group(_('Max TTL'), @playbook_details[:execution_ttl])

- if @ae_method.location == 'playbook'
- if %w[playbook ansible_job_template].include?(@ae_method.location)
.form-group
= format_form_group(_('Hosts'), @playbook_details[:hosts])
.form-group
Expand Down

0 comments on commit e541c43

Please sign in to comment.