'URL' section for custom local repo on satellite 6.2

Latest response

When we create a custom local repo on satellite server 6, what do we suppose to put on "URL" section on Web UI under the "Product" --> Repositories --> Custom repo --> URL ( under Type ) to sync the custom rpms. I know on Spacewalk, it was soemething like "file:///custom repos/.." . ( I am not trying to sync external repos here, custom repositories are created on Satellite Server )

Responses

Shisheer,

I suggest reading the Creating a custom RPM Repository section of the Content Management Guide.

In the example given in that section, the URL is http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/.

If you need any further help, please ask.

Thanks Russell. That doc is for external repo as James said earlier. Looks like not a whole lot of people have been using Sat 6 extensively for custom RPMs deployment.

It depends on what you are building a custom local repository for. Russell's example above is for a case where you want your Satellite 6 server to be a local mirror of a repository from elsewhere (e.g., the Postgres example given, or the EPEL repositories).

For a truly "custom local" repository - one that has RPMs you build yourself from source code - you do not need anything at all in the "URL" field. You can load your custom packages directly into the repo via the web interface (if the packages are not too large) or via the hammer command-line tools.

If your enterprise has multiple Satellite servers, you might want to use one Satellite as a "master" source for your custom repositories, and have all other Satellites synchronize your repository from the main server. In that case, you would take the "published at:" URL from that repository on the master server and copy it into the "URL" field on the other Satellite servers.

James, We run our custom bash script as a cron job that pulls out packages from the development machines, builds RPMs, sync those repos and automatically deploys to the test machines every morning. I am trying to do the same here ( run the custom script and deploy the RPMs to the test machines every morning ). However, I am little bit confused as how these repos can be synchronized and for that we need the 'URL' there right? For example; I have the following custom repos on my satellite server. /var/customrepo1/customtestrepo1/x86_64/ /var/customrepo2/customtestrepo2/x86_64/ So, I created a product named 'test1' and added these repos under that product and created a activation key and registered the test machine. I can see those custom repos on my registered test machine. Now, I started building custom RPMs using our script and the packages are on those custom repos already. Only issue I am having is syncing those repos using Web UI and every time a new build runs, not sure If I have to publish the newly built RPMs and promote to the test environment so that my test machine can see the newly built RPMs.

To synchronise the repository after a build, you could run a hammer command on the build server. You would need to install hammer on the build server, and set up the hammer configuration file, including credentials. Alternatively, you could set up a Sync plan at a set interval and time - daily, weekly, monthly.

Once the repository is synchronised, you then need to promote the Content View to the test environment. The updated RPMs should then be available to the test machine.

I have tried hammer command already. Our build script runs on the Satellite server, builds the RPMs and updates related repositories which are under /var/custom-base-test/repo1 ..... etc.

First, it was giving me URL feed error and I added path to the URL section as " http://satelliteserver/var/custom-base-test/repo1...."

[root@xxxxxxxxx ~]# hammer repository synchronize --product "custom-base-test" --id 405 --organization-id 1 Could not synchronize the repository: attempted to sync without a feed URL

[root@xxxxxxxxx x86_64]# hammer repository synchronize --product "custom-base-test" --id 405 --organization-id 1 [..............................................................................................................................................................................................................] [100%] No new packages. Error: RPM1004: Error retrieving metadata: notresolvable

@James What you mentioned does not work. It is not possible to provide clients the rpms via a normal repo, if you upload files directly via webinterface. Stick to the documentation you are only able to use curl. Mentioned here: https://access.redhat.com/documentation/en-us/red_hat_satellite/6.3/html/content_management_guide/importing_custom_content#Importing_Custom_Content-Downloading_Files_From_a_Custom_File_Type_Repository

Hi,

i have the same. I am looking for a way to spare out specific versions in provided repos, like rhelos and epel and deliver those specific versions via custom repos. In RHUI it is easy, to provide those custom packages. They will immediately appear in a repo way.

On satellite i am not able to specify a folder in the way of file:///my_repo <- where is the path located if not fully customizable on the satellite itself? I tried to specify /opt/foo/my_repo but a sync failed. Yes, i executed pulp_manifest. How is this supposed to work?

The Documentation is horrible and we have also a copy&paste error again. Chapter https://access.redhat.com/documentation/en-us/red_hat_satellite/6.3/html/content_management_guide/importing_custom_content#Importing_Custom_Content-Creating_a_Custom_File_Type_Repository_Local_Directory in the first subsection point 3 a HTTP server is mentioned but none is involved in this example. It is a copy&paste error from https://access.redhat.com/documentation/en-us/red_hat_satellite/6.3/html/content_management_guide/creating_a_remote_file_type_repository

@https://access.redhat.com/user/1205683 James What you mentioned does not work. It is not possible to provide clients the rpms via a normal repo, if you upload files directly via webinterface. Stick to the documentation you are only able to use curl. Mentioned here: https://access.redhat.com/documentation/en-us/red_hat_satellite/6.3/html/content_management_guide/importing_custom_content#Importing_Custom_Content-Downloading_Files_From_a_Custom_File_Type_Repository

Hi, A bit late but here's what I did to set up a Custom File Repository on the Satellite server itself. As you said httpd was mentioned but Satellite has that already.

# cd /var/www/html/pub
# mkdir script_files_repo
# echo hello > script_files_repo/test.html
# yum install python-pulp-manifest
# pulp-manifest script_files_repo

In web browser URL: https://servername url/pub/script_files_repo/test.html

Copied some more files into the filesystem /var/www/html/pub/script_files_repo

In Satellite UI > Products > [name] > Repositories > Scripts set the Upstream URL to file:////var/www/html/pub/script_files_repo

Syncing the repository failed. Error in UI

 "Exception: [{'name': u'checkip.func', 'error': {}}, {'name': u'check_port.sh', 'error': {}}, {'name': u'check_diskspace.sh', 'error': {}}, {'name': u'checkdate.func', 'error': {}}]\n",
    "spawned_tasks"=>[],

Error in /var/log/messages

Mar  7 21:44:31 [servername] pulp: nectar.downloaders.local:INFO: [19ac8e6d] Download succeeded: file://var/www/html/pub/script_files_repo/PULP_MANIFEST.
Mar  7 21:44:31 [servername] pulp: nectar.downloaders.local:INFO: [19ac8e6d] [Errno 13] Permission denied: '//var/www/html/pub/script_files_repo/checkip.func'

According to https://bugzilla.redhat.com/show_bug.cgi?id=1211305 SELinux was the cause. Maybe not directly related, but pointed in the right direction.

# grep denied /var/log/audit/audit.log
type=AVC msg=audit(1551941144.673:154759): avc:  denied  { read } for  pid=35041 comm="celery" name="checkip.func" dev="dm-7" ino=8410137 scontext=system_u:system_r:celery_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=0

# getenforce 
Enforcing
# setenforce 0

Re-attempted sync and it worked fine. Re-enabled SELinux. Copied more files, regenerated the PULP_MANIFEST file and the sync again broke. Set to SELinux to permissive again. And sync worked again.

I'm no SELinux expert so still need to work out how do the correct SELinux tweaking to allow sync'ing.

Edit, that was easier than I thought it was gonna be. Since index.html was ok, just had to make the others look the same as far as SELinux was concerned.

# ls -Z PULP_MANIFEST index.html checkdate.func
-rw-r--r--. apache apache unconfined_u:object_r:user_home_t:s0 checkdate.func
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 index.html
-rw-r--r--. root   root   unconfined_u:object_r:httpd_sys_content_t:s0 PULP_MANIFEST

# chcon unconfined_u:object_r:httpd_sys_content_t:s0 *.func

# ls -Z PULP_MANIFEST index.html checkdate.func
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 checkdate.func
-rw-r--r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 index.html
-rw-r--r--. root   root   unconfined_u:object_r:httpd_sys_content_t:s0 PULP_MANIFEST

In Satellite UI, re-attempt the sync and it worked.