From 5c13484646069064c834bbd3cd02c3bc80d94cb6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 23 Jan 2022 22:15:16 +0100 Subject: deploy: Add '--execute'. * guix/scripts/deploy.scm (show-help, %options): Add '--execute'. (invoke-command): New procedure. (guix-deploy): Break arguments at "--" and handle '-x' and associated command. * doc/guix.texi (Invoking guix deploy): Document it. --- doc/guix.texi | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index ceec0d0cf5..aaa7cbb66f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -36001,6 +36001,30 @@ be accomplished with the following operating system configuration snippet: For more information regarding the format of the @file{sudoers} file, consult @command{man sudoers}. +Once you've deployed a system on a set of machines, you may find it +useful to run a command on all of them. The @option{--execute} or +@option{-x} option lets you do that; the example below runs +@command{uname -a} on all the machines listed in the deployment file: + +@example +guix deploy @var{file} -x -- uname -a +@end example + +One thing you may often need to do after deployment is restart specific +services on all the machines, which you can do like so: + +@example +guix deploy @var{file} -x -- herd restart @var{service} +@end example + +The @command{guix deploy -x} command returns zero if and only if the +command succeeded on all the machines. + +@c FIXME/TODO: Separate the API doc from the CLI doc. + +Below are the data types you need to know about when writing a +deployment file. + @deftp {Data Type} machine This is the data type representing a single machine in a heterogeneous Guix deployment. -- cgit v1.2.3