Sha256: 93a7f73de104fdbf1218993e465021cdb42e50dbaeaa513fa4afd2f44fe7978d

Contents?: true

Size: 911 Bytes

Versions: 33

Compression:

Stored size: 911 Bytes

Contents

module ForemanRhCloud
  # Macro to fetch remediation playbook from cloud.redhat.com
  module TemplateRendererHelper
    extend ActiveSupport::Concern
    extend ApipieDSL::Module

    apipie :class, 'Macros related to Red Hat cloud interface' do
      name 'RHCloud'
      sections only: %w[all jobs]
    end

    apipie :method, 'Returns a playbook generated from Red Hat cloud recommendations' do
      required :hit_remediation_pairs, String, desc: 'JSON-encoded array of hashes in the form of [{hit_id: 1, remediation_id: 2}, ...]'
      returns String, desc: 'Playbook generated for the specific recommendations and hosts'
    end
    def remediations_playbook(hit_remediation_pairs)
      hit_remediation_pairs = JSON.parse(hit_remediation_pairs)
      retriever = ForemanRhCloud::RemediationsRetriever.new(hit_remediation_pairs, logger: template_logger)
      retriever.create_playbook
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
foreman_rh_cloud-4.0.36 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-3.0.33 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-4.0.35 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-3.0.32 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-4.0.32 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-5.0.32 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-4.0.31 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-5.0.31 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-5.0.30 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-4.0.30 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-3.0.29 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-4.0.29 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-5.0.29 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-3.0.28 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-5.0.28 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-4.0.27 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-3.0.26 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-4.0.26 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-4.0.25.1 app/services/foreman_rh_cloud/template_renderer_helper.rb
foreman_rh_cloud-3.0.25 app/services/foreman_rh_cloud/template_renderer_helper.rb