bin/server/tasks/main.yaml
changeset 228 ff776d663062
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/server/tasks/main.yaml	Sat Feb 10 15:40:23 2024 -0600
@@ -0,0 +1,24 @@
+---
+
+- name: add bin user
+  become: yes
+  user: name="{{bin_user}}" shell="/bin/false" system="yes"
+
+- name: install bin binary
+  become: yes
+  get_url:
+    url: "{{bin_url}}"
+    dest: "/usr/local/bin/bin"
+    mode: "0755"
+  notify: restart service
+
+- name: install systemd service
+  become: yes
+  template:
+    src: "[email protected]"
+    dest: "/lib/systemd/system/[email protected]"
+  notify: restart service
+
+- name: ensure service is started
+  become: yes
+  systemd: name="bin@{{bin_port}}.service" enabled="yes" state="started"