Skip to content

Instantly share code, notes, and snippets.

@ahmedbodi
Last active March 19, 2024 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmedbodi/f093f879b3c423dfa23291e85f6da191 to your computer and use it in GitHub Desktop.
Save ahmedbodi/f093f879b3c423dfa23291e85f6da191 to your computer and use it in GitHub Desktop.
---
- name: Create Gunbot Group
group:
name: gunbot
state: present
- name: Create Gunbot User
user:
name: "{{ item.name }}"
comment: "Gunbot {{ item.name }} User"
groups: gunbot
state: present
with_items: "{{ gunbot_instances }}"
- name: Download Gunthy Stable
ansible.builtin.unarchive:
src: https://gunthy.org/downloads/gunthy_linux.zip
dest: "/home/{{ item.name }}"
remote_src: true
with_items: "{{ gunbot_instances }}"
- name: Download Gunthy Beta
ansible.builtin.unarchive:
src: https://gunthy.org/downloads/beta/gunthy-linux.zip
dest: "/home/{{ item.name }}"
remote_src: true
with_items: "{{ gunbot_instances }}"
- name: Setup Systemd Scripts for gunbot_instances
template:
src: templates/systemd.conf.j2
dest: /lib/systemd/system/{{ item.name }}.service
owner: root
group: root
with_items: "{{ gunbot_instances }}"
- name: Reload systemd
systemd:
daemon_reload: yes
- name: Enable gubbot instances
systemd:
name: "{{ item.name }}"
enabled: yes
with_items: "{{ gunbot_instances }}"
- name: Restart gunbot instances
systemd:
state: restarted
name: "{{ item.name }}"
with_items: "{{ gunbot_instances }}"
# {{ ansible_managed }}
[Install]
WantedBy=multi-user.target
[Service]
ExecStart=/home/{{ item.name }}/gunthy-linux
KillSignal=SIGTERM
User={{ item.name }}
Group=gunbot
Restart=always
RestartSec=10
gunbot_instances:
- name: machinegun
- name: quantag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment