Bug #6922
closed
Foreman runs engine seeds.d before seeds.rb
Added by Stephen Benjamin over 10 years ago.
Updated over 10 years ago.
Category:
Plugin integration
|
Description
#6308 introduced seeds.d support for engines, however these are run before the Engine's own seeds.rb is run.
- Related to Feature #6308: Allow plugins to hook into DB seed ordering added
Can you provide any more information about what seed files you have in the plugin?
Katello doesn't use seeds.d yet. Eric and I discussed moving Satellite branding to seeds.d as something like 99-branding.rb. This lets downstream rebase Katello freely without wiping out all the branding changes constantly. It's becoming a major headache for me, as I've now had to reapply my changes 3x.
99-branding.rb doesn't work if things in seeds.rb are applied later. I can fix my problem by moving provisioning templates to seeds.d as well if we decide to do this.
But IMHO the simplest argument for this is that engines and Foreman should have the same behavior in how they handle the ordering of seeds.rb and seeds.d.
- Status changed from New to Need more information
I can't reproduce any ordering issue with a file called "99-branding.rb":
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/03-auth_sources.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/04-admin.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/05-taxonomies.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/06-architectures.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/07-config_templates.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/08-partition_tables.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/10-installation_media.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/11-permissions.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/11-roles.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/11-smart_proxy_features.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/13-compute_profiles.rb
Seeding /home/dcleal/code/foreman/foreman/db/seeds.d/15-bookmarks.rb
Seeding /home/dcleal/code/foreman/foreman_bootdisk/db/seeds.d/99-branding.rb
Also the original PR shows a test from Greg that appears to work correctly. seeds.rb sorts all seed files by their basename.
That's not the issue I'm reporting. Katello has a seeds.rb, the way #6308 was implemented, seeds.d/* is executed BEFORE seeds.rb...
Foreman doesn't provide any mechanism to run a seeds.rb from an engine, only seeds.d/. Maybe that's to do with enhancing the db:seed rake task from the engine. I'd recommend not using seeds.rb in an engine.
- Status changed from Need more information to Rejected
I see, we're hooking into the rake task to get our seeds.rb processed, so we'll need to move everything to seeds.d.
Also available in: Atom
PDF