summaryrefslogtreecommitdiffstats
path: root/roles/bittorrent/tasks/update.yml
blob: 44a8498b6b0291623218f16542e9beb9440e84bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
- name: Récupération de la liste des torrents disponibles
  shell: torsocks curl -sS https://torrents.fedoraproject.org/torrents/ | grep torrent | grep -v Index | awk '{ print $6 }' | cut -d '"' -f2 | sed 's/.torrent//'
  args:
    executable: /usr/bin/zsh
  delegate_to: localhost
  register: namefedora

- name: Vérifier la présence de tous les torrents
  shell: transmission-remote -l | grep '{{ item }}'
  args:
    executable: /usr/bin/zsh
  with_items:
    - "{{ namefedora.stdout_lines }}"
  register: result
  ignore_errors: yes

- name: Mise à jour de transmission-daemon
  command: transmission-remote -a https://torrents.fedoraproject.org/torrents/'{{ item }}'.torrent
  with_items:
    - "{{ namefedora.stdout_lines }}"
  when: result is failed