Sha256: 9f0eaf735d685d1a03bb6ce03443fa14a36dad01783d8f3018b9503be6551a59
Contents?: true
Size: 583 Bytes
Versions: 13
Compression:
Stored size: 583 Bytes
Contents
module ForemanAnsible # Scans ConfigReports after import for indicators of an Ansible report and # sets the origin of the report to 'Ansible' class AnsibleReportScanner class << self def scan(report, logs) if (is_ansible = ansible_report?(logs)) report.origin = 'Ansible' end is_ansible end def ansible_report?(logs) return false if logs.blank? logs.any? do |log| log['log'].fetch('messages', {}). fetch('message', '') =~ /"_ansible_parsed"/ end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems