--- /dev/null
+### Documentation for configuration options
+
+## Variables
+
+# (required) Base domain for infra system installation.
+#to=
+
+# (required) Hostname or IP address of the infra system.
+#domain=
+
+# Additional packages that should be installed.
+devPkgs=""
+
+# How to connect to the signer backend.
+#
+# Either the name for the serial device or "self" to indicate that a signer container should be set up.
+signerLocation=self
+
+## Functions
+
+# Run a command in the infra system, accepting additional ssh-options.
+function ssh_target {
+ ssh -i vm-key "$to" "$@"
+}
+
+# Install nre-files to the target system.
+#
+# * Extract all "signer-server" to modules/cassiopeia_signer/files in the target system.
+# * Extract all "signer-client" to modules/cassiopeia_client/files in the target system.
+# * Extract all "gigi" to modules/ner/files in the target system.
+function install_nre {
+ ./installNRE "$targetHost"
+}
+
+# Configure variables for puppet.
+#
+# The default implementation prompts the user for all required variables.
+function configure {
+ ssh_target -t 'bash conf-puppet --force'
+ ssh_target 'sed -i "s%\$signerLocation = '".*'"'%\$signerLocation = '"'$signerLocation'"'%" environments/production/manifests/ip.pp'
+}
+
+# Reset a vm to its base snapshot.
+#
+# The default implementation asks the user to do so.
+function do_reset_vm {
+ read -rp "Please reset your VM and confirm by pressing enter." _
+}
+
+# Execute the gigi bootstrapping process. By default the process interacts with the user.
+#
+# This function can be overridden to execute "execute-bootstrap-user-auto" in order to automate this bootstrapping process.
+# Make sure to provide "bootstrapper_details" to provide the necessary answers.
+# To fully automate bootstrapping, you need to provide a way to extract the activation link (see "read_activation_link").
+function execute-bootstrap-user {
+ ssh_target -t 'bash bootstrap-user'
+}
+
+# Obtain the activation link in the variable "$link".
+#
+# This is required for activating the first bootstrappers account.
+# This is only required for automated bootstrap user.
+function read_activation_link {
+ read -rp "Link: " link
+ printf '%s\n' "$link"
+}
#!/bin/bash
-function ssh_target {
- ssh -i vm-key "$to" "$@"
-}
-target=$1
-target=${target%/}
-source "$target/config"
+targetHost=$1
+targetHost=${targetHost%/}
+source config
+source "$targetHost/config"
echo "To: $to"
echo "Agent: $SSH_AGENT_PID"
if [[ $command == "push" ]]; then
git push -f "$to:" "HEAD:refs/remotes/manager/master"
else
- git fetch "$to:" "+HEAD:refs/remotes/$target/master"
+ git fetch "$to:" "+HEAD:refs/remotes/$targetHost/master"
fi
if [[ $oldpid == "" ]]; then
eval $(ssh-agent -k)
#!/bin/bash
-signerLocation=self
-devPkgs=""
-targetHost="$1"
-
-function ssh_target {
- ssh -i vm-key "$to" "$@"
-}
-
-function install_nre {
- ./installNRE "$targetHost"
-}
-function read_activation_link {
- read -rp "Link: " link
- printf '%s\n' "$link"
-}
-function configure {
- ssh_target -t 'bash conf-puppet --force'
- ssh_target 'sed -i "s%\$signerLocation = '".*'"'%\$signerLocation = '"'$signerLocation'"'%" environments/production/manifests/ip.pp'
-}
-function do_reset_vm {
- read -rp "Please reset your VM and confirm by pressing enter." _
-}
-function execute-bootstrap-user {
- ssh_target -t 'bash bootstrap-user'
-}
-
+targetHost=$1
+targetHost=${targetHost%/}
+source config
source "$targetHost/config"
eval $(ssh-agent)