2018-08-28 22:55:21 +00:00
|
|
|
- name: Install packages transmission-daemon and transmission-cli
|
2018-08-16 09:36:45 +00:00
|
|
|
package:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: present
|
|
|
|
with_items:
|
|
|
|
- transmission-daemon
|
|
|
|
- transmission-cli
|
|
|
|
|
2018-08-28 22:55:21 +00:00
|
|
|
- name: Create /library/transmission download directory
|
2018-08-28 22:05:14 +00:00
|
|
|
file:
|
|
|
|
path: "{{ transmission_download_dir }}"
|
|
|
|
owner: "{{ transmission_user }}"
|
|
|
|
group: "{{ transmission_group }}"
|
|
|
|
mode: 0755
|
|
|
|
state: directory
|
|
|
|
|
2018-08-28 21:47:05 +00:00
|
|
|
- name: Stop transmission-daemon before modifying its settings
|
|
|
|
systemd:
|
2018-08-16 18:54:55 +00:00
|
|
|
name: transmission-daemon
|
|
|
|
state: stopped
|
2018-08-28 21:47:05 +00:00
|
|
|
ignore_errors: yes
|
2018-08-16 18:54:55 +00:00
|
|
|
|
2018-08-28 21:47:05 +00:00
|
|
|
- name: Create transmission-daemon settings
|
2018-08-16 18:54:55 +00:00
|
|
|
template:
|
2018-08-28 21:47:05 +00:00
|
|
|
src: settings.json.j2
|
|
|
|
dest: /etc/transmission-daemon/settings.json
|
|
|
|
mode: 0644
|
2018-08-20 08:51:47 +00:00
|
|
|
owner: "{{ transmission_user }}"
|
|
|
|
group: "{{ transmission_group }}"
|
2018-08-16 18:54:55 +00:00
|
|
|
|
2018-08-28 21:47:05 +00:00
|
|
|
- name: Enable and Restart transmission-daemon service
|
|
|
|
systemd:
|
2018-08-16 18:54:55 +00:00
|
|
|
name: transmission-daemon
|
2018-08-28 21:47:05 +00:00
|
|
|
daemon_reload: yes
|
2018-08-16 18:54:55 +00:00
|
|
|
enabled: yes
|
2018-08-28 21:47:05 +00:00
|
|
|
state: restarted
|
2018-08-16 18:54:55 +00:00
|
|
|
when: transmission_enabled
|
|
|
|
|
2018-08-31 06:57:23 +00:00
|
|
|
- name: Add PAUSED KA Lite torrent(s) to transmission-daemon's queue
|
2018-08-29 02:53:45 +00:00
|
|
|
shell: >
|
|
|
|
/usr/bin/transmission-remote
|
2018-08-31 06:44:40 +00:00
|
|
|
--start-paused
|
2018-08-29 02:53:45 +00:00
|
|
|
-n {{ transmission_username }}:{{ transmission_password }}
|
|
|
|
-a http://pantry.learningequality.org/downloads/ka-lite/{{ transmission_kalite_version }}/content/ka-lite-0.17-resized-videos-{{ item }}.torrent
|
2018-08-17 15:40:48 +00:00
|
|
|
with_items: "{{ transmission_kalite_languages }}"
|
2018-08-16 18:54:55 +00:00
|
|
|
ignore_errors: yes
|
|
|
|
when: transmission_provision
|
|
|
|
|
2018-08-28 21:47:05 +00:00
|
|
|
- name: Disable transmission-daemon service
|
|
|
|
systemd:
|
2018-08-18 04:26:19 +00:00
|
|
|
name: transmission-daemon
|
2018-08-28 21:47:05 +00:00
|
|
|
daemon_reload: yes
|
2018-08-18 04:26:19 +00:00
|
|
|
enabled: no
|
|
|
|
state: stopped
|
|
|
|
when: not transmission_enabled
|
|
|
|
|
2018-08-16 09:36:45 +00:00
|
|
|
- name: Add transmission to list of services at /etc/iiab/iiab.ini
|
|
|
|
ini_file:
|
|
|
|
dest: "{{ service_filelist }}"
|
|
|
|
section: transmission
|
|
|
|
option: "{{ item.option }}"
|
|
|
|
value: "{{ item.value }}"
|
|
|
|
with_items:
|
|
|
|
- option: name
|
|
|
|
value: transmission
|
|
|
|
- option: description
|
|
|
|
value: '"Transmission is a set of lightweight BitTorrent clients (in GUI, CLI and daemon form)."'
|
|
|
|
- option: transmission_install
|
|
|
|
value: "{{ transmission_install }}"
|
2018-08-28 22:39:35 +00:00
|
|
|
- option: transmission_enabled
|
|
|
|
value: "{{ transmission_enabled }}"
|
|
|
|
- option: transmission_download_dir
|
|
|
|
value: "{{ transmission_download_dir }}"
|
|
|
|
- option: transmission_user
|
|
|
|
value: "{{ transmission_user }}"
|
|
|
|
- option: transmission_group
|
|
|
|
value: "{{ transmission_group }}"
|
2018-08-28 22:50:05 +00:00
|
|
|
- option: transmission_http_port
|
|
|
|
value: "{{ transmission_http_port }}"
|
|
|
|
- option: transmission_url
|
|
|
|
value: "{{ transmission_url }}"
|
|
|
|
- option: transmission_peer_port
|
|
|
|
value: "{{ transmission_peer_port }}"
|
2018-08-28 22:39:35 +00:00
|
|
|
- option: transmission_provision
|
|
|
|
value: "{{ transmission_provision }}"
|
|
|
|
- option: transmission_kalite_version
|
|
|
|
value: "{{ transmission_kalite_version }}"
|
|
|
|
- option: transmission_kalite_languages
|
|
|
|
value: "{{ transmission_kalite_languages }}"
|
|
|
|
- option: transmission_username
|
|
|
|
value: "{{ transmission_username }}"
|
|
|
|
- option: transmission_password
|
|
|
|
value: "{{ transmission_password }}"
|