Module: ForemanRhCloud::TemplateRendererHelper

Extended by:
ActiveSupport::Concern, ApipieDSL::Module
Defined in:
app/services/foreman_rh_cloud/template_renderer_helper.rb

Overview

Macro to fetch remediation playbook from cloud.redhat.com

Instance Method Summary collapse

Instance Method Details

#download_rh_playbook(playbook_url, organization_id) ⇒ Object



27
28
29
30
31
32
33
# File 'app/services/foreman_rh_cloud/template_renderer_helper.rb', line 27

def download_rh_playbook(playbook_url, organization_id)
  retriever = ForemanRhCloud::UrlRemediationsRetriever.new(url: playbook_url, organization_id: organization_id, logger: template_logger)

  cached("rh_playbook_#{playbook_url}") do
    retriever.create_playbook
  end
end

#remediations_playbook(hit_remediation_pairs) ⇒ Object



16
17
18
19
20
# File 'app/services/foreman_rh_cloud/template_renderer_helper.rb', line 16

def remediations_playbook(hit_remediation_pairs)
  hit_remediation_pairs = JSON.parse(hit_remediation_pairs)
  retriever = ForemanRhCloud::HitRemediationsRetriever.new(hit_remediation_pairs, logger: template_logger)
  retriever.create_playbook
end