diff --git a/app/helpers/foreman_ansible/ansible_reports_helper.rb b/app/helpers/foreman_ansible/ansible_reports_helper.rb index 88cbdb601..b8a2722b0 100644 --- a/app/helpers/foreman_ansible/ansible_reports_helper.rb +++ b/app/helpers/foreman_ansible/ansible_reports_helper.rb @@ -27,6 +27,8 @@ def check_mode_log?(log) def ansible_module_message(log) msg_json = parsed_message_json(log) + return _("Execution error: #{msg_json['msg']}") if msg_json['failed'].present? + module_action = msg_json['module'] case module_action when 'package' @@ -67,6 +69,17 @@ def ansible_report?(log) false end + def show_full_error_message_value(message_value) + tag.div class: 'replace-hidden-value' do + link_to_function(icon_text('plus', '', class: 'small'), 'replace_value_control(this, "div")', + title: _('Show full value'), + class: 'replace-hidden-value pull-right') + + (tag.span class: 'full-value' do + message_value + end) + end + end + private def parsed_message_json(log) diff --git a/app/views/foreman_ansible/config_reports/_ansible.html.erb b/app/views/foreman_ansible/config_reports/_ansible.html.erb index c3c14c807..bc2b4706c 100644 --- a/app/views/foreman_ansible/config_reports/_ansible.html.erb +++ b/app/views/foreman_ansible/config_reports/_ansible.html.erb @@ -29,8 +29,12 @@ <% end %> <% else %> - <%= log_message %> - <% end %> + <% allowed_length = 150 %> +