Ver código fonte

add olivetin role

Blaine Story 2 dias atrás
pai
commit
8998010138

+ 48 - 0
roles/olivetin/files/config.yaml_chloe-test

@@ -0,0 +1,48 @@
+# There is a built-in micro proxy that will host the webui and REST API all on
+# one port (this is called the "Single HTTP Frontend") and means you just need
+# one open port in the container/firewalls/etc.
+#
+# Listen on all addresses available, port 1337
+listenAddressSingleHTTPFrontend: 0.0.0.0:1337
+
+# Choose from INFO (default), WARN and DEBUG
+logLevel: "INFO"
+
+# Checking for updates https://docs.olivetin.app/reference/updateChecks.html
+checkForUpdates: false
+
+# Docs: https://docs.olivetin.app/action_execution/create_your_first.html
+actions:
+  - title: Restart VPN
+    shell: nordvpn c
+    icon: <iconify-icon icon="gala:secure"></iconify-icon>
+    popupOnStart: execution-dialog-stdout-only
+
+
+  - title: Run SnapRAID Sync
+    shell: snapraid sync
+    maxConcurrent: 1
+    timeout: 6000
+    icon: backup
+    popupOnStart: execution-dialog
+
+
+  - title: Restart Application
+    icon: restart
+    shell: systemctl restart {{ container }}
+    arguments:
+      - name: container
+        title: Application name
+        choices:
+          - value: sickgear
+          - value: transmission
+          - value: qbittorrent
+
+
+  - title: Reboot Server
+    icon: ashtonished
+    shell: systemctl reboot
+    popupOnStart: default
+    arguments:
+      - type: confirmation
+        title: Are you sure?!

+ 5 - 0
roles/olivetin/handlers/main.yml

@@ -0,0 +1,5 @@
+---
+- name: Restart OliveTin
+  ansible.builtin.systemd_service:
+    name: OliveTin
+    state: restarted

+ 50 - 0
roles/olivetin/tasks/main.yml

@@ -0,0 +1,50 @@
+---
+- name: Set OliveTin package Name
+  ansible.builtin.set_fact:
+    olivetin: OliveTin_linux_amd64.{{ 'deb' if ansible_os_family == "Debian" else 'rpm' }}
+
+- name: Check for existing OliveTin package
+  ansible.builtin.stat:
+    path: /root/{{ olivetin }}
+  register: olivetin_pkg
+
+
+- name: Download OliveTin Package
+  ansible.builtin.get_url:
+    url: https://github.com/OliveTin/OliveTin/releases/latest/download/{{ olivetin }}
+    dest: /root/{{ olivetin }}
+  when:
+    - olivetin_pkg.stat.exists == False
+
+
+- name: Install OliveTin (Debian)
+  ansible.builtin.apt:
+    deb: /root/{{ olivetin }}
+    state: present
+  when:
+    - ansible_os_family == "Debian"
+
+
+- name: Install OliveTin (Fedora/CentOS)
+  ansible.builtin.dnf:
+    name: /root/{{ olivetin }}
+    state: present
+  when:
+    - ansible_os_family == "RedHat"
+
+
+- name: Configure OliveTin
+  ansible.builtin.copy:
+    src: config.yaml_{{ ansible_hostname }}
+    dest: /etc/OliveTin/config.yaml
+    owner: root
+    group: root
+    mode: '0644'
+  notify: Restart OliveTin
+
+
+- name: Start/Enable OliveTin
+  ansible.builtin.systemd_service:
+    name: OliveTin
+    state: started
+    enabled: yes