Sha256: 0c703dfeb0c0db26e6753110941fcfa29bf1ed238a24c24dc5d6227dd6cc9da7

Contents?: true

Size: 689 Bytes

Versions: 10

Compression:

Stored size: 689 Bytes

Contents

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]
      template = JobTemplate.import_raw!(File.read(template), :default => true, :lock => true, :update => sync)

      template.organizations << Organization.unscoped.all if template&.organizations&.empty?
      template.locations << Location.unscoped.all if template&.locations&.empty?
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
katello-4.14.2 db/seeds.d/75-job_templates.rb
katello-4.15.0 db/seeds.d/75-job_templates.rb
katello-4.15.0.rc2 db/seeds.d/75-job_templates.rb
katello-4.15.0.rc1 db/seeds.d/75-job_templates.rb
katello-4.14.1 db/seeds.d/75-job_templates.rb
katello-4.14.0 db/seeds.d/75-job_templates.rb
katello-4.14.0.rc3 db/seeds.d/75-job_templates.rb
katello-4.14.0.rc2 db/seeds.d/75-job_templates.rb
katello-4.14.0.rc1.1 db/seeds.d/75-job_templates.rb
katello-4.14.0.rc1 db/seeds.d/75-job_templates.rb