summaryrefslogtreecommitdiff
path: root/generate.sh
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-07-24 01:03:28 +0200
committerChristian Pointner <equinox@spreadspace.org>2020-07-24 01:03:28 +0200
commit81e07aa0953cee321eb0249f8630c52fe73ab5d0 (patch)
tree35cfeadab46de682bd611f584113d736b4a1c531 /generate.sh
parentyet another refactoring of the network config (diff)
final fixes for iso installer and add installer generate helper scripts
Diffstat (limited to 'generate.sh')
-rwxr-xr-xgenerate.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/generate.sh b/generate.sh
new file mode 100755
index 00000000..b08482f3
--- /dev/null
+++ b/generate.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
+ echo "$0 <hostnames> <distro> <codename>"
+ exit 1
+fi
+names=$1
+distro=$2
+codename=$3
+shift 3
+
+cd "${BASH_SOURCE%/*}"
+source common/utils.sh
+ansible_variable__get env_group "$names" || exit 1
+vault_environment__set "$env_group" || exit 1
+
+echo "generating installer for $distro/$codename in environment '$env_group'"
+echo ""
+
+echo "######## running the installer generator ########"
+declare -a extra_vars
+extra_vars+=(-e "install_hostnames=$names")
+extra_vars+=(-e "install_distro=$distro")
+extra_vars+=(-e "install_codename=$codename")
+extra_vars+=(-e "install_environment=$env_group")
+exec ansible-playbook ${extra_vars[@]} $@ "$env_group/$(basename "$0" .sh).yml"