aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md6
-rw-r--r--lib/main.bash2
-rw-r--r--lib/subcommands/pkg.bash16
-rw-r--r--share/doc/bashtard.1.scd7
4 files changed, 29 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dcfa169..b589d75 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,11 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
-- `var` subcommand is now referenced in `usage()`.
+- The `var` subcommand is now referenced in `usage()`.
+- A `pkg` subcommand has been added, to allow for direct interaction with the
+ `pkg_*()` utilities provided by Bashtard.
### Changed
-- `ssh` subcommand should now only check for `ssh.host`, and show an appropriate
+- The `ssh` subcommand should now only check for `ssh.host`, and show an appropriate
warning if one is not set for a node.
- `svc_enable()` now checks for the `rc.d` file to exist before running `grep`
on it.
diff --git a/lib/main.bash b/lib/main.bash
index 385773f..cf3e069 100644
--- a/lib/main.bash
+++ b/lib/main.bash
@@ -78,6 +78,7 @@ Usage:
$BASHTARD_NAME add <playbook>
$BASHTARD_NAME del <playbook>
$BASHTARD_NAME init [repository]
+ $BASHTARD_NAME pkg <install|uninstall> <name>
$BASHTARD_NAME ssh <command>
$BASHTARD_NAME sync [playbook]
$BASHTARD_NAME sysinfo
@@ -89,6 +90,7 @@ Perform maintenance on your infra.
Commands:
add Add a configuration playbook to this machine.
init Initialize the $BASHTARD_NAME configuration system.
+ pkg Interface into the pkg abstraction used by $BASHTARD_NAME.
del Remove a configuration playbook from this machine.
ssh Run a given command on all known hosts.
sync Pull latest changes through git, and synchronize all added
diff --git a/lib/subcommands/pkg.bash b/lib/subcommands/pkg.bash
new file mode 100644
index 0000000..ff5e33f
--- /dev/null
+++ b/lib/subcommands/pkg.bash
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+# SPDX-FileCopyrightText: 2022 Patrick Spek <p.spek@tyil.nl>
+#
+# SPDX-License-Identifier: AGPL-3.0-or-later
+
+subcommand() {
+ local action
+
+ action="$1" ; shift
+
+ for package in "$@"
+ do
+ pkg "$action" "$package"
+ done
+}
diff --git a/share/doc/bashtard.1.scd b/share/doc/bashtard.1.scd
index ca8b248..1035b18 100644
--- a/share/doc/bashtard.1.scd
+++ b/share/doc/bashtard.1.scd
@@ -10,6 +10,7 @@ bashtard - A Bash-based configuration management utility
*bashtard* add <_playbook_>++
*bashtard* del <_playbook_>++
*bashtard* init [_repository_]++
+*bashtard* pkg <_install_|_uninstall_> <_name_>++
*bashtard* ssh <_command_>++
*bashtard* sync [_playbook_]++
*bashtard* var [-p _playbook_] <_key_>++
@@ -46,6 +47,12 @@ If a repository URL has been provided, *bashtard* will attempt to use *git
clone* to create the directory structure, and then add host-specific files to it
afterwards.
+## pkg
+
+Allows direct interaction with the *pkg_\*()* functions provided by the
+*bashtard* utility library. This in turn makes allows a user to use a single
+package management interface accross all their machines.
+
## ssh
Run a given command over SSH to all configured nodes. Every node needs to have