aboutsummaryrefslogtreecommitdiff
path: root/lib/subcommands/bootstrap.bash
diff options
context:
space:
mode:
Diffstat (limited to 'lib/subcommands/bootstrap.bash')
-rw-r--r--lib/subcommands/bootstrap.bash25
1 files changed, 14 insertions, 11 deletions
diff --git a/lib/subcommands/bootstrap.bash b/lib/subcommands/bootstrap.bash
index b2e540b..8750134 100644
--- a/lib/subcommands/bootstrap.bash
+++ b/lib/subcommands/bootstrap.bash
@@ -18,29 +18,30 @@ bootstrap_local()
{
local dirs=(
"$BASHTARD_ETCDIR"
+ "$BASHTARD_ETCDIR/conf.d"
"$BASHTARD_ETCDIR/hosts.d"
"$BASHTARD_ETCDIR/os.d"
"$BASHTARD_ETCDIR/playbooks.d"
- "$BASHTARD_ETCDIR/playbook-registry.d/"
+ "$BASHTARD_ETCDIR/registry.d"
+ "$BASHTARD_ETCDIR/registry.d/${BASHTARD_PLATFORM[fqdn]}"
)
local files=(
"$BASHTARD_ETCDIR/defaults"
- "$BASHTARD_ETCDIR/playbooks"
- "$BASHTARD_ETCDIR/playbook-registry.d/${BASHTARD_PLATFORM[fqdn]}"
"$BASHTARD_ETCDIR/hosts.d/${BASHTARD_PLATFORM[fqdn]}"
"$BASHTARD_ETCDIR/os.d/${BASHTARD_PLATFORM[key]}"
+ "$BASHTARD_ETCDIR/playbooks.d/remotes"
)
for dir in "${dirs[@]}"
do
- notice "bootstrap" "Creating $dir"
+ notice "bashtard/bootstrap" "Creating $dir"
mkdir -p -- "$dir"
done
for file in "${files[@]}"
do
- notice "bootstrap" "Creating $file"
+ notice "bashtard/bootstrap" "Creating $file"
touch -- "$file"
done
}
@@ -53,20 +54,22 @@ bootstrap_remote()
local files=(
"$BASHTARD_ETCDIR/hosts.d/${BASHTARD_PLATFORM[fqdn]}"
"$BASHTARD_ETCDIR/os.d/${BASHTARD_PLATFORM[key]}"
- "$BASHTARD_ETCDIR/playbook-registry.d/${BASHTARD_PLATFORM[fqdn]}"
+ "$BASHTARD_ETCDIR/registry.d/${BASHTARD_PLATFORM[fqdn]}"
)
for file in "${files[@]}"
do
[[ -f "$file" ]] && continue
- notice "bootstrap" "Creating $file"
+ notice "bashtard/bootstrap" "Creating $file"
touch -- "$file"
done
- while read -r playbook url
+ while read -r playbook url branch
do
- notice bootstrap "Cloning $playbook from $url"
- git clone "$url" "$BASHTARD_ETCDIR/playbooks.d"
- done < "$BASHTARD_ETCDIR/playbooks"
+ notice "bashtard/bootstrap" "Cloning $playbook from $url"
+ git clone "$url" "$BASHTARD_ETCDIR/playbooks.d/$playbook"
+
+ # TODO: Clone appropriate branch
+ done < "$BASHTARD_ETCDIR/playbooks.d/remotes"
}