Last active
April 24, 2017 13:28
-
-
Save melekes/3cda2237f9cb7d2d525677239a103338 to your computer and use it in GitHub Desktop.
Ansible playbook for ABCI counter app https://github.com/tendermint/abci/tree/master/cmd/counter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- 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