From nobody Thu May 15 20:29:32 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 150834675416695.17008707412333; Wed, 18 Oct 2017 10:12:34 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 121FE680EE; Wed, 18 Oct 2017 17:12:33 +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 E7D535ED26; Wed, 18 Oct 2017 17:12:32 +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 B118D410B5; Wed, 18 Oct 2017 17:12:32 +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 v9IHC33t011795 for ; Wed, 18 Oct 2017 13:12:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id 63FF46A502; Wed, 18 Oct 2017 17:12:03 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.40.205.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC75F5C8A8 for ; Wed, 18 Oct 2017 17:12:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 121FE680EE Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.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:50 +0200 Message-Id: <20171018171151.12789-6-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 5/6] guests: Configure bootloaders 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 18 Oct 2017 17:12:33 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Both GRUB and the FreeBSD bootloader need some tweaking to make sure the OS will display boot messages and provide a login prompt on the serial console, which is useful when SSH access can't be used for whatever reason. Signed-off-by: Andrea Bolognani --- guests/tasks/base.yml | 50 +++++++++++++++++++++++++++++++++++++++++++++++= +++ 1 file changed, 50 insertions(+) diff --git a/guests/tasks/base.yml b/guests/tasks/base.yml index a9066e4..db805b8 100644 --- a/guests/tasks/base.yml +++ b/guests/tasks/base.yml @@ -115,3 +115,53 @@ line: 'PermitRootLogin without-password' state: present backup: yes + +- name: Look for GRUB configuration + stat: + path: /etc/default/grub + register: grubdefault + +- name: Look for GRUB configuration + stat: + path: /boot/grub/grub.cfg + register: grubcfg + +- name: Look for GRUB configuration + stat: + path: /boot/grub2/grub.cfg + register: grub2cfg + +- name: Configure GRUB + lineinfile: + path: /etc/default/grub + regexp: '^{{ item.key }}=3D.*$' + line: '{{ item.key }}=3D"{{ item.value }}"' + backup: yes + with_items: + - { key: 'GRUB_TIMEOUT', value: '1' } + - { key: 'GRUB_CMDLINE_LINUX_DEFAULT', value: 'console=3DttyS0' } + - { key: 'GRUB_CMDLINE_LINUX', value: 'console=3DttyS0' } + - { key: 'GRUB_TERMINAL', value: 'serial' } + - { key: 'GRUB_SERIAL_COMMAND', value: 'serial' } + when: + - grubdefault.stat.exists + +- name: Apply GRUB configuration + command: 'grub-mkconfig -o /boot/grub/grub.cfg' + when: + - grubcfg.stat.exists + +- name: Apply GRUB configuration + command: 'grub2-mkconfig -o /boot/grub2/grub.cfg' + when: + - grub2cfg.stat.exists + +- name: Configure the FreeBSD bootloader + lineinfile: + path: /boot/loader.conf + regexp: '^console=3D.*$' + line: 'console=3D"comconsole"' + create: yes + backup: yes + when: + - os_name =3D=3D 'FreeBSD' --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list