Debian Client Support in Foreman/Katello

Sorry I forgot the details on this step, adding a bit more info.

Download the certificate rpm package from katello on the same debian/ubuntu server you are using for building. then convert that package from RPM to a DEB. In the RPM there is basically just one bash script (the one in my previous comment)

replace that line with the following:
$ sudo alien -d katello-ca-consumer-latest.noarch.rpm
$ sudo chown $USER:$GROUPS katello-ca-consumer-foreman.domain.com_1.0-2_all.deb
$ sudo apt install -f katello-ca-consumer-foreman.domain.com_1.0-2_all.deb

these is the subscription manager version

after successful installation, im getting below error.

File “/usr/lib/apt/methods/katello”, line 31
from future import print_function
SyntaxError: from future imports must occur at the beginning of the file
Reading package lists… Done
E: Method katello has died unexpectedly!
E: Sub-process katello returned an error code (1)
E: Method /usr/lib/apt/methods/katello did not start correctly
E: Failed to fetch katello://fqdn/CS/Library/Ubuntu18_04CV/custom/Ubunu1804/bionic/dists/default/InRelease
E: Some index files failed to download. They have been ignored, or old ones used instead.

Make sure you have a ubuntu product with a repo, on a content view and the
activation key with that subscription activated

Hello all,

I’m wondering if anyone encountered this issue when building the debian package (currently using the repo from - https://github.com/candlepin/subscription-manager.git)?

It seems to trip up at the syspurpose part of the build due to some unexpected parameters in the python command;

/subscription-manager/syspurpose /subscription-manager
running install
running build
running build_py
running build_trans
running install_lib
byte-compiling debian/python-subscription-manager/usr/lib/python2.7/site-packages/syspurpose/files.py to files.pyc
byte-compiling debian/python-subscription-manager/usr/lib/python2.7/site-packages/syspurpose/i18n.py to i18n.pyc
byte-compiling debian/python-subscription-manager/usr/lib/python2.7/site-packages/syspurpose/cli.py to cli.pyc
byte-compiling debian/python-subscription-manager/usr/lib/python2.7/site-packages/syspurpose/main.py to main.pyc
byte-compiling debian/python-subscription-manager/usr/lib/python2.7/site-packages/syspurpose/init.py to init.pyc
byte-compiling debian/python-subscription-manager/usr/lib/python2.7/site-packages/syspurpose/utils.py to utils.pyc
running install_data
running install_egg_info
running egg_info
creating src/syspurpose.egg-info
writing src/syspurpose.egg-info/PKG-INFO
writing top-level names to src/syspurpose.egg-info/top_level.txt
writing dependency_links to src/syspurpose.egg-info/dependency_links.txt
writing entry points to src/syspurpose.egg-info/entry_points.txt
writing manifest file ‘src/syspurpose.egg-info/SOURCES.txt’
reading manifest file ‘src/syspurpose.egg-info/SOURCES.txt’
writing manifest file ‘src/syspurpose.egg-info/SOURCES.txt’
removing ‘debian/python-subscription-manager/usr/lib/python2.7/site-packages/syspurpose-1.28.0-py2.7.egg-info’ (and everything under it)
Copying src/syspurpose.egg-info to debian/python-subscription-manager/usr/lib/python2.7/site-packages/syspurpose-1.28.0-py2.7.egg-info
running install_scripts
Installing syspurpose script to debian/python-subscription-manager/usr/bin
/subscription-manager
EXCLUDE_PACKAGES="""" python ./setup.py clean --all" python ./setup.py build --quiet --gtk-version=2 --rpm-version=1.28.0-1-38-g720aee96" python ./setup.py install --root debian/python-subscription-manager --gtk-version=2 --rpm-version=1.28.0-1-38-g720aee96 --prefix=/usr
–with-systemd=true --with-subman-gui=true --with-cockpit-desktop-entry=true
–with-subman-migration=true
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] …]
or: setup.py --help [cmd1 cmd2 …]
or: setup.py --help-commands
or: setup.py cmd --help

error: option --all python ./setup.py build --quiet --gtk-version not recognized
Makefile:341: recipe for target ‘install-via-setup’ failed
make[2]: *** [install-via-setup] Error 1
make[2]: Leaving directory ‘/subscription-manager’
debian/rules:24: recipe for target ‘override_dh_auto_install’ failed
make[1]: *** [override_dh_auto_install] Error 2
make[1]: Leaving directory ‘/subscription-manager’
debian/rules:12: recipe for target ‘binary’ failed
make: *** [binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

I was following the instructions posted earlier in the thread from @besmirzanaj

I am attempting to do the same, adding Ubuntu servers to Katello, any updates? was anyone able to accomplish this?

Hi, even if you subscribe the system to katello, you won’t be able to manage packages from it. There’s a problem with katello ddbb and seems fixing it is not really a priority for now. (I’m also waiting for it, btw ) .
There’s a workaround via a PR, but you need to rebuild whole foreman+katello from scratch and it’s strongly discouraged/not ready for production environments.
check also : 'Content hosts' not showing installable updates for Debian like systems
Sorry for the bad news.

2 Likes

I see the same here trying to build on Debian 10. Did you find a solution for this?

I was able to build current git version by applying these changes (… and then copying contrib/debian one level higher) and running “debuild -b -uc -us”.

~/subscription-manager# git diff Makefile  contrib/debian/changelog 
diff --git a/Makefile b/Makefile
index 427e92795..0cfd3be4e 100644
--- a/Makefile
+++ b/Makefile
@@ -135,12 +135,12 @@ build-subpackages:
 # any cruft so developers don't end up install old builds.
 ifeq ($(WITH_SUBMAN_GUI),true)
     build: rhsmcertd rhsm-icon build-subpackages
-        EXCLUDE_PACKAGES:="$(EXCLUDE_PACKAGES)" $(PYTHON) ./setup.py clean --all
-        EXCLUDE_PACKAGES:="$(EXCLUDE_PACKAGES)" $(PYTHON) ./setup.py build --quiet --gtk-version=$(GTK_VERSION) --rpm-version=$(VERSION)
+       $(PYTHON) ./setup.py clean --all
+       $(PYTHON) ./setup.py build --quiet --gtk-version=$(GTK_VERSION) --rpm-version=$(VERSION)
 else
     build: rhsmcertd build-subpackages
-        EXCLUDE_PACKAGES:="$(EXCLUDE_PACKAGES)" $(PYTHON) ./setup.py clean --all
-        EXCLUDE_PACKAGES:="$(EXCLUDE_PACKAGES)" $(PYTHON) ./setup.py build --quiet --gtk-version=$(GTK_VERSION) --rpm-version=$(VERSION)
+       $(PYTHON) ./setup.py clean --all
+       $(PYTHON) ./setup.py build --quiet --gtk-version=$(GTK_VERSION) --rpm-version=$(VERSION)
 endif
 
 # we never "remake" this makefile, so add a target so
diff --git a/contrib/debian/changelog b/contrib/debian/changelog
index 088fe1271..c1695770d 100644
--- a/contrib/debian/changelog
+++ b/contrib/debian/changelog
@@ -1,3 +1,9 @@
+subscription-manager (1.28.2-1) unstable; urgency=medium
+
+  * Update to version 1.28.2
+
+ -- Jan Lentfer <jan.lentfer@web.de>  Tue, 25 Aug 2020 11:54:00 +0200
+
 subscription-manager (1.25.1-2) unstable; urgency=medium
 
   * Change the path to rhsmd in /etc/cron.daily/rhsmd

I was using 1.25 IIRC, not much juice from it. did you get anything interesting from this newer version?

As I mentioned (probably in another thread), we (ATIX) are currently working to release our debian / ubuntu packages including subscription-manager, apt-transport-katello and katello-upload-profile.

Its just a question of “days” (hopefully).

2 Likes

No - no difference. Just building was a bit easier with the newer version.

Would be cool if you could make aarch64 packages available, too :slight_smile:
Really looking forword for improved Debian / Ubuntu support, also professionally.

any news on the Debian packages?

Sorry for the delay. We are still working on it. I will let you know when done.

Thanks! Was just about to enquire.

Hello.
I performed these actions and the build of subscription-manager and the installation of the packages went very well.
When I try to register a Ubuntu server it will register as a host and content host, but I don’t see how many updates are available.
Also on the server and many that’s why, I dont have any repositories to list.
subscription-manager repos returns nothing.

Any idea’s?

regards
Jurgen

I too am interested in managing Debian/Ubuntu hosts with Foreman+Katello. It feels so close to ready!

1 Like

Last time I tried I did not have success due to some bugs and also the python dependencies are not clearly defined.

I even tried python3 to prepare the DEBs and it still failed to get content.

For everyone who is tracking this thread, there is another one about the release of the ATIX subscription-manager packages: Subscription Manager for Debian & Ubuntu on apt.atix.de

4 Likes