Sha256: f5b32a617c00d1b4f7318ef56b7fea31a1d88cc2ffe871eec2cfba6905aeb60c
Contents?: true
Size: 1022 Bytes
Versions: 51
Compression:
Stored size: 1022 Bytes
Contents
if Katello.with_remote_execution? User.as_anonymous_admin do JobTemplate.without_auditing do template_files = Dir[File.join("#{Katello::Engine.root}/app/views/foreman/job_templates/**/*.erb")] template_files.reject! { |file| file.end_with?('_ansible_default.erb') } unless Katello.with_ansible? template_files.each do |template| sync = !Rails.env.test? && Setting[:remote_execution_sync_templates] # import! was renamed to import_raw! around 1.3.1 if JobTemplate.respond_to?('import_raw!') template = JobTemplate.import_raw!(File.read(template), :default => true, :locked => true, :update => sync) else template = JobTemplate.import!(File.read(template), :default => true, :locked => true, :update => sync) end template.organizations << Organization.unscoped.all if template && template.organizations.empty? template.locations << Location.unscoped.all if template && template.locations.empty? end end end end
Version data entries
51 entries across 51 versions & 1 rubygems