Last active
March 19, 2024 01:53
-
-
Save ahmedbodi/f093f879b3c423dfa23291e85f6da191 to your computer and use it in GitHub Desktop.
This file contains 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
--- | |
- 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 }}" |
This file contains 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
# {{ 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 |
This file contains 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
gunbot_instances: | |
- name: machinegun | |
- name: quantag |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment