Use alpine's init script:
[13:02] router1.place6:~# mv /etc/init.d/consul.apk-new /etc/init.d/consul
[13:03] router1.place6:~# cat /etc/conf.d/consul
# Consul startup
consul_opts="agent -config-dir=/etc/consul"
[13:04] router1.place6:~#
Changing path to what we used on debian
[13:04] router1.place6:/etc/consul# vi /etc/conf.d/consul
[13:05] router1.place6:/etc/consul# cat /etc/conf.d/consul
# Consul startup
consul_opts="agent -config-dir=/etc/consul/conf.d"
[13:05] router1.place6:/etc/consul# /etc/init.d/consul start
* Caching service dependencies ... [ ok ]
* Checking /etc/consul ...
Config validation failed: Multiple private IPv4 addresses found. Please configure one with 'bind' and/or 'advertise'. [ !! ]
* /var/log/consul.log: creating file
* /var/log/consul.log: correcting owner
* Starting consul ... [ ok ]
[13:05] router1.place6:/etc/consul#
[13:06] router1.place6:/etc/consul# /etc/init.d/consul start
* Checking /etc/consul ...
Config validation failed: Multiple private IPv4 addresses found. Please configure one with 'bind' and/or 'advertise'. [ !! ]
* Starting consul ... [ ok ]
[13:06] router1.place6:/etc/consul# cat conf.d/config.json
{
"data_dir": "/var/lib/consul"
,"bind_addr": "2a0a:e5c0:2:15::5"
,"client_addr": "2a0a:e5c0:2:15::5 ::1 127.0.0.1"
,"datacenter": "place6"
,"disable_remote_exec": true
,"disable_update_check": true
,"encrypt": "xx=="
,"retry_join": ["black1.place6.ungleich.ch","black2.place6.ungleich.ch","black3.place6.ungleich.ch"]
}
[13:06] router1.place6:/etc/consul# consul --version
Consul 1.6.2
Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)
[13:06] router1.place6:/etc/consul#
Seem like old bind_addr
now supports interfaces - much nicer!
[13:25] router1.place6:/etc/consul# /etc/init.d/consul restart
* Stopping consul ... [ ok ]
* Checking /etc/consul ...
Config validation failed: Multiple private IPv4 addresses found. Please configure one with 'bind' and/or 'advertise'. [ !! ]
* Starting consul ... [ ok ]
[13:25] router1.place6:/etc/consul# mv conf.d/*json .
[13:25] router1.place6:/etc/consul# /etc/init.d/consul restart
* Stopping consul ... [ ok ]
* Checking /etc/consul ...
Configuration is valid! [ ok ]
* Starting consul ... [ ok ]
[13:25] router1.place6:/etc/consul#
However it does not work -- at the moment hard coded to the routers ipv6 address.
Also the conf.d change does not seem to work.