Installation media should be usable for more than one operating system
The current database schema of Foreman describes a one-to-many relation between Installation Medium and Operating Systems:
+-------+ +-----------------+ | Media |<*>----<1>| Operatingsystem | +-------+ +-----------------+ ActiveRecord: Media :belongs_to Operatingsystem Operatingsystem :has_many Media
The implication of this design is, that the user has to create an installation medium for each operating system created in Foreman. This makes sense for installation media which contain a certain the version number or architecture of the operating system in their URI or path, like the ones of Fedora or CentOS Linux.
With Debian-based Linux distributions on the other hand, one mirror can serve several versions of the operating system from the same URI/path. This results in several identical installation media.
For example, having the operating systems "Ubuntu 8.04 LTS", "Ubuntu 9.10", "Ubuntu 10.04 LTS" each in "x86" and "x86_64" variants need 6 identical installation media in Foreman while one mirror would be sufficient.
By creating a many-to-many relation between Installation Media and Operating Systems, the user could "reuse" an installation medium for several operating system.
+-------+ +-----------------+ | Media |<*>----<*>| Operatingsystem | +-------+ +-----------------+ ActiveRecord: Media has_and_belongs_to_many Operatingsystem Operatingsystem has_and_belongs_to_many Media
PS: Assigned to Paul Kelly due to recommendation of Ohad Levy.
fixes #236 - Installation media are now usable with more than one operating system.
#1 Updated by Jochen Schalanda about 9 years ago
- File 0001-Implements-feature-236-Installation-media-are-now-us.patch 0001-Implements-feature-236-Installation-media-are-now-us.patch added
I've implemented the proposed changes, see the attached patch file.
Being able to assign an installation medium to more than one operating system together with the variable substitution in the URL (
$minor) should greatly reduce the need for several nearly identical installation mediums.
For example: instead of creating an installation medium for CentOS 5.4 (
http://mirror.averse.net/centos/5.4/os/$arch) and 5.5 (
http://mirror.averse.net/centos/5.5/os/$arch) one could simply create an installation medium with the URL
http://mirror.averse.net/centos/$version/os/$arch and assign it to the respective operating systems.
#2 Updated by Jochen Schalanda about 9 years ago
- File 0002-Refactored-latest-migrations-to-actually-migrate-dat.patch 0002-Refactored-latest-migrations-to-actually-migrate-dat.patch added
Refactored migrations to migrate existing data to the new schema.