Skip to content

Commit

Permalink
Ansible-lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JuezFenix committed Aug 16, 2024
1 parent af19cbd commit dbe9dfd
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions roles/rtorrent/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,34 @@
- "{{ rtorrent_home }}"

- name: Create and store passwd file

Check failure on line 11 in roles/rtorrent/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

no-changed-when

Commands should not change things if nothing needs doing.
shell: >
ansible.builtin.shell: |
docker run --rm

Check failure on line 13 in roles/rtorrent/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

yaml[trailing-spaces]

Trailing spaces
-v {{ rtorrent_passwd_directory }}:/passwd

Check failure on line 14 in roles/rtorrent/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

yaml[trailing-spaces]

Trailing spaces
httpd:2.4-alpine

Check failure on line 15 in roles/rtorrent/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

yaml[trailing-spaces]

Trailing spaces
htpasswd -Bb -c /passwd/rutorrent.htpasswd {{ rtorrent_user }} {{ rtorrent_passwd }}
- name: "Populate ruTorrent plugins folder"
- name: Populate ruTorrent plugins folder
tags: rtorrent_plugins
block:

- name: "Populate ruTorrent plugins folder: Validate dest field in rtorrent_plugins_repos"
assert:
ansible.builtin.assert:
that:
- item.dest is defined
- item.dest != ""
loop: "{{ rtorrent_plugins_repos }}"
failed_when: not item.dest
no_log: true

- name: "Populate ruTorrent plugins folder: Check if repository directory exists"
stat:
- name: Check if repository directory exists
ansible.builtin.stat:
path: "{{ rtorrent_plugins_destination_path }}/{{ item.dest }}"
register: update_repo_list
loop: "{{ rtorrent_plugins_repos }}"
loop_control:
loop_var: item

- name: "Populate ruTorrent plugins folder: Update repository if directory exists and no subfolder is defined"

Check failure on line 38 in roles/rtorrent/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

latest[git]

Result of the command may vary on subsequent runs.
git:
ansible.builtin.git:
repo: "{{ item.item.repo }}"
dest: "{{ rtorrent_plugins_destination_path }}/{{ item.item.dest }}"
update: yes
Expand All @@ -51,7 +50,7 @@
no_log: true

- name: "Populate ruTorrent plugins folder: Clone new rTorrent plugins repositories"

Check failure on line 52 in roles/rtorrent/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

latest[git]

Result of the command may vary on subsequent runs.
git:
ansible.builtin.git:
repo: "{{ item.item.repo }}"
dest: "{{ rtorrent_plugins_destination_path }}/{{ item.item.dest }}"
update: yes
Expand All @@ -65,7 +64,7 @@
no_log: true

- name: "Populate ruTorrent plugins folder: Clone new rTorrent multi plugins repositories"

Check failure on line 66 in roles/rtorrent/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

latest[git]

Result of the command may vary on subsequent runs.
git:
ansible.builtin.git:
repo: "{{ item.item.repo }}"
dest: "{{ rtorrent_plugins_destination_path }}/{{ item.item.dest }}_tmp"
update: yes
Expand All @@ -79,7 +78,7 @@
no_log: true

- name: "Populate ruTorrent plugins folder: Move subfolder content if 'subfolder' is true"
command: >
ansible.builtin.command: >
find "{{ rtorrent_plugins_destination_path }}/{{ item.item.dest }}_tmp"

Check failure on line 82 in roles/rtorrent/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

yaml[trailing-spaces]

Trailing spaces
-mindepth 1 -maxdepth 1

Check failure on line 83 in roles/rtorrent/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Lint

yaml[trailing-spaces]

Trailing spaces
! -name '.git'
Expand All @@ -92,10 +91,11 @@
loop: "{{ update_repo_list.results }}"
loop_control:
loop_var: item
changed_when: false
no_log: true

- name: "Populate ruTorrent plugins folder: Clean up temporary directories"
file:
ansible.builtin.file:
path: "{{ rtorrent_plugins_destination_path }}/{{ item.item.dest }}_tmp"
state: absent
when: (item.item.subfolder | default(false))
Expand All @@ -106,12 +106,11 @@

when: rtorrent_install_plugins is true

- name: "Populate ruTorrent themes folder"
- name: Populate ruTorrent themes folder
tags: rtorrent_themes
block:

- name: "Populate ruTorrent themes folder: Validate dest field in rtorrent_themes_repos"
assert:
ansible.builtin.assert:
that:
- item.dest is defined
- item.dest != ""
Expand All @@ -120,15 +119,15 @@
no_log: true

- name: "Populate ruTorrent themes folder: Check if theme directory exists"
stat:
ansible.builtin.stat:
path: "{{ rtorrent_themes_destination_path }}/{{ item.dest }}"
register: update_theme_list
loop: "{{ rtorrent_themes_repos }}"
loop_control:
loop_var: item

- name: "Populate ruTorrent themes folder: Update theme repository if directory exists and no subfolder is defined"
git:
ansible.builtin.git:
repo: "{{ item.item.repo }}"
dest: "{{ rtorrent_themes_destination_path }}/{{ item.item.dest }}"
update: yes
Expand All @@ -142,7 +141,7 @@
no_log: true

- name: "Populate ruTorrent themes folder: Clone new rTorrent themes repositories"
git:
ansible.builtin.git:
repo: "{{ item.item.repo }}"
dest: "{{ rtorrent_themes_destination_path }}/{{ item.item.dest }}"
update: yes
Expand All @@ -156,7 +155,7 @@
no_log: true

- name: "Populate ruTorrent themes folder: Clone new rTorrent multi themes repositories"
git:
ansible.builtin.git:
repo: "{{ item.item.repo }}"
dest: "{{ rtorrent_themes_destination_path }}/{{ item.item.dest }}_tmp"
update: yes
Expand All @@ -170,7 +169,7 @@
no_log: true

- name: "Populate ruTorrent themes folder: Move subfolder content if 'subfolder' is true"
command: >
ansible.builtin.command: >
find "{{ rtorrent_themes_destination_path }}/{{ item.item.dest }}_tmp"
-mindepth 1 -maxdepth 1
! -name '.git'
Expand All @@ -183,10 +182,11 @@
loop: "{{ update_theme_list.results }}"
loop_control:
loop_var: item
#no_log: true
changed_when: false
no_log: true

- name: "Populate ruTorrent themes folder: Clean up temporary directories"
file:
ansible.builtin.file:
path: "{{ rtorrent_themes_destination_path }}/{{ item.item.dest }}_tmp"
state: absent
when: (item.item.subfolder | default(false))
Expand All @@ -197,7 +197,7 @@

when: rtorrent_install_themes is true

- name: rtorrent Docker Container
- name: Create rtorrent Docker Container
community.docker.docker_container:
name: "{{ rtorrent_container_name }}"
image: "{{ rtorrent_image_name }}:{{ rtorrent_image_version }}"
Expand Down Expand Up @@ -228,7 +228,7 @@
homepage.href: "http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ rtorrent_port }}"
homepage.description: ruTorrent client

- name: "Install necessary packages for ruTorrent plugins"
- name: Install necessary packages for ruTorrent plugins
community.docker.docker_container_exec:
container: "{{ rtorrent_container_name }}"
command: |
Expand All @@ -241,7 +241,7 @@
no_log: true
when: rtorrent_install_plugins is true

- name: "Install rar packages for ruTorrent plugins"
- name: Install rar packages for ruTorrent plugins
community.docker.docker_container_exec:
container: "{{ rtorrent_container_name }}"
command: |
Expand All @@ -257,8 +257,8 @@

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

0 comments on commit dbe9dfd

Please sign in to comment.