Sha256: ea323a1b529f4938e98141950b00a8ea9c019a6e3e36871f85100ad8b0894fad

Contents?: true

Size: 1021 Bytes

Versions: 120

Compression:

Stored size: 1021 Bytes

Contents

User.as_anonymous_admin do
  RemoteExecutionFeature.without_auditing do
    if Rails.env.test? || Foreman.in_rake?
      # If this file tries to import a template with a REX feature in a SeedsTest,
      # it will fail - the REX feature isn't registered on SeedsTest because
      # DatabaseCleaner truncates the db before every test.
      # During db:seed, we also want to know the feature is registered before
      # seeding the template
      # kudos to dLobatog
      ForemanRemoteExecution.register_rex_feature
    end
    JobTemplate.without_auditing do
      module_template = JobTemplate.find_by(name: 'Puppet Run Once - SSH Default')
      if module_template && !Rails.env.test? && Setting[:remote_execution_sync_templates]
        module_template.sync_feature('puppet_run_host')
        module_template.organizations << Organization.unscoped.all if module_template.organizations.empty?
        module_template.locations << Location.unscoped.all if module_template.locations.empty?
      end
    end
  end
end

Version data entries

120 entries across 120 versions & 1 rubygems

Version Path
foreman_remote_execution-13.2.7 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-15.0.0 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-14.1.4 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-14.1.3 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-14.1.2 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-14.1.1 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-14.1.0 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-14.0.2 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-14.0.1 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-13.2.6 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-14.0.0 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-13.2.5 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-13.2.4 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-13.2.3 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-13.2.2 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-12.0.7 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-13.2.1 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-13.2.0 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-10.1.3 db/seeds.d/100-assign_features_with_templates.rb
foreman_remote_execution-13.0.0 db/seeds.d/100-assign_features_with_templates.rb