added new roles

This commit is contained in:
pyrschtjag committed 2026-10-18 12:34:19 +04:00
1 parent d10d28a0d7
commit 04bfb22e48
73 files changed
+990 -96

No files matched your search

+22 -46
View File
@@ -75,7 +75,7 @@
name: rtorrent
group: rtorrent
groups: media
append: yes
append: true
system: true
shell: /usr/sbin/nologin
home: /var/lib/rtorrent
@@ -86,7 +86,7 @@
ansible.builtin.user:
name: www-data
groups: rtorrent
append: yes
append: true
notify: restart apache
- name: ensure rtorrent data directory exists
@@ -169,7 +169,7 @@
group: rtorrent
recurse: true
- name: ensure ansible remote tmp dir exists
- name: ensure ansible remote tmp directory exists
ansible.builtin.file:
path: /tmp/.ansible-www-data
state: directory
@@ -177,16 +177,6 @@
group: www-data
mode: "0700"
- name: check current rutorrent git remote
ansible.builtin.command: git -C /var/www/html remote get-url origin
become: yes
become_user: www-data
register: current_remote
failed_when: false
changed_when: false
vars:
ansible_remote_tmp: /tmp/.ansible-www-data
- name: get latest rutorrent release info
ansible.builtin.uri:
url: "https://api.github.com/repos/Novik/ruTorrent/releases/latest"
@@ -205,47 +195,33 @@
changed_when: false
failed_when: false
- name: ensure html share directory is a mountpoint
ansible.builtin.command: mountpoint -q /var/www/html/share
register: share_mountpoint
failed_when: false
changed_when: false
- name: unmount rutorrent share directory before update
ansible.posix.mount:
path: /var/www/html/share
state: unmounted
when:
- share_mountpoint.rc == 0
- rutorrent_version not in (rutorrent_current_version.stdout | default(''))
- name: remove irrelevant html directory
ansible.builtin.file:
path: /var/www/html
state: absent
when:
- current_remote.rc is defined
- current_remote.rc != 0
- rutorrent_version not in (rutorrent_current_version.stdout | default(''))
- name: display rutorrent version info
ansible.builtin.debug:
msg: "latest version: {{ rutorrent_version }}, installed version: {{ rutorrent_current_version.stdout | default('not installed', true) }}"
- name: clone rutorrent
ansible.builtin.git:
repo: "https://github.com/Novik/ruTorrent.git"
dest: "/var/www/html"
version: "v{{ rutorrent_version }}"
force: yes
when: rutorrent_version not in (rutorrent_current_version.stdout | default(''))
- name: set rutorrent directory ownership
- name: ensure rutorrent directory exists
ansible.builtin.file:
path: /var/www/html
state: directory
owner: www-data
group: www-data
recurse: yes
mode: "0755"
- name: remove leftover git metadata from rutorrent directory
ansible.builtin.file:
path: /var/www/html/.git
state: absent
- name: install rutorrent release
ansible.builtin.unarchive:
src: "https://github.com/Novik/ruTorrent/archive/refs/tags/v{{ rutorrent_version }}.tar.gz"
dest: /var/www/html
remote_src: true
owner: www-data
group: www-data
extra_opts:
- --strip-components=1
- "--exclude=ruTorrent-{{ rutorrent_version }}/share"
when: rutorrent_version not in (rutorrent_current_version.stdout | default(''))
- name: remove default share directory
@@ -16,6 +16,6 @@
SetHandler "proxy:unix:/run/php/php{{ php_version.stdout }}-fpm.sock|fcgi://localhost"
</FilesMatch>
ProxyPass /RPC2 scgi://unix:/run/rtorrent/rpc.sock|
ProxyPassReverse /RPC2 scgi://unix:/run/rtorrent/rpc.sock|
ProxyPass /RPC2 unix:/run/rtorrent/rpc.sock|scgi://localhost
ProxyPassReverse /RPC2 unix:/run/rtorrent/rpc.sock|scgi://localhost
</VirtualHost>