From 802ea1f3a43e5fb8d0b8bd2882954d8a6e49cde6 Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Fri, 27 Jan 2023 21:06:12 +0000 Subject: system: Deprecate hosts-file. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/system.scm (operating-system-hosts-file): Deprecate procedure. (warn-hosts-file-field-deprecation): New procedure, helper for deprecated variable. (operating-system)[hosts-file]: Use helper to warn deprecated field. (local-host-aliases): Mark as deprecated. (local-host-entries): New procedure. (operating-system-default-essential-services, hurd-default-essential-services): Use hosts-service-type. Use '%operating-system-hosts-file' and 'local-host-entries'. (default-/etc/hosts): Remove procedure. (operating-system-etc-service): Remove hosts file. * doc/guix.texi (operating-system Reference) (Networking Services) (Virtualization Services): Rewrite documentation entries to use hosts-service-type. Co-authored-by: Ludovic Courtès --- gnu/tests/ganeti.scm | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'gnu/tests') diff --git a/gnu/tests/ganeti.scm b/gnu/tests/ganeti.scm index f647e9554c..b5624b7598 100644 --- a/gnu/tests/ganeti.scm +++ b/gnu/tests/ganeti.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020, 2021 Marius Bakke ;;; Copyright © 2020 Brice Waegeneire +;;; Copyright © 2023 Bruno Victal ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,6 +23,7 @@ #:use-module (gnu tests) #:use-module (gnu system vm) #:use-module (gnu services) + #:use-module (gnu services base) #:use-module (gnu services ganeti) #:use-module (gnu services networking) #:use-module (gnu services ssh) @@ -46,18 +48,15 @@ %base-file-systems)) (firmware '()) - ;; The hosts file must contain a nonlocal IP for host-name. - ;; In addition, the cluster name must resolve to an IP address that - ;; is not currently provisioned. - (hosts-file (plain-file "hosts" (format #f " -127.0.0.1 localhost -::1 localhost -10.0.2.15 gnt1.example.com gnt1 -192.168.254.254 ganeti.example.com -"))) - (packages (append (list ganeti-instance-debootstrap ganeti-instance-guix) %base-packages)) + + ;; The hosts file must contain a nonlocal IP for host-name. + (essential-services + (modify-services (operating-system-default-essential-services this-operating-system) + (hosts-service-type config => (list + (host "127.0.0.1" "localhost") + (host "::1" "localhost"))))) (services (append (list (service static-networking-service-type (list %qemu-static-networking)) @@ -65,6 +64,13 @@ (openssh-configuration (permit-root-login 'prohibit-password))) + ;; In addition, the cluster name must resolve to an IP address that + ;; is not currently provisioned. + (simple-service 'ganeti-host-entries hosts-service-type + (list + (host "10.0.2.15" "gnt1.example.com" '("gnt1")) + (host "192.168.254.254" "ganeti.example.com"))) + (service ganeti-service-type (ganeti-configuration (file-storage-paths '("/srv/ganeti/file-storage")) -- cgit 1.4.1