Compare commits
3 Commits
36234baae7
...
8220c62233
Author | SHA1 | Date |
---|---|---|
Starbeamrainbowlabs | 8220c62233 | |
Starbeamrainbowlabs | 7e47d23a28 | |
Starbeamrainbowlabs | ea8365f4ee |
|
@ -0,0 +1,17 @@
|
|||
bind_addr = "{{ GetInterfaceIP \"wgoverlay\" }}"
|
||||
|
||||
bootstrap = false
|
||||
server = false
|
||||
|
||||
domain = "mooncarrot.space."
|
||||
|
||||
client_addr = "127.0.0.1 {{ GetInterfaceIP \"docker0\" }}"
|
||||
|
||||
data_dir = "/srv/consul"
|
||||
log_level = "INFO"
|
||||
|
||||
retry_join = [
|
||||
"wopplefox",
|
||||
"spatterling",
|
||||
"sycadil"
|
||||
]
|
|
@ -0,0 +1,24 @@
|
|||
bind_addr = "{{ GetInterfaceIP \"wgoverlay\" }}"
|
||||
|
||||
# When we have this many servers in the cluster, automatically run the first leadership election
|
||||
# Remember that the Hashicorp stack uses the Raft consensus algorithm.
|
||||
bootstrap_expect = 3
|
||||
server = true
|
||||
ui_config {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
client_addr = "127.0.0.1 {{ GetInterfaceIP \"docker0\" }} {{ GetInterfaceIP \"wgoverlay\" }}"
|
||||
|
||||
data_dir = "/srv/consul"
|
||||
log_level = "INFO"
|
||||
|
||||
domain = "mooncarrot.space."
|
||||
|
||||
|
||||
retry_join = [
|
||||
// "172.16.230.100"
|
||||
"wopplefox",
|
||||
"spatterling",
|
||||
"sycadil"
|
||||
]
|
18
src/run.sh
18
src/run.sh
|
@ -46,12 +46,20 @@ fi
|
|||
|
||||
###############################################################################
|
||||
|
||||
# Asks the user a yes/no question.
|
||||
# $1 The question to ask the user.
|
||||
# Returns 0 if the answer was yes, or 1 if the answer was no.
|
||||
ask_yesno() {
|
||||
local question="$1";
|
||||
|
||||
whiptail --title "Step ${step_current} / ${step_max}" --yesno "${question}" 40 8;
|
||||
return "$?"; # Not actually needed, but best to be explicit
|
||||
}
|
||||
# Asks the user for a string of text.
|
||||
# $1 The window title.
|
||||
# $2 The question to ask.
|
||||
# $3 The default text value.
|
||||
# Returns the answer as a string on the standard output.
|
||||
ask_text() {
|
||||
local title="$1";
|
||||
local question="$2";
|
||||
|
@ -59,6 +67,12 @@ ask_text() {
|
|||
whiptail --title "${title}" --inputbox "${question}" 10 40 "${default_text}" 3>&1 1>&2 2>&3;
|
||||
return "$?"; # Not actually needed, but best to be explicit
|
||||
}
|
||||
|
||||
# Asks the user for a password.
|
||||
# $1 The window title.
|
||||
# $2 The question to ask.
|
||||
# $3 The default text value.
|
||||
# Returns the answer as a string on the standard output.
|
||||
ask_password() {
|
||||
local title="$1";
|
||||
local question="$2";
|
||||
|
@ -66,6 +80,10 @@ ask_password() {
|
|||
whiptail --title "${title}" --passwordbox "${question}" 10 40 "${default_text}" 3>&1 1>&2 2>&3;
|
||||
return "$?"; # Not actually needed, but best to be explicit
|
||||
}
|
||||
# Asks the user to choose at most 1 item from a list of items.
|
||||
# $1 The window title.
|
||||
# $2..$n The items that the user must choose between.
|
||||
# Returns the chosen item as a string on the standard output.
|
||||
ask_multichoice() {
|
||||
local title="$1"; shift;
|
||||
local args=();
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
task_begin "Installing Consul configuration";
|
||||
# /etc/consul is created by the apt postinstall script
|
||||
|
||||
subtask_begin "Copying configuration files";
|
||||
cp "configs/consul-client.hcl" "/etc/consul/client.hcl";
|
||||
cp "configs/consul-server.hcl" "/etc/consul/server.hcl";
|
||||
subtask_end "$?";
|
||||
|
||||
subtask_begin "Starting Consul and enabling on boot";
|
||||
systemctl consul;
|
||||
subtask_end "$?";
|
||||
|
||||
|
||||
task_end "$?";
|
Loading…
Reference in New Issue