From nobody Thu May 15 20:13:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1508346756923190.00651806253768; Wed, 18 Oct 2017 10:12:36 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 98D2165DAC; Wed, 18 Oct 2017 17:12:35 +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 756B17C184; Wed, 18 Oct 2017 17:12:35 +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 3E20A3FC71; Wed, 18 Oct 2017 17:12:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9IHC44I011806 for ; Wed, 18 Oct 2017 13:12:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id 885635C8A8; Wed, 18 Oct 2017 17:12:04 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.40.205.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DDA3C5C89F for ; Wed, 18 Oct 2017 17:12:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 98D2165DAC Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 18 Oct 2017 19:11:51 +0200 Message-Id: <20171018171151.12789-7-abologna@redhat.com> In-Reply-To: <20171018171151.12789-1-abologna@redhat.com> References: <20171018171151.12789-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [libvirt-jenkins-ci PATCH v2 6/6] guests: Update documentation 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 18 Oct 2017 17:12:36 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- guests/README.markdown | 91 +++++++++++++++++++++++++++++++++++-----------= ---- 1 file changed, 64 insertions(+), 27 deletions(-) diff --git a/guests/README.markdown b/guests/README.markdown index 4d464e1..100ca31 100644 --- a/guests/README.markdown +++ b/guests/README.markdown @@ -1,38 +1,55 @@ -Ansible playbooks for libvirt CI -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D +libvirt CI - guest management tools +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -These can be used to turn a freshly installed machine into a worker for -the Jenkins-based libvirt CI. +The tools contained in this directory simplify and automate the management +of the guests used by the Jenkins-based libvirt CI environment. =20 -There are two main playbooks: +There are two steps to bringing up a guest: =20 -* `bootstrap.yml`, used to perform the bootstrapping phase, that is, getti= ng - guests to the point where Ansible can manage them fully and prompting the - user for a password is no longer required; +* `./lcitool install $guest` will perform an unattended installation + of `$guest`. Not all guests can be installed this way: see the "FreeBSD" + section below; =20 -* `site.yml`, used for the remaining configuration steps. +* `./lcitool prepare $guest` will go through all the post-installation + configuration steps required to make the newly-created guest usable as + part of the Jenkins CI setup. =20 -Although you can use the playbooks directly, it's much more convenient to -call either `make bootstrap` or `make site` instead. +Once those steps have been performed, maintainance will involve running: =20 -Each guest only needs to be bootstrapped once; that said, both playbooks a= re -idempotent so there's no harm in applying them over and over again. +* `./lcitool update $guest` =20 +periodically to ensure the guest configuration is sane and all installed +packages are updated. =20 -Requirements ------------- =20 -SSH must be running in the guest, and root login must be permitted. +Host setup +---------- =20 +Ansible and `virt-install` need to be available on the host. =20 -CI use ------- +Before you can start bringing up guests, you'll have to store your +site-specific root password in the `~/.config/lcitool/root-password` file. +This password will only be necessary for serial console access in case +something goes horribly wrong; for day to day operations, SSH key +authentication will be used instead. =20 -After you have reinstalled a Jenkins worker, run `make bootstrap` followed -by `make site` and a reboot to get it ready for CI use. No further action -should be necessary. +Ansible expects to be able to connect to the guests by name: installing and +enabling the [libvirt NSS plugin](https://wiki.libvirt.org/page/NSS_module) +on the host is the easiest way to make sure that works. More specifically, +you'll want to use the `libvirt_guest` variant of the plugin. =20 -Adding new workers will require tweaking the inventory and host variables, +To keep guests up to date over time, it's recommended to have an entry +along the lines of + + 0 0 * * * cd ~/libvirt-jenkins-ci/guests && ./lcitool update all + +in your crontab. + + +Adding new guests +----------------- + +Adding new guests will require tweaking the inventory and host variables, but it should be very easy to eg. use the Fedora 26 configuration to come up with a working Fedora 27 configuration. =20 @@ -40,11 +57,11 @@ up with a working Fedora 27 configuration. Development use --------------- =20 -If you are a developer trying to reproduce a bug on some OS you don't have -easy access to, you can use these playbooks to create a suitable test +If you are a developer trying to reproduce a bug on some OS you don't +have easy access to, you can use these tools to create a suitable test environment. =20 -Since the playbooks are intended mainly for CI use, you'll have to tweak t= hem +Since the tools are intended mainly for CI use, you'll have to tweak them a bit first, including: =20 * trimming down the `inventory` file to just the guest you're interested i= n; @@ -56,5 +73,25 @@ a bit first, including: =20 * deleting `host_vars/$guest/vault.yml` altogether. =20 -After performing these tweaks, you should be able to just run `make bootst= rap` -followed by `make site` as usual. +After performing these tweaks, you should be able to use the same steps +outlined above. + +A better way to deal with this use case will be provided in the future. + + +FreeBSD +------- + +Installation of FreeBSD guests must be performed manually; alternatively, +the official qcow2 images can be used to quickly bring up such guests. + +Some manual tweaking will be needed, in particular: + +* `/etc/ssh/sshd_config` must contain the `PermitRootLogin yes` directive; + +* `/etc/rc.conf` must contain the `sshd_enable=3D"YES"` setting; + +* the root password must be manually set to "root" (without quotes). + +Once these steps have been performed, FreeBSD guests can be managed just +like all other guests. --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list