Last active
November 23, 2018 15:03
-
-
Save megaherz/c1401ac7ad5076a3d28db9aaa64f0c5a to your computer and use it in GitHub Desktop.
Ansible nats.io playbook
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: nats | |
sudo: yes | |
tasks: | |
- name: create nats directory | |
file: path=/srv/nats/bin state=directory | |
- name: unarchive gnats | |
unarchive: | |
src: https://github.com/nats-io/gnatsd/releases/download/v0.9.4/gnatsd-v0.9.4-linux-amd64.zip | |
dest: /srv/nats | |
copy: no | |
- name: copy gnatsd executable | |
command: mv /srv/nats/gnatsd-v0.9.4-linux-amd64/gnatsd /srv/nats/bin/gnatsd | |
- name: make gnatsd executable | |
file: path=/srv/nats/bin/gnatsd mode=0755 | |
- name: install nats systemd unit file | |
template: src=nats.service dest=/etc/systemd/system/nats.service | |
- name: start nats | |
service: name=nats state=started enabled=yes |
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=NATS messaging server | |
[Service] | |
ExecStart=/srv/nats/bin/gnatsd | |
Restart=on-failure | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment