Skip to content

Instantly share code, notes, and snippets.

@melekes melekes/counter.systemd.j2
Last active Apr 24, 2017

Embed
What would you like to do?
Ansible playbook for ABCI counter app https://github.com/tendermint/abci/tree/master/cmd/counter
[Unit]
Description=Counter
Requires=network-online.target
After=network-online.target
[Service]
Environment=""
Restart=on-failure
User={{ user }}
Group={{ group }}
PermissionsStartOnly=true
ExecStart=/usr/local/bin/counter --addr="unix:///socks/app.sock"
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target
---
- hosts: all
handlers:
- name: reload systemd
become: true
command: systemctl daemon-reload
tasks:
- name: create log directory if it does not exist
file: >
state=directory
path=/socks
owner={{ user }}
group={{ group }}
- name: change file permissions
file: >
path=/usr/local/bin/counter
owner={{user}}
group={{group}}
mode=0755
- name: copy systemd script
template: >
src="counter.systemd.j2"
dest=/etc/systemd/system/counter.service
owner=root
group=root
mode=0644
notify:
- reload systemd
- service: >
name=counter
state=started
enabled=yes
vars:
user: tendermint
group: tendermint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.