Skip to content

Instantly share code, notes, and snippets.

@cgswong
Created January 22, 2015 13:57
Show Gist options
  • Save cgswong/5716fddbcfb76628faa1 to your computer and use it in GitHub Desktop.
Save cgswong/5716fddbcfb76628faa1 to your computer and use it in GitHub Desktop.
Consul discovery service for running Consul server via fleetctl command within unit file (still work in progress as this is not working)
- name: consul-discovery.service
command: start
content: |
[Unit]
Description=Enable the consul bootstrap process
# Requirements
Requires=docker.service
Requires=fleet.service
# Dependency ordering and binding
After=docker.service
After=fleet.service
ConditionFileNotEmpty=/etc/systemd/system/[email protected]
[Service]
# Get CoreOS environmental variables
EnvironmentFile=/etc/environment
ExecStart=/usr/bin/fleetctl start $(eval echo "consul-server@{1..3}.service")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment