consul: add postinstall step
This commit is contained in:
parent
ea8365f4ee
commit
7e47d23a28
3 changed files with 58 additions and 0 deletions
17
src/configs/consul-client.hcl
Normal file
17
src/configs/consul-client.hcl
Normal file
|
@ -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"
|
||||
]
|
24
src/configs/consul-server.hcl
Normal file
24
src/configs/consul-server.hcl
Normal file
|
@ -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"
|
||||
]
|
17
src/steps-postinstall/75-consul.sh
Executable file
17
src/steps-postinstall/75-consul.sh
Executable file
|
@ -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 a new issue