diff options
author | Patrick Spek <p.spek@tyil.nl> | 2022-05-04 11:46:00 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2022-05-04 11:46:00 +0200 |
commit | f03ad77ccf4fdc10af0e3cffc7d08aa4a0116769 (patch) | |
tree | 6747a310b6c37636c554a87416f9fdb49aa3d460 | |
parent | a8ef100b6b1a70ec7e2d0246943b9bf938bbe5d1 (diff) | |
download | blog-f03ad77ccf4fdc10af0e3cffc7d08aa4a0116769.tar.gz blog-f03ad77ccf4fdc10af0e3cffc7d08aa4a0116769.tar.bz2 |
Minor fixups for bashtard
-rw-r--r-- | content/posts/2022/2022-04-25-bashtard-introduction.md | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/content/posts/2022/2022-04-25-bashtard-introduction.md b/content/posts/2022/2022-04-25-bashtard-introduction.md index bdc0010..f76ed4e 100644 --- a/content/posts/2022/2022-04-25-bashtard-introduction.md +++ b/content/posts/2022/2022-04-25-bashtard-introduction.md @@ -76,19 +76,19 @@ by the `bashtard` subcommand `add`, `sync`, and `del` respectively. I generally start with the `playbook_sync()` function first, since this is the function that'll ensure all the configurations are kept in sync with my desires. I want to have my own `sshd_config`, which needs some templating for the -`Subsystem sftp` line. There's a `template` function provided by bashtard, +`Subsystem sftp` line. There's a `file_template` function provided by bashtard, which does some very simple templating. I'll pass it the `sftp` variable to use. ```bash playbook_sync() { - template sshd_config \ + file_template sshd_config \ "sftp=$(config "ssh.sftp")" \ > /etc/ssh/sshd_config } ``` -Now to create the actual template. The `template` function looks for templates -in the `share` directory inside the playbook directory. +Now to create the actual template. The `file_template` function looks for +templates in the `share` directory inside the playbook directory. ```txt mkdir share @@ -167,7 +167,7 @@ My `sshd_config` template also specifies the use of a `Motd`, so that needs to be created as well. This can again be done using the `template` function. ```bash -template "motd" \ +file_template "motd" \ "fqdn=${BASHTARD_PLATFORM[fqdn]}" \ "time=$(date -u "+%FT%T")" \ > /etc/motd @@ -224,6 +224,13 @@ this, I'll add an `if` statement to skip reloading if `bashtard` is running the `add` command. ```bash +playbook_add() { + svc enable "sshd" + svc start "sshd" + + playbook_sync +} + playbook_sync() { ... |