Page MenuHomeDevCentral

D1039.id2650.diff
No OneTemporary

D1039.id2650.diff

diff --git a/man/salt-get-config-dir.1 b/man/salt-get-config-dir.1
new file mode 100644
--- /dev/null
+++ b/man/salt-get-config-dir.1
@@ -0,0 +1,34 @@
+.Dd $Mdocdate$
+.Dt SALT-GET-CONFIG-DIR 1
+.Os Nasqueron
+.Sh NAME
+.Nm salt-get-config-dir
+.Nd determine the Salt configuration directory from the current working directory
+.Sh SYNOPSIS
+.Nm salt-get-config-dir
+.Sh DESCRIPTION
+The
+.Nm
+utility finds a match between the current working directory and the wrapper
+configuration file, then prints to stdout the matching configuration directory.
+.Sh ENVIRONMENT
+.Bl -tag -width SALT_WRAPPER_CONF
+.It Ev SALT_WRAPPER_CONF
+Path to the configuration file. If omitted, the default path
+.Pa /usr/local/etc/salt-wrapper.conf
+will be used.
+.Elb
+.Sh EXIT STATUS
+The
+.Nm
+utility exits 0 on success, 1 the directory can't be found
+and >1 if an error occurs.
+.Sh SEE ALSO
+.Xr salt-wrapper 1
+.Xr salt-wrapper.conf 5
+.Sh CAVEATS
+.Nm
+is not intended to be called explicitly from the command line,
+but used by the
+.Nm salt-wrapper
+command.
diff --git a/man/salt-wrapper.1 b/man/salt-wrapper.1
new file mode 100644
--- /dev/null
+++ b/man/salt-wrapper.1
@@ -0,0 +1,50 @@
+.Dd $Mdocdate$
+.Dt SALT-WRAPPER 1
+.Os Nasqueron
+.Sh NAME
+.Nm salt-wrapper
+.Nd invoke Salt with correct config dir and sudo capability
+.Sh SYNOPSIS
+.Nm salt-wrapper
+.Ar salt-command
+.Op ...
+.Sh DESCRIPTION
+The
+.Nm
+utility invokes the specified Salt command, prepended by a sudo
+call to execute the command as the Salt user (see below).
+
+.Nm
+also appends a
+.Ar --config-dir
+argument, with the Salt configuration directory matching the
+current working directory, as provided by the
+.Nm salt-get-config-dir
+program.
+.Sh SALT USER
+Every command is executed as the
+.Sy salt
+user.
+
+The
+.Nm
+.Ar salt-call
+.Ar --local
+command will execute as
+.Sy root
+instead, to allow to modify the current server.
+.Sh EXIT STATUS
+The
+.Nm
+utility exits 0 on success, and >0 if an error occurs.
+.Sh SEE ALSO
+.Xr salt-get-config-dir 1
+.Xr salt-wrapper.conf 5
+.Sh CAVEATS
+.Nm
+is not intended to be called explicitly from the command line,
+but aliased in the shell to wrap implicitly and automatically
+the Salt command.
+
+https://docs.nasqueron.org/salt-wrapper/admin.html#shell-aliases
+gives the syntax to use for C and bourne shells.
diff --git a/man/salt-wrapper.conf.5 b/man/salt-wrapper.conf.5
new file mode 100644
--- /dev/null
+++ b/man/salt-wrapper.conf.5
@@ -0,0 +1,56 @@
+.Dd $Mdocdate$
+.Dt MAIN-WRAPPER.CONF 5
+.Os Nasqueron
+.Sh NAME
+.Pa /usr/local/etc/salt-wrapper.conf
+.Nd configure salt-wrapper
+.Sh DESCRIPTION
+The
+.Pa /usr/local/etc/salt-wrapper.conf
+configuration file contains a map of directories for the
+.Nm salt-get-config-dir
+command.
+
+The map is the answer to the question “For a given current working directory, what's the Salt configuration directory to use?”.
+.Sh FILE FORMAT
+The configuration file is written in JSON.
+
+The
+.Va roots
+.Vt array
+contains an entry for each directory to map.
+
+Each entry is an
+.Vt object
+with two
+.Vt strings
+to map the directories:
+.Bl -tag -offset indent -width states
+.It Va config
+The directory containing the Salt configuration
+.It Va states
+The current working directory containing the Salt states
+.El
+.Sh EXAMPLE
+The following file can be used to use the default Salt config directory for
+.Pa /opt/nasqueron-operations
+but a custom secondary config directory for
+.Pa /opt/woodscloud-operations
+working directory:
+.Bd -literal -offset indent
+{
+ "roots": [
+ {
+ "config": "/usr/local/etc/salt-woodscloud",
+ "states": "/opt/woodscloud-operations"
+ },
+ {
+ "config": "/usr/local/etc/salt",
+ "states": "/opt/nasqueron-operations"
+ }
+ ]
+}
+.Ed
+.Sh SEE ALSO
+.Xr salt-wrapper 1
+.Xr salt-get-config-dir 1

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 22, 12:23 (16 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2595471
Default Alt Text
D1039.id2650.diff (3 KB)

Event Timeline