Skip to content
This repository was archived by the owner on Sep 5, 2025. It is now read-only.

Provide puppet-agent on RPM#21

Merged
bastelfreak merged 2 commits intoOpenVoxProject:mainfrom
ekohl:provide-puppet-agent
May 13, 2025
Merged

Provide puppet-agent on RPM#21
bastelfreak merged 2 commits intoOpenVoxProject:mainfrom
ekohl:provide-puppet-agent

Conversation

@ekohl
Copy link
Contributor

@ekohl ekohl commented Mar 21, 2025

This allows users to perform dnf install puppet-agent and get openvox-agent instead. It also means packages don't need to modify their dependencies. They probably still should, but this helps users migrate.

It also tightens the Obsoletes statement to include a version. rpmlint raises the unversioned-explicit-obsoletes warning on the old case. The Conflicts is kept unversioned, which is correct.

Currently untested, but submitting early for discussion.

@nmburgan
Copy link
Member

We did this on purpose. People shouldn’t be able to mix openvox-agent with puppetserver and vice versa. While it works for now, it may not forever. And we left it unversioned because OpenVox and puppet won’t have similar versions after the fork, so putting a version limiter on puppet agent based on the OpenVox agent version seems incorrect.

But it doesn’t necessarily have to stay this way if there are strong reasons to change it.

@ekohl
Copy link
Contributor Author

ekohl commented Mar 21, 2025

Splitting this up into 2 discussions

Obsoletes

Adding versions is IMHO something you want to do. It means dnf will yell at you if you somehow try to replace Puppet 8 with OpenVox 7. In the future you can have the same issue again with Puppet 9 -> OpenVox 8.

If you feel that the specific version will result in mismatches (and I agree, it's hacky) we could also reduce the Obsoletes statement to the major version. So openvox-agent-8.x will have Obsoletes: puppet-agent < 9.

Provides

The reason I'd like to add this is that Foreman users can then simply use OpenVox without needing theforeman/foreman-packaging#11840. It's unlikely we'll cherry pick that down to all versions (including unsupported ones).

This is to address https://community.theforeman.org/t/support-for-openvox-puppet-within-foreman-katello/42717/3.

@nmburgan
Copy link
Member

nmburgan commented Mar 21, 2025

Oh yeah, that makes sense to do it on the major version. We’ll see if our major ends up coinciding with Puppet’s major, but I imagine it will.

I’m not totally against having it provide puppet-agent. I worry a bit about unintentional breakage, but we can make it clear in docs you should not mix and match. And making it easier on Foreman is a big plus.

@ekohl
Copy link
Contributor Author

ekohl commented Mar 21, 2025

I wonder if we can drop the provides on OpenVox 9, which is where is where I imagine we'll start setting our own path more.

ekohl added 2 commits April 23, 2025 12:07
Rather than hardcoding it we take the major version as a variable.
This allows users to perform `dnf install puppet-agent` or
`apt install puppet-agent` and get openvox-agent instead. It also means
packages don't need to modify their dependencies. They probably still
should, but this helps users migrate.

It also tightens the Obsoletes statement to include the major version.
rpmlint raises the unversioned-explicit-obsoletes warning on the old
case. The Conflicts is kept unversioned, which is correct.
@ekohl ekohl force-pushed the provide-puppet-agent branch from 7b7b120 to 83d06f3 Compare April 23, 2025 10:30
@ekohl
Copy link
Contributor Author

ekohl commented Apr 23, 2025

I haven't quite tested the current changes, but pushing nonetheless so I don't forget.

@ekohl
Copy link
Contributor Author

ekohl commented Apr 28, 2025

EL 9

Build

$ bundle exec vanagon build -e docker openvox-agent el-9-x86_64
...
mkdir -p output/el/9/openvox8/x86_64
cp /var/tmp/tmp.sq1L5WpId9/rpmbuild/*RPMS/**/*.rpm ./output/el/9/openvox8/x86_64
...
$ rpm -q --provides output/el/9/openvox8/x86_64/openvox-agent-8.15.0.7.g83d06f38a-1.el9.x86_64.rpm 
openvox-agent = 8.15.0.7.g83d06f38a-1.el9
openvox-agent(x86-64) = 8.15.0.7.g83d06f38a-1.el9
puppet-agent = 8
$ rpm -q --conflicts output/el/9/openvox8/x86_64/openvox-agent-8.15.0.7.g83d06f38a-1.el9.x86_64.rpm 
puppet-agent
$ rpm -q --obsoletes output/el/9/openvox8/x86_64/openvox-agent-8.15.0.7.g83d06f38a-1.el9.x86_64.rpm 
puppet-agent < 9
$ createrepo output/el/9/openvox8/x86_64
Directory walk started
Directory walk done - 1 packages
Temporary output repo path: output/el/9/openvox8/x86_64/.repodata/
Pool started (with 5 workers)
Pool finished

install test with openvox-agent

$ podman run -v $PWD/output/el/9/openvox8/x86_64:/repo:Z --rm -it almalinux:9
# ls /repo
openvox-agent-8.15.0.7.g83d06f38a-1.el9.x86_64.rpm  repodata
# cat > /etc/yum.repos.d/local.repo <<EOF
> [openvox8]
name=OpenVox 8 Repository el 9 - 
baseurl=file:///repo
enabled=1
gpgcheck=0
> EOF
# dnf install -y --quiet openvox-agent

Installed:
  openvox-agent-8.15.0.7.g83d06f38a-1.el9.x86_64                                                                                                               

install test with puppet-agent

# ls /repo
openvox-agent-8.15.0.7.g83d06f38a-1.el9.x86_64.rpm  repodata
# cat > /etc/yum.repos.d/local.repo <<EOF
> [openvox8]
name=OpenVox 8 Repository el 9 - 
baseurl=file:///repo
enabled=1
gpgcheck=0
> EOF
# dnf install -y --quiet puppet-agent

Installed:
  openvox-agent-8.15.0.7.g83d06f38a-1.el9.x86_64

upgrade test from puppet.com's puppet-agent to openvox-agent

$ podman run -v $PWD/output/el/9/openvox8/x86_64:/repo:Z --rm -it almalinux:9
# ls /repo
openvox-agent-8.15.0.7.g83d06f38a-1.el9.x86_64.rpm  repodata
# dnf install -y --quiet https://yum.puppet.com/puppet8-release-el-9.noarch.rpm

Installed:
  puppet8-release-1.0.0-10.el9.noarch
# dnf install -y --quiet puppet-agent
Importing GPG key 0x9E61EF26:
 Userid     : "Puppet, Inc. Release Key (Puppet, Inc. Release Key) <release@puppet.com>"
 Fingerprint: D681 1ED3 ADEE B844 1AF5 AA8F 4528 B6CD 9E61 EF26
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-puppet8-release

Installed:
  puppet-agent-8.10.0-1.el9.x86_64
# cat > /etc/yum.repos.d/local.repo <<EOF
> [openvox8]
name=OpenVox 8 Repository el 9 - 
baseurl=file:///repo
enabled=1
gpgcheck=0
> EOF
# dnf upgrade -y --quiet

Installed:
  openvox-agent-8.15.0.7.g83d06f38a-1.el9.x86_64

@ekohl
Copy link
Contributor Author

ekohl commented Apr 28, 2025

Currently it fails on Debian 12 because it doesn't provide puppet-agent. See that case for details.

Debian 12

Build

$ bundle exec vanagon build -e docker openvox-agent debian-12-amd64
...
cp /var/tmp/tmp.zUyp0LqsuE/*.deb ./output/deb/debian12/openvox8
...
$ ls ./output/deb/debian12/openvox8
openvox-agent_8.15.0.7.g83d06f38a-1+debian12_amd64.deb
openvox-agent-dbgsym_8.15.0.7.g83d06f38a-1+debian12_amd64.deb

Then I followed https://linuxopsys.com/create-your-own-repository-for-packages-on-debian to create a repo:

$ podman run -v ./output/deb/debian12/openvox8:/repo:Z --rm -it debian:12
# apt install dpkg-dev
# cd /repo
# dpkg-scanpackages . /dev/null > Release
dpkg-scanpackages: warning: Packages in archive but missing from override file:
dpkg-scanpackages: warning:   openvox-agent openvox-agent-dbgsym
dpkg-scanpackages: info: Wrote 2 entries to output Packages file.
# dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
dpkg-scanpackages: warning: Packages in archive but missing from override file:
dpkg-scanpackages: warning:   openvox-agent openvox-agent-dbgsym
dpkg-scanpackages: info: Wrote 2 entries to output Packages file.

install test with openvox-agent

# echo 'deb [trusted=yes] file:/repo ./' > /etc/apt/sources.list.d/local.list
# apt update -qqq
# apt install openvox-agent
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  openvox-agent
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/31.6 MB of archives.
After this operation, 102 MB of additional disk space will be used.
Get:1 file:/repo ./ openvox-agent 8.15.0.7.g83d06f38a-1+debian12 [31.6 MB]
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package openvox-agent.
(Reading database ... 6091 files and directories currently installed.)
Preparing to unpack .../openvox-agent_8.15.0.7.g83d06f38a-1+debian12_amd64.deb 
...
Unpacking openvox-agent (8.15.0.7.g83d06f38a-1+debian12) ...
Setting up openvox-agent (8.15.0.7.g83d06f38a-1+debian12) ...
Processing triggers for libc-bin (2.36-9+deb12u10) ...

install test with puppet-agent

$ podman run -v ./output/deb/debian12/openvox8:/repo:Z --rm -it debian:12
# echo 'deb [trusted=yes] file:/repo ./' > /etc/apt/sources.list.d/local.list
# apt update -qqq
# apt install puppet-agent

This installs a package, but it's the distro package. apt upgrade offers to replace it.

For completeness:

# apt show openvox-agent
Package: openvox-agent
Version: 8.15.0.7.g83d06f38a-1+debian12
Priority: optional
Section: admin
Maintainer: Vox Pupuli <openvox@voxpupuli.org>
Installed-Size: 102 MB
Provides: puppet-agent
Depends: findutils, tar
Conflicts: puppet-agent
Breaks: puppet-agent (<< 9)
Replaces: puppet-agent (<< 9)
Homepage: https://voxpupuli.org
Download-Size: 31.6 MB
APT-Sources: file:/repo ./ Packages
Description: The OpenVox Agent package contains all of the elements needed to run the agent, including ruby and facter.
 .
 Contains the following components:
 cleanup
 facter 4.10.0-3-gaae367139
 module-puppetlabs-augeas_core v1.5.0
 module-puppetlabs-cron_core v1.3.0
 module-puppetlabs-host_core v1.3.0
 module-puppetlabs-mount_core v1.3.0
 module-puppetlabs-scheduled_task v3.2.0
 module-puppetlabs-selinux_core v1.4.0
 module-puppetlabs-sshkeys_core v2.5.0
 module-puppetlabs-yumrepo_core v2.1.0
 module-puppetlabs-zfs_core v1.6.1
 module-puppetlabs-zone_core v1.2.0
 puppet 8.15.0
 puppet-resource_api 1.9.0
 puppet-runtime 202504221
 pxp-agent 202504221
 shellpath 2023-02-15
 wrapper-script

upgrade test from OS puppet-agent to openvox-agent

$ podman run -v ./output/deb/debian12/openvox8:/repo:Z --rm -it debian:12
# apt update -qqq
# apt install puppet-agent
# echo 'deb [trusted=yes] file:/repo ./' > /etc/apt/sources.list.d/local.list
# apt update -qqq
# apt upgrade

Also fails.

upgrade test from puppet.com's puppet-agent to openvox-agent

Not tested since the OS packages upgrade already failed.

@ekohl
Copy link
Contributor Author

ekohl commented Apr 29, 2025

Currently the Debian packages don't replace puppet-agent either so this isn't a regression. @nmburgan can we merge this so at least RPM users can simply add the new repository and run dnf upgrade to replace the packages and also work on existing Foreman installations?

@binford2k
Copy link
Contributor

@ekohl does this mean that the upgrade process it to add the new yumrepo, remove the old yumrepo, then upgrade?

What happens if they don't remove the puppet.com yumrepo? What happens if perforce decides to arms-race us and jacks their version up higher than ours?

@ekohl
Copy link
Contributor Author

ekohl commented May 8, 2025

@ekohl does this mean that the upgrade process it to add the new yumrepo, remove the old yumrepo, then upgrade?

Pretty much, but also that an RPM like foreman-installer that depends on puppet-agent will have its dependency satisfied. Meaning you can also use OpenVox on existing Foreman releases, without any packaging change.

Similarly, Puppet will also recognize and I'd expect the following code to work:

package { 'puppet-agent':
  ensure => installed,
}

I also tried to do the same for Debian, but couldn't make that work even though the docs say this should work.

What happens if they don't remove the puppet.com yumrepo? What happens if perforce decides to arms-race us and jacks their version up higher than ours?

I'm not too worried about that. This is about upgrading between major versions. If this is applied it won't replace Puppet 8 with OpenVox 7. IMHO that's a sane thing to do. And if Puppet releases Puppet 9, then I think we should see if we actually replace that or not.

@binford2k
Copy link
Contributor

@ekohl oh, the Debian failure is because it doesn't look like you pinned the package. You'll need this to install the puppetlabs version of puppet-agent in the first place.

 apt::pin { 'puppet-release':
    priority   => 1001,
    originator => 'Puppet*',
    packages   => 'puppet-agent',
}

@binford2k
Copy link
Contributor

talked with a few people about this and I'm more convinced. The puppet-agent install target isn't really a thing anymore. Perforce is having people jump through hoops to get Puppet Core installed. Everyone is moving away from the artist formerly known as OSP. Let's merge this.

@bastelfreak bastelfreak merged commit afdd5f2 into OpenVoxProject:main May 13, 2025
2 checks passed
@ekohl ekohl deleted the provide-puppet-agent branch May 13, 2025 12:46
@ekohl
Copy link
Contributor Author

ekohl commented Aug 29, 2025

Circling back: @evgeni suggested on IRC that the Debian part is broken because there is no version in the provides. Turns out Vanagon simply ignores that altogether. OpenVoxProject/vanagon#51 makes sure the value is actually used. Then #120 fixed up the syntax.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants