From nobody Sun Feb 8 05:41:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575658452; cv=none; d=zohomail.com; s=zohoarc; b=nKOUuVCtEi5Sz1v1jSgQGxLO9ZsliIVrct+1p0mPQWVHCv0bfqcORnks+4ygCbJBNkoDAHwO68dCMFLW1G2xwP8W6/Un6PPag2sUOpn6YJtisGXwcy/So7CMlNJwDXBSAuDrWYvYBjpyxIuk7znslQApaxRURQe9FD7kj7qz1rw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575658452; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=m4w62zXux5RGYAUJPjPXfBcH96Xclzxa3cgPowNsXt8=; b=JmOuQsBujpLVWiL7VSFvu0luJ6IiuRFZVmEZrYlouKsMZmO78F15ge2xro9lxoNoF3FB1fZSFLHZB8sMA/VPyPQFM3TgqGNwum1eM41OMPf/uA8DcWx7cb0alRAg5x4wdj6/VzgYUgUMcqLWmHjxSCsasoazQuY6WS/U6Z/NvCQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1575658452038738.1097084543052; Fri, 6 Dec 2019 10:54:12 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-192-b0Y3G2kNPP62iJRh8Kab3Q-1; Fri, 06 Dec 2019 13:54:09 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C568E107ACFE; Fri, 6 Dec 2019 18:54:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D77619C70; Fri, 6 Dec 2019 18:54:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4B5646B500; Fri, 6 Dec 2019 18:54:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB6Irk8W003270 for ; Fri, 6 Dec 2019 13:53:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id 62A66608A5; Fri, 6 Dec 2019 18:53:46 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-49.ams2.redhat.com [10.36.112.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 344C06B8F2; Fri, 6 Dec 2019 18:53:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575658450; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=m4w62zXux5RGYAUJPjPXfBcH96Xclzxa3cgPowNsXt8=; b=QDsNxGj7+N24eHl+YD5vO8gN7FOz7pCr9RJeWqSgJkDozjzwYmmztl+UIZh4Ruk0BmVwwr wo5zUj6ru+5AvuzknL1pWwSyez8CWwEQhMAqB6i/TsNzLpDL9V9OygxjogvraJdNsA1NUI ztNJOQyNIc10YKRg0WtbEAFwMiG0NrY= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 6 Dec 2019 18:53:38 +0000 Message-Id: <20191206185340.3945673-2-berrange@redhat.com> In-Reply-To: <20191206185340.3945673-1-berrange@redhat.com> References: <20191206185340.3945673-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [jenkins-ci PATCH v2 1/3] guests: add openvz repository on CentOS 7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: b0Y3G2kNPP62iJRh8Kab3Q-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The OpenVZ site provides a yum repo built against RHEL-7 that includes the prlsdk-devel RPM needed for the VZ driver. This repo has quite alot of packages that replace stuff from standard RHEL repos, so the yum config file is set to whitelist only the minimal RPMs we need to do builds. Fortunately they have no deps which would cause replacement of standard RHEL RPMs. Note this does not use the latest OpenVZ repo link, since that currently has broken dependencies present Error: Package: libprlcommon-7.0.183-1.vz7.x86_64 (vz) Requires: libjson-c.so.2(libjson-c.so.2)(64bit) The Requires line ought to be libjson-c.so.2()(64bit) Once that's fixed we can switch to the latest repo link. Signed-off-by: Daniel P. Berrang=C3=A9 --- guests/lcitool | 22 ++++++++++++++++ guests/playbooks/update/tasks/base.yml | 25 +++++++++++++++++++ guests/playbooks/update/templates/openvz.key | 20 +++++++++++++++ .../playbooks/update/templates/openvz.repo.j2 | 9 +++++++ 4 files changed, 76 insertions(+) create mode 100644 guests/playbooks/update/templates/openvz.key create mode 100644 guests/playbooks/update/templates/openvz.repo.j2 diff --git a/guests/lcitool b/guests/lcitool index d617beb..4f874b3 100755 --- a/guests/lcitool +++ b/guests/lcitool @@ -593,6 +593,18 @@ class Application: self._execute_playbook("build", args.hosts, args.projects, args.git_revision) =20 + def _get_openvz_repo(self): + basedir =3D os.path.dirname(sys.argv[0]) + repofile =3D os.path.join(basedir, "playbooks", "update", "templat= es", "openvz.repo.j2") + with open(repofile, "r") as r: + return r.read().rstrip() + + def _get_openvz_key(self): + basedir =3D os.path.dirname(sys.argv[0]) + repofile =3D os.path.join(basedir, "playbooks", "update", "templat= es", "openvz.key") + with open(repofile, "r") as r: + return r.read().rstrip() + def _action_dockerfile(self, args): mappings =3D self._projects.get_mappings() pip_mappings =3D self._projects.get_pip_mappings() @@ -723,6 +735,16 @@ class Application: {package_manager} clean all -y """).format(**varmap)) elif os_name =3D=3D "CentOS" and os_version =3D=3D "7": + repo =3D self._get_openvz_repo() + repocmd =3D "\\n\\\n".join(repo.split("\n")) + key =3D self._get_openvz_key() + keycmd =3D "\\n\\\n".join(key.split("\n")) + + sys.stdout.write( + "RUN echo -e '%s' > /etc/yum.repos.d/openvz.repo && \\= \n" % repocmd + + " echo -e '%s' > /etc/pki/rpm-gpg/RPM-GPG-KEY-OpenV= Z && \\\n" % keycmd + + " rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-OpenVZ") + sys.stdout.write(textwrap.dedent(""" RUN {package_manager} update -y && \\ {package_manager} install -y epel-release && \\ diff --git a/guests/playbooks/update/tasks/base.yml b/guests/playbooks/upda= te/tasks/base.yml index 3d83e78..e17b50b 100644 --- a/guests/playbooks/update/tasks/base.yml +++ b/guests/playbooks/update/tasks/base.yml @@ -13,6 +13,31 @@ package: name: epel-release state: latest + +- name: Create OpenVZ key + template: + src: '{{ playbook_base }}/templates/openvz.key' + dest: /etc/pki/rpm-gpg/RPM-GPG-KEY-OpenVZ + owner: root + group: root + when: + - os_name =3D=3D 'CentOS' + - os_version =3D=3D '7' + +- name: Import OpenVZ key + command: 'rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-OpenVZ' + args: + warn: no + when: + - os_name =3D=3D 'CentOS' + - os_version =3D=3D '7' + +- name: Enable OpenVZ repository + template: + src: '{{ playbook_base }}/templates/openvz.repo.j2' + dest: /etc/yum.repos.d/openvz.repo + owner: root + group: root when: - os_name =3D=3D 'CentOS' - os_version =3D=3D '7' diff --git a/guests/playbooks/update/templates/openvz.key b/guests/playbook= s/update/templates/openvz.key new file mode 100644 index 0000000..b77a137 --- /dev/null +++ b/guests/playbooks/update/templates/openvz.key @@ -0,0 +1,20 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v2.0.22 (GNU/Linux) + +mI0EVl80nQEEAKrEeyeTCwrzS9kYedZ/sAc/GUqlb81C7pA9SaR3fyck5mVw1Ogk +YdmNBPM2kY7QDxR9F0EpSpnxSCAXZXugsQ8KzZ0DRLVeBDQyGs9IGK5hI0zzxIil +BzfvIexLiQQhLy7YlIi8Jt/uUqKkW0pIMNMGcduY97VATtczpncpkmSzABEBAAG0 +SFZpcnR1b3p6byBUZWFtIChHUEcga2V5IHNpZ25hdHVyZSBmb3IgcGFja2FnZXMp +IDxzZWN1cml0eUB2aXJ0dW96em8uY29tPoi5BBMBAgAjBQJWXzSdAhsDBwsJCAcD +AgEGFQgCCQoLBBYCAwECHgECF4AACgkQygt9GUTNrSruIgP/er70Eyo73A1gfrjv +oPUkyo4rslVRZu3qqCwoMFtJc/Z/UxWgEka1buorlcGLa6eO/EZ49c0n+KGa4Kvt +EUboIq0yEu5i0FyAj92ifm+hNhoAbGfm0cZ4/fD0oGr3l8OsQo4+iHX4xAPwFe7Y +zABuB8I1ZDZ4OIp5tDfTTuF2LT24jQRWXzSdAQQAog2Aqb+Ptl68O7cQhWLjVGkj +yyigZrdeReLx3HloKJPBeQ/kA6uvMJc/IYS3uppMWXv9v+QenS6uhP1TUJ2k9FvM +t94MQZfALN7Vpf8AF+UeWu4Ru+y4BNzcFhrPhIFNFChOR2QqW6FkgE57D9I177NC +oJMyrlNe8wcGa178An8AEQEAAYifBBgBAgAJBQJWXzSdAhsMAAoJEMoLfRlEza0q +bKwD/3+OFVIEXnIv5XgdGRNX5fHggsUN1bb8gva7HANRlKdd4LD8foDM3F/yv/3V +igG14D5EjKz56SaBDNgiI4++hOzb2M8jhAsR86jxkXFrrP1U3ZNRKg6av9DPFAPS +WEiJKtQrZDJloqtyi/mmRa1VsV7RYR0VPJjhK/R8EQ7Ysshy +=3DfRMg +-----END PGP PUBLIC KEY BLOCK----- diff --git a/guests/playbooks/update/templates/openvz.repo.j2 b/guests/play= books/update/templates/openvz.repo.j2 new file mode 100644 index 0000000..19a9546 --- /dev/null +++ b/guests/playbooks/update/templates/openvz.repo.j2 @@ -0,0 +1,9 @@ +[openvz] +name=3DOpenVZ addons +baseurl=3Dhttps://download.openvz.org/virtuozzo/releases/openvz-7.0.11-235= /x86_64/os/ +enabled=3D1 +gpgcheck=3D1 +skip_if_unavailable=3D0 +metadata_expire=3D6h +priority=3D90 +includepkgs=3Dlibprl* --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list