RPM Spec for Consul
Originally forked from CiscoCloud/consul-rpm and modified for the ENA environment.
Building
The RPMs may be built with Docker, Vagrant, or manual.
Whatever way you choose you will need to do a few basic things first.
git clone https://github.com/myENA/consul-rpm ## check out this code
cd consul-rpm ## uhh... you should know
mkdir -p artifacts ## prep the artifacts location
With Docker
docker build -t ena/consul-rpm . ## build the image
docker run -v $PWD/artifacts:/tmp/artifacts -it ena/consul-rpm ## run the image and build the RPMs
With Vagrant
vagrant up ## provision and build the RPMs
Manual
cat build.sh ## read the script
Result
Five RPMs will be copied to the artifacts
folder:
consul-<version>-<release>.rpm
- The binary and systemd service definition (required)consul-checks-<version>-<release>.rpm
- Example check scripts (optional)consul-config-<version>-<release>.rpm
- Example agent configuration (recommended)consul-services-<version>-<release>.rpm
- Example service definitions (optional)consul-webui-<version>-<release>.rpm
- Web UI files (optional - latest consul includes these in binary)
Running
- Install the RPM(s) that you need
- Review and edit (if needed)
/etc/sysconfig/consul
and associated config under/etc/consul.d/*
(config package) - Start the service and tail the logs:
systemctl start consul.service
andjournalctl -f --no-pager -u consul
- Optionally start on reboot with:
systemctl enable consul.service
Configuring
Config files are loaded in lexicographical order from the config-dir
specified in /etc/sysconfig/consul
(config package).
You may modify and/or add to the provided configuration as needed.
Further reading
See the consul.io website.