Bug 2028446 - Pulp: Add options to change the import and export path in /etc/pulp/settings.py
Summary: Pulp: Add options to change the import and export path in /etc/pulp/settings.py
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Installation
Version: 6.10.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: 6.11.0
Assignee: satellite6-bugs
QA Contact: Omkar Khatavkar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-02 12:17 UTC by Ganesh Payelkar
Modified: 2023-06-01 05:24 UTC (History)
12 users (show)

Fixed In Version: foreman-installer-3.1.2.6-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-05 14:30:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 34882 0 Normal New Pulp: Add options to change the import and export path in /etc/pulp/settings.py 2022-05-09 20:30:22 UTC
Red Hat Issue Tracker SAT-6679 0 None None None 2021-12-02 13:58:29 UTC
Red Hat Issue Tracker SAT-9497 0 None None None 2023-06-01 05:24:03 UTC
Red Hat Knowledge Base (Solution) 6576731 0 None None None 2021-12-10 10:53:34 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:30:55 UTC

Description Ganesh Payelkar 2021-12-02 12:17:07 UTC
Description of problem:

[RFE] Add options to change the import and export path in /etc/pulp/settings.py

Version-Release number of selected component (if applicable):
satellite-6.10

How reproducible:
New installation 


Actual results: 

There is no option available through custom-hiera.yaml or satellite-installer to change the below directories to custom path

# cat /etc/pulp/settings.py

ALLOWED_IMPORT_PATHS = ["/var/lib/pulp/sync_imports", "/var/lib/pulp/imports"]
ALLOWED_EXPORT_PATHS = ["/var/lib/pulp/exports"]

It seems to be a hard-coded in the configuration : 

# cat /usr/share/foreman-installer/modules/foreman_proxy_content/manifests/init.pp |grep -iE "sync_imports|imports"
      $pulpcore_allowed_import_path    = ['/var/lib/pulp/sync_imports']
      $pulpcore_allowed_import_path    = ['/var/lib/pulp/sync_imports', '/var/lib/pulp/imports']


# cat /usr/share/foreman-installer/modules/pulpcore/templates/settings.py.erb 

ALLOWED_IMPORT_PATHS = <%= scope['pulpcore::allowed_import_path'] %>
ALLOWED_EXPORT_PATHS = <%= scope['pulpcore::allowed_export_path'] %>


Expected results:

If changing the import and export path is allowed, then we will need a module for custom-hiera.yaml and satellite-installer parameter


Additional info:

Tried the below parameters in hiera but not work after running the installer. 

# cat /etc/foreman-installer/custom-hiera.yaml 

pulpcore::allowed_import_path: ['/mnt/test5', '/mnt/test6']
pulpcore::allowed_export_path: ['/mnt/test7']

Comment 2 Sayan Das 2021-12-10 13:27:21 UTC
I have an additional request here which could probably serve as an improvement I guess.

We suggest users to use /var/www/html/pub/sat-import/ in following guide when they are importing content_iso's :


https://access.redhat.com/documentation/en-us/red_hat_satellite/6.10/html-single/content_management_guide/index#configuring-satellite-to-synchronize-content-with-a-local-cdn-server_content-management


So, should that not be a part of this setting in /etc/pulp/settings.py ?

ALLOWED_IMPORT_PATHS = ["/var/lib/pulp/sync_imports", "/var/lib/pulp/imports"]

Comment 3 Mike McCune 2022-03-23 17:14:17 UTC
Can we get this re-reviewed to see if this is something we supported in 6.9 and prior? if so, I'd say this is not an RFE and more of a bug that we can't support configuring export location

Comment 5 wclark 2022-04-14 13:41:49 UTC
I believe the reason custom hiera didn't work here is that the parameter values are specified by puppet-foreman_proxy_content in its resource like declaration of the pulpcore class: https://github.com/theforeman/puppet-foreman_proxy_content/blob/master/manifests/init.pp#L259-L260

Meanwhile the order of precedence for setting class parameters is


1. Parameter values are explicitly set with a resource-like class declaration.
2. Puppet performs a Hiera lookup in the style of <CLASS NAME>::<PARAMETER NAME>.
3. The default value set in the class definition.

So #1 will take the highest priority in this case, and the hiera lookup (#2) will never get performed.

What would be required in order to make this work, would be a parameter in the foreman_proxy_content module that could be overridden (currently it is conditionally hardcoded based on the scenario).

Comment 6 wclark 2022-04-14 13:42:54 UTC
@ehelms could you kindly remind me why we moved this from the installer component to the repositories component?

Comment 11 wclark 2022-05-09 20:30:21 UTC
Created redmine issue https://projects.theforeman.org/issues/34882 from this bug

Comment 12 Bryan Kearney 2022-05-10 20:04:14 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34882 has been resolved.

Comment 17 Omkar Khatavkar 2022-05-23 09:30:59 UTC
Verified this on Satellite 6.11 with Snap 21. It is working as expected.

Comment 20 errata-xmlrpc 2022-07-05 14:30:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498


Note You need to log in before you can comment on or make changes to this bug.