aboutsummaryrefslogtreecommitdiff
path: root/lib/subcommands/init.bash
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-05-06 19:24:41 +0200
committerPatrick Spek <p.spek@tyil.nl>2022-05-06 19:24:41 +0200
commitc817f9bc3def0b590bcee70fa0792a48277ab9ee (patch)
treea8cbdc31c416f9ec8cfc7297a7b3af63f5e10782 /lib/subcommands/init.bash
parent06f2b1311d5ecb3b19d9b50aca758767144a429f (diff)
Implement "secrets"
Diffstat (limited to 'lib/subcommands/init.bash')
-rw-r--r--lib/subcommands/init.bash7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/subcommands/init.bash b/lib/subcommands/init.bash
index c5625f2..46497f5 100644
--- a/lib/subcommands/init.bash
+++ b/lib/subcommands/init.bash
@@ -32,6 +32,7 @@ init_local()
local files=(
"$BASHTARD_ETCDIR/defaults"
+ "$BASHTARD_ETCDIR/secrets"
"$BASHTARD_ETCDIR/hosts.d/${BASHTARD_PLATFORM[fqdn]}"
"$BASHTARD_ETCDIR/os.d/${BASHTARD_PLATFORM[key]}"
"$BASHTARD_ETCDIR/playbooks.d/remotes"
@@ -48,6 +49,12 @@ init_local()
notice "bashtard/init" "Creating $file"
touch -- "$file"
done
+
+ chmod 600 -- "$BASHTARD_ETCDIR/secrets"
+
+ cat > "$BASHTARD_ETCDIR/.gitignore" <<-EOF
+ secrets
+ EOF
}
init_remote()