Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F21736921
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 41f86b3..34faf8f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,10 +1,15 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+## 0.0.2 - 2017-10-06
+### Added
+ - Man pages for salt-get-config-dir(1) salt-wrapper(1) and salt-wrapper.conf(5)
## 0.0.1 - 2017-10-05
### Added
- Initial release with `salt-get-config-dir` and `salt-wrapper` commands.
+
+[0.0.2]: https://github.com/nasqueron/salt-wrapper/compare/v0.0.1...v0.0.2
diff --git a/Makefile b/Makefile
index 365fa09..a51f3d8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,44 @@
# -------------------------------------------------------------
# Makefile for salt-wrapper
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: salt-wrapper
# Licence: BSD-2-Clause
# -------------------------------------------------------------
INSTALL=/usr/bin/install
RM=/bin/rm -f
+GZIP=/usr/bin/gzip
PREFIX?=/usr/local
+MANDIR?=/usr/local/man
# -------------------------------------------------------------
# Installation main targets
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-install:
+install: install-bin install-man
+
+deinstall: deinstall-bin deinstall-man
+
+# -------------------------------------------------------------
+# Installation detailled targets
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+install-bin:
${INSTALL} salt-get-config-dir.py ${PREFIX}/bin/salt-get-config-dir
${INSTALL} salt-wrapper.sh ${PREFIX}/bin/salt-wrapper
-deinstall:
+install-man:
+ ${INSTALL} -m 444 man/salt-wrapper.1 man/salt-get-config-dir.1 ${MANDIR}/man1
+ ${INSTALL} -m 444 man/salt-wrapper.conf.5 ${MANDIR}/man5
+ ${GZIP} ${MANDIR}/man1/salt-wrapper.1
+ ${GZIP} ${MANDIR}/man1/salt-get-config-dir.1
+ ${GZIP} ${MANDIR}/man5/salt-wrapper.conf.5
+
+deinstall-bin:
${RM} ${PREFIX}/bin/salt-get-config-dir
${RM} ${PREFIX}/bin/salt-wrapper
+
+deinstall-man:
+ ${RM} ${MANDIR}/man1/salt-wrapper.1.gz
+ ${RM} ${MANDIR}/man1/salt-get-config-dir.1.gz
+ ${RM} ${MANDIR}/man5/salt-wrapper.conf.5.gz
diff --git a/man/salt-get-config-dir.1 b/man/salt-get-config-dir.1
new file mode 100644
index 0000000..490a276
--- /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
index 0000000..bb6c72b
--- /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
index 0000000..5a8320d
--- /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
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Jan 26, 08:06 (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3383832
Default Alt Text
(6 KB)
Attached To
Mode
rSW salt-wrapper
Attached
Detach File
Event Timeline
Log In to Comment