Currently package_module body names are required to exactly match a module found in $(sys.workdir)/modules/packages. This leads to overhead for either managing symlinks to modules or duplication of code.
In order to avoid this management overhead I would like the ability to set a "module_name" or a "module_path" attribute in a package_module body so that different sets of attributes can be used with the same package_module without having to duplicate the module itself.
The attribute could default to the name of the package_module body.
Example use case: Inventory package updates with some repository enabled that is not enabled by default for packages promises.
OK, lets pretend that the yum package module supports the enablerepo and disablerepo options.
I want Mission Portal to show me inventory for package updates with enablerepo=updates since the updates repo contains package updates. For example yum --enablerepo=updates --check-updates.
I want any packages promise that uses the yum package module to NOT enable the updates repo. For example yum upgrade httpd (note that --enablerepo is not used).
In order to set the default inventory to be reported with the repository enabled I believe I would do something like this:
However if I do that, all packages promises will have the updates repository enabled by default. In order to avoid installing from update repositories I would have to override the options on each individual packages promise. For example:
I believe that in order to get inventory that includes data from the updates repository but not have that applied in the default case I will have to specify a separate package_module that can have different default_options. For example:
Since the package_module is expected to have an identical name to a module that exists in $(sys.workdir)/modules/packages I will have to at minimum make a symlink to the yum module (because there is no yum_enable_updates module).
With that configuration I would expect that the inventory collected by Mission Portal would be only from yum_enable_updates. And the updates repository would not be enabled for my normal packages promises, for example:
Note: For this use case, it may be preferable to set fairly low query timeouts for the inventory pacakge_method body so that there are not apparent sync issues between packages installed and package updates available. For example, when a package_method body is used only for inventory, it will only refresh the packages installed based on the expiration of the lock if no packages promise using that package_method makes a change to the system. Similarly after having a package updated by a different package_method the updates available may lag behind unless the query_updates_ifelapsed value is set to a low value.