Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'VirtuozzoLinux' support #147

Merged
merged 4 commits into from Jan 20, 2020
Merged

Conversation

kBite
Copy link

@kBite kBite commented Oct 22, 2019

facter 3.14 adds support for os.name VirtuozzoLinux (https://puppet.com/docs/puppet/latest/release_notes_facter.html). This means os.name won't resolve to RedHat anymore.

# VirtuozzoLinux default repos for AWS.
---
yum::os_default_repos:
- "rhui-REGION-rhel-server-releases"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you have a look at the CentOS.yaml? I think the default repositories here are not correct for VirtuozzoLinux.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I re-checked init.pp. To my understanding, these files would only be necessary if someone uses manage_os_default_repos = true. This would not work with the current version of this module. So I'd expect noone is actually using this.

If this is correct, implementing correct VirtuozzoLinux.yaml. VirtuozzoLinux/6.yaml, and VirtuozzoLinux/7.yaml would not be worth the time.

(I tried it. 6 and 7 only share two repo file names, everything else is different)

@TJM
Copy link

TJM commented Oct 31, 2019

If you would like help on where to put the data, please post the contents of the default yum.repos.d files from each OS. Leaving the data out entirely is better than having it wrong, but if possible, it should be populated. IMO

@kBite
Copy link
Author

kBite commented Oct 31, 2019

VirtuozzoLinux 7

/etc/yum.repos.d # cat vzlinux.repo
# virtuozzolinux.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for VirtuozzoLinux updates
# unless you are manually picking other mirrors.
#
[virtuozzolinux-base]
name=VirtuozzoLinux Base
mirrorlist=http://repo.virtuozzo.com/vzlinux/mirrorlist/mirrors-7-os
#baseurl=http://repo.virtuozzo.com/vzlinux/7/$basearch/os/
enabled=1
gpgcheck=1
priority=90
gpgkey=file:///etc/pki/rpm-gpg/VZLINUX_GPG_KEY
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Virtuozzo-7

#released updates
[virtuozzolinux-updates]
name=VirtuozzoLinux Updates
mirrorlist=http://repo.virtuozzo.com/vzlinux/mirrorlist/mirrors-7-updates
#baseurl=http://repo.virtuozzo.com/vzlinux/7/$basearch/updates/
enabled=1
gpgcheck=1
priority=90
gpgkey=file:///etc/pki/rpm-gpg/VZLINUX_GPG_KEY
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Virtuozzo-7

[virtuozzolinux-base-debuginfo]
name=VirtuozzoLinux Base debug packages
mirrorlist=http://repo.virtuozzo.com/vzlinux/mirrorlist/mirrors-7-os-debug
#baseurl=http://repo.virtuozzo.com/vzlinux/7/$basearch/debug/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/VZLINUX_GPG_KEY
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Virtuozzo-7

[virtuozzolinux-updates-debuginfo]
name=VirtuozzoLinux Updates debug packages
mirrorlist=http://repo.virtuozzo.com/vzlinux/mirrorlist/mirrors-7-updates-debug
#baseurl=http://repo.virtuozzo.com/vzlinux/7/$basearch/updates-debug/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/VZLINUX_GPG_KEY
       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Virtuozzo-7

# These -factory repositories are for internal use by developers only
# Enable them on your own risk!!!  
[virtuozzolinux-factory]
name=VirtuozzoLinux Factory
mirrorlist=http://repo.virtuozzo.com/vzlinux/mirrorlist/mirrors-7-factory
#baseurl=http://repo.virtuozzo.com/vzlinux/7/$basearch/factory/
priority=90
enabled=0
gpgcheck=0

[virtuozzolinux-factory-debuginfo] 
name=VirtuozzoLinux Factory debug packages
mirrorlist=http://repo.virtuozzo.com/vzlinux/mirrorlist/mirrors-7-factory-debug
#baseurl=http://repo.virtuozzo.com/vzlinux/7/$basearch/factory-debug/
priority=90
enabled=0
gpgcheck=0
/etc/yum.repos.d # cat virtuozzo.repo 
[virtuozzo-os]
name=Virtuozzo
mirrorlist=http://repo.virtuozzo.com/vz/mirrorlists/7.0/releases-os.mirrorlist
#baseurl=http://repo.virtuozzo.com/vz/releases/7.0/x86_64/os/
enabled=1
gpgcheck=1
priority=50
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Virtuozzo-7

[virtuozzo-updates]
name=Virtuozzo Updates
mirrorlist=http://repo.virtuozzo.com/vz/mirrorlists/7.0/updates-os.mirrorlist
#baseurl=http://repo.virtuozzo.com/vz/updates/7.0/x86_64/os/
enabled=1
gpgcheck=1
priority=50
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Virtuozzo-7

[virtuozzo-os-debuginfo]
name=Virtuozzo os Debug packages
mirrorlist=http://repo.virtuozzo.com/vz/mirrorlists/7.0/releases-debug.mirrorlist
#baseurl=http://repo.virtuozzo.com/vz/releases/7.0/x86_64/debug/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Virtuozzo-7

[virtuozzo-updates-debuginfo]
name=Virtuozzo updates Debug packages
mirrorlist=http://repo.virtuozzo.com/vz/mirrorlists/7.0/updates-debug.mirrorlist
#baseurl=http://repo.virtuozzo.com/vz/updates/7.0/x86_64/debug/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Virtuozzo-7
/etc/yum.repos.d # cat readykernel.repo 
[virtuozzo-readykernel]
name=Virtuozzo ReadyKernel
baseurl=https://appcatalog.virtuozzo.com/repo/readykernel-vz7/
enabled=1
gpgcheck=1
priority=50
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Virtuozzo-7
/etc/yum.repos.d # cat obsoleted_tmpls.repo 
[obsoleted_tmpls]
name=Virtuozzo obsoleted EZ-templates
mirrorlist=http://repo.virtuozzo.com/vz/mirrorlists/7.0/obsoleted_tmpls.mirrorlist
#baseurl=http://repo.virtuozzo.com/vz/obsoleted_tmpls/7.0/x86_64/os/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Virtuozzo-7
/etc/yum.repos.d # cat factory.repo 
# These repositories are for internal use by developers only
# Enable them on your own risk!!!

[factory]
name=Build Factory packages for Containers
mirrorlist=http://download.openvz.org/virtuozzo/mirrorlists/7.0/factory-os.mirrorlist
#baseurl=http://download.openvz.org/virtuozzo/factory/x86_64/os/
priority=49
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Virtuozzo-7

[factory-debuginfo]
name=Debug packages for Containers from Build Factory
mirrorlist=http://download.openvz.org/virtuozzo/mirrorlists/7.0/factory-debug.mirrorlist
#baseurl=http://download.openvz.org/virtuozzo/factory/x86_64/debug/
priority=49
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Virtuozzo-7

[virtuozzolinux-vz-factory]
name=VirtuozzoLinux Factory
mirrorlist=http://repo.virtuozzo.com/vzlinux/mirrorlist/mirrors-7-factory
#baseurl=http://repo.virtuozzo.com/vzlinux/7/$basearch/factory/
priority=90
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/VZLINUX_GPG_KEY

[virtuozzolinux-vz-factory-debuginfo]
name=VirtuozzoLinux Factory debug packages
mirrorlist=http://repo.virtuozzo.com/vzlinux/mirrorlist/mirrors-7-factory-debug
#baseurl=http://repo.virtuozzo.com/vzlinux/7/$basearch/factory-debug/
priority=90
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/VZLINUX_GPG_KEY

@kBite
Copy link
Author

kBite commented Oct 31, 2019

VirtuozzoLinux 6

/etc/yum.repos.d # cat vzlinux.repo 
# virtuozzolinux.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for VirtuozzoLinux updates
# unless you are manually picking other mirrors.
#
[virtuozzolinux-base]
name=VirtuozzoLinux - Base
#mirrorlist=http://repo.virtuozzolinux.com/virtuozzolinux/mirrorlists/virtuozzolinux-$releasever-$basearch-os.mirrorlist
mirrorlist=http://repo.virtuozzo.com/vzlinux/mirrorlist/mirrors-6-os
#baseurl=http://repo.virtuozzo.com/vzlinux/6/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/PARALLELS_GPG_KEY

#released updates
[virtuozzolinux-updates]
name=VirtuozzoLinux - Updates
mirrorlist=http://repo.virtuozzo.com/vzlinux/mirrorlist/mirrors-6-updates
#baseurl=http://repo.virtuozzo.com/vzlinux/6/$basearch/updates/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/PARALLELS_GPG_KEY

[virtuozzolinux-base-debuginfo]
name=VirtuozzoLinux - Base Debug
mirrorlist=http://repo.virtuozzo.com/vzlinux/mirrorlist/mirrors-6-os-debug
#baseurl=http://repo.virtuozzo.com/vzlinux/6/$basearch/debug/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/PARALLELS_GPG_KEY

[virtuozzolinux-updates-debuginfo]
name=VirtuozzoLinux - Updates Debug
mirrorlist=http://repo.virtuozzo.com/vzlinux/mirrorlist/mirrors-6-updates-debug
#baseurl=http://repo.virtuozzo.com/vzlinux/6/$basearch/debug_updates/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/PARALLELS_GPG_KEY
/etc/yum.repos.d # cat virtuozzo.repo
# repositories with Virtuozzo Software should start with 'virtuozzo-' prefix (for PVA)
[virtuozzo]
name=Virtuozzo Base
mirrorlist=http://updates.virtuozzo.com/mirrors/cloudserver/6.0/base
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/PARALLELS_GPG_KEY

[virtuozzo-updates]
name=Virtuozzo Updates
mirrorlist=http://updates.virtuozzo.com/mirrors/cloudserver/6.0/updates
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/PARALLELS_GPG_KEY

[virtuozzo-debuginfo]
name=Virtuozzo Debug and Devel packages
mirrorlist=http://updates.virtuozzo.com/mirrors/cloudserver/6.0/debug
# Debug info repository will be enabled either by debuginfo-install or by parallels-devel-tools.sh
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/PARALLELS_GPG_KEY
/etc/yum.repos.d # cat ez-templates.repo 
[ez-templates]
name=Virtuozzo - EZ templates
mirrorlist=http://updates.virtuozzo.com/mirrors/templates-x86_64
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/PARALLELS_GPG_KEY

[ez-templates-32]
name=Virtuozzo - EZ templates (32 bits)
mirrorlist=http://updates.virtuozzo.com/mirrors/templates-i386
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/PARALLELS_GPG_KEY
/etc/yum.repos.d # cat obsoleted-ez-templates.repo 
[obsoleted-ez-templates]
name=Virtuozzo - obsoleted EZ templates
mirrorlist=http://updates.virtuozzo.com/mirrors/obsoleted-templates-x86_64
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/PARALLELS_GPG_KEY

[obsoleted-ez-templates-32]
name=Virtuozzo - obsoleted EZ templates (32 bits)
mirrorlist=http://updates.virtuozzo.com/mirrors/obsoleted-templates-i386
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/PARALLELS_GPG_KEY

@TJM
Copy link

TJM commented Oct 31, 2019

So, they are really close to being the same, but it is not simply 6 vs 7. The base repo name is different (although that wouldn't be too hard to work around), and the server name is different, but they are actually the same host.

$ host repo.virtuozzo.com
repo.virtuozzo.com is an alias for wpc.051c.thetacdn.net.
wpc.051c.thetacdn.net is an alias for gp1.wpc.v2cdn.net.
gp1.wpc.v2cdn.net has address 72.21.81.253
$ host updates.virtuozzo.com
updates.virtuozzo.com is an alias for wpc.051c.thetacdn.net.
wpc.051c.thetacdn.net is an alias for gp1.wpc.v2cdn.net.
gp1.wpc.v2cdn.net has address 72.21.81.253

So, it is very much like the CentOS configuration (more like CentOS than RHEL).

You can probably put each list of repos into the data/os/RedHat/Virtuozzo/7.yaml and .../6.yaml. You could get the ones that are very similar and use facts (%{facts.os.release.major}) or yum variables ($releasever) to replace the "6" or "7" and put them into the "osname" file: data/os/RedHat/Virtuozzo.yaml. I suppose you could check with Virtuozzo support to see if you can simplify it and have both 6 and 7 use the same host (repo.virtuozzo.com). It would probably be best to try to keep all the "common" (where it differs by only a version number) stuff in the "osname" file.

You basically should be able to (re)move all the files in /etc/yum.repos.d and puppet should create them and end up with the same end state (note that the yum type will actually create one file (xyz.repo) instead of putting them all into virtuozzo.repo, but the end result is the same.

~tommy

PS: More importantly, some people (me) like to purge any unmanaged repos, so having a list of OS defaults is a "good thing" if you are going to add that to the supported list. :)

@bastelfreak bastelfreak added enhancement New feature or request needs-work not ready to merge just yet labels Nov 26, 2019
@kBite
Copy link
Author

kBite commented Jan 20, 2020

  • Because of yumrepo's limitation, every repository has it's own target
  • Some repositories originally have two GPG keys configured. Because gpgkey does not allow arrays I decided to use the more often referenced (and more recent looking) GPG key

@kBite
Copy link
Author

kBite commented Jan 20, 2020

I've added all default repositories, but haven't tried de-duplicating anything.

Does anyone have suggestions regarding de-duplication? Or is it ok the way it is as the data is not expected to change ever again.

@kBite
Copy link
Author

kBite commented Jan 20, 2020

I've added tests, too. Now Travis shouldn't be failing anymore.

Can someone please have a look?

@bastelfreak bastelfreak removed needs-work not ready to merge just yet tests-fail labels Jan 20, 2020
@bastelfreak bastelfreak merged commit 2822ed5 into voxpupuli:master Jan 20, 2020
@kBite kBite deleted the add-virtuozzolinux branch January 20, 2020 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants