Sha256: 80bb4f331f20f48de47f2ca9e5310bcda04caac9a97435e0c861b90d0f5387d1

Contents?: true

Size: 801 Bytes

Versions: 4

Compression:

Stored size: 801 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!')
          JobTemplate.import_raw!(File.read(template), :default => true, :locked => true, :update => sync)
        else
          JobTemplate.import!(File.read(template), :default => true, :locked => true, :update => sync)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
katello-3.7.0 db/seeds.d/75-job_templates.rb
katello-3.8.0.rc1 db/seeds.d/75-job_templates.rb
katello-3.7.0.rc2 db/seeds.d/75-job_templates.rb
katello-3.7.0.rc1 db/seeds.d/75-job_templates.rb