Skip to content

Commit

Permalink
And more ansible-lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JuezFenix committed Aug 16, 2024
1 parent 2821f5a commit 34d8acb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
3 changes: 3 additions & 0 deletions roles/rtorrent/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,19 @@ rtorrent_install_themes: false
rtorrent_plugins_repos:
- repo: "https://github.com/autodl-community/autodl-rutorrent.git"
dest: "autodl"
tag: "latest"
- repo: "https://github.com/Ac3sRwild/ruTorrent-plugins.git"
dest: "ruTorrent-plugins"
subfolder: true
tag: "latest"

rtorrent_plugins_destination_path: "{{ rtorrent_data_directory }}/rutorrent/plugins"

# themes
rtorrent_themes_repos:
- repo: "https://github.com/norjms/3rd-Party-rutorrent-themes"
dest: "rutorrent-themes"
tag: "latest"
subfolder: true

rtorrent_themes_destination_path: "{{ rtorrent_data_directory }}/rutorrent/themes"

Check failure on line 49 in roles/rtorrent/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Lint

yaml[new-line-at-end-of-file]

No new line character at the end of file
30 changes: 12 additions & 18 deletions roles/rtorrent/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
- name: Start rtorrent
when: rtorrent_enabled is true
block:
- name: Create rtorrent Directories
ansible.builtin.file:
Expand Down Expand Up @@ -38,6 +39,7 @@
ansible.builtin.git:
repo: "{{ item.item.repo }}"
dest: "{{ rtorrent_plugins_destination_path }}/{{ item.item.dest }}"
version: "{{ item.item.tag | default('latest') }}"
update: yes
recursive: yes
when:
Expand All @@ -52,6 +54,7 @@
ansible.builtin.git:
repo: "{{ item.item.repo }}"
dest: "{{ rtorrent_plugins_destination_path }}/{{ item.item.dest }}"
version: "{{ item.item.tag | default('latest') }}"
update: yes
recursive: yes
when:
Expand All @@ -66,6 +69,7 @@
ansible.builtin.git:
repo: "{{ item.item.repo }}"
dest: "{{ rtorrent_plugins_destination_path }}/{{ item.item.dest }}_tmp"
version: "{{ item.item.tag | default('latest') }}"
update: yes
recursive: yes
when:
Expand All @@ -78,13 +82,8 @@

- name: Move subfolder content if 'subfolder' is true
ansible.builtin.command: >
find "{{ rtorrent_plugins_destination_path }}/{{ item.item.dest }}_tmp"
-mindepth 1 -maxdepth 1
! -name '.git'
! -name '.gitattributes'
! -name 'src'
! -name 'LICENSE'
! -name 'README.md'
find "{{ rtorrent_plugins_destination_path }}/{{ item.item.dest }}_tmp" -mindepth 1 -maxdepth 1 ! -name '.git' \
! -name '.gitattributes' ! -name 'src' ! -name 'LICENSE' ! -name 'README.md' \
-exec mv -f -t "{{ rtorrent_plugins_destination_path }}" {} +
when: (item.item.subfolder | default(false))
loop: "{{ update_repo_list.results }}"
Expand Down Expand Up @@ -128,6 +127,7 @@
ansible.builtin.git:
repo: "{{ item.item.repo }}"
dest: "{{ rtorrent_themes_destination_path }}/{{ item.item.dest }}"
version: "{{ item.item.tag | default('latest') }}"
update: yes
recursive: yes
when:
Expand All @@ -142,6 +142,7 @@
ansible.builtin.git:
repo: "{{ item.item.repo }}"
dest: "{{ rtorrent_themes_destination_path }}/{{ item.item.dest }}"
version: "{{ item.item.tag | default('latest') }}"
update: yes
recursive: yes
when:
Expand All @@ -156,6 +157,7 @@
ansible.builtin.git:
repo: "{{ item.item.repo }}"
dest: "{{ rtorrent_themes_destination_path }}/{{ item.item.dest }}_tmp"
version: "{{ item.item.tag | default('latest') }}"
update: yes
recursive: yes
when:
Expand All @@ -168,13 +170,8 @@

- name: Move subfolder content if 'subfolder' is true
ansible.builtin.command: >
find "{{ rtorrent_themes_destination_path }}/{{ item.item.dest }}_tmp"
-mindepth 1 -maxdepth 1
! -name '.git'
! -name '.gitattributes'
! -name 'src'
! -name 'LICENSE'
! -name 'README.md'
find "{{ rtorrent_themes_destination_path }}/{{ item.item.dest }}_tmp" -mindepth 1 -maxdepth 1 ! -name '.git' \
! -name '.gitattributes' ! -name 'src' ! -name 'LICENSE' ! -name 'README.md' \
-exec mv -f -t "{{ rtorrent_themes_destination_path }}" {} +
when: (item.item.subfolder | default(false))
loop: "{{ update_theme_list.results }}"
Expand Down Expand Up @@ -250,13 +247,10 @@
no_log: true
when: rtorrent_install_plugins is true

when: rtorrent_enabled is true

- name: Stop rtorrent
when: rtorrent_enabled is false
block:
- name: Stop rtorrent container
community.docker.docker_container:
name: "{{ rtorrent_container_name }}"
state: absent
when: rtorrent_enabled is false

0 comments on commit 34d8acb

Please sign in to comment.