]> WPIA git - infra.git/blob - manager/config
upd: cleanup inclusion of config and document config elements
[infra.git] / manager / config
1 ### Documentation for configuration options
2
3 ## Variables
4
5 # (required) Base domain for infra system installation.
6 #to=
7
8 # (required) Hostname or IP address of the infra system.
9 #domain=
10
11 # Additional packages that should be installed.
12 devPkgs=""
13
14 # How to connect to the signer backend.
15 #
16 # Either the name for the serial device or "self" to indicate that a signer container should be set up.
17 signerLocation=self
18
19 ## Functions
20
21 # Run a command in the infra system, accepting additional ssh-options.
22 function ssh_target {
23     ssh -i vm-key "$to" "$@"
24 }
25
26 # Install nre-files to the target system.
27 #
28 # * Extract all "signer-server" to modules/cassiopeia_signer/files in the target system.
29 # * Extract all "signer-client" to modules/cassiopeia_client/files in the target system.
30 # * Extract all "gigi" to modules/ner/files in the target system.
31 function install_nre {
32     ./installNRE "$targetHost"
33 }
34
35 # Configure variables for puppet.
36 #
37 # The default implementation prompts the user for all required variables.
38 function configure {
39     ssh_target -t 'bash conf-puppet --force'
40     ssh_target 'sed -i "s%\$signerLocation = '".*'"'%\$signerLocation = '"'$signerLocation'"'%" environments/production/manifests/ip.pp'
41 }
42
43 # Reset a vm to its base snapshot.
44 #
45 # The default implementation asks the user to do so.
46 function do_reset_vm {
47     read -rp "Please reset your VM and confirm by pressing enter." _
48 }
49
50 # Execute the gigi bootstrapping process. By default the process interacts with the user.
51 #
52 # This function can be overridden to execute "execute-bootstrap-user-auto" in order to automate this bootstrapping process.
53 # Make sure to provide "bootstrapper_details" to provide the necessary answers.
54 # To fully automate bootstrapping, you need to provide a way to extract the activation link (see "read_activation_link").
55 function execute-bootstrap-user {
56     ssh_target -t 'bash bootstrap-user'
57 }
58
59 # Obtain the activation link in the variable "$link".
60 #
61 # This is required for activating the first bootstrappers account.
62 # This is only required for automated bootstrap user.
63 function read_activation_link {
64     read -rp "Link: " link
65     printf '%s\n' "$link"
66 }