Browse Source

move helper program to libexec, upgrade to latest version and provide default ACL config

master
parent
commit
0dc2bf20c7
  1. 2
      consul/consul-openpkg-service.c
  2. 5
      consul/consul.hcl
  3. 9
      consul/consul.spec

2
consul/consul-openpkg-service.c

@ -6,7 +6,7 @@
#define COS_BINDIR "@l_prefix@/bin"
#define COS_SBINDIR "@l_prefix@/bin"
#define COS_BIN "@l_prefix@/sbin/consul-openpkg-service.sh"
#define COS_BIN "@l_prefix@/libexec/consul/consul-openpkg-service.sh"
int main(int argn, char **argv)
{

5
consul/consul.hcl

@ -35,3 +35,8 @@ ui = true
disable_update_check = true
enable_script_checks = true
acl_datacenter = "dc1"
acl_master_token = "@token@"
acl_default_policy = "allow"
acl_down_policy = "extend-cache"

9
consul/consul.spec

@ -24,7 +24,7 @@
# package version
%define V_consul_opkg 1.1.0
%define V_consul_base 1.1.0
%define V_consul_snap 20180529
%define V_consul_snap 20180531
# package information
Name: consul
@ -37,7 +37,7 @@ Class: EVAL
Group: Networking
License: MPL
Version: %{V_consul_opkg}.%{V_consul_snap}
Release: 20180529
Release: 20180531
# list of sources
Source0: http://download.openpkg.org/components/versioned/consul/consul-%{V_consul_snap}.tar.xz
@ -96,6 +96,7 @@ PreReq: OpenPKG, openpkg >= 20160101
# create directory hierarchy
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/sbin \
$RPM_BUILD_ROOT%{l_prefix}/libexec/consul \
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
$RPM_BUILD_ROOT%{l_prefix}/etc/consul \
$RPM_BUILD_ROOT%{l_prefix}/var/consul/log \
@ -109,8 +110,10 @@ PreReq: OpenPKG, openpkg >= 20160101
# install configuration files
key=`src/github.com/hashicorp/consul/bin/consul keygen`
token=`uuid -v4`
%{l_shtool} install -c -m 644 %{l_value -s -a} \
-e "s;@key@;$key;g" \
-e "s;@token@;$token;g" \
%{SOURCE consul.hcl} \
$RPM_BUILD_ROOT%{l_prefix}/etc/consul/
@ -120,7 +123,7 @@ PreReq: OpenPKG, openpkg >= 20160101
$RPM_BUILD_ROOT%{l_prefix}/sbin/
%{l_shtool} install -c -m 755 %{l_value -s -a} \
%{SOURCE consul-openpkg-service.sh} \
$RPM_BUILD_ROOT%{l_prefix}/sbin/
$RPM_BUILD_ROOT%{l_prefix}/libexec/consul/
# install run-command script
%{l_shtool} install -c -m 755 %{l_value -s -a} \

Loading…
Cancel
Save