blumeops/ansible/roles/transmission/tasks/main.yml
Erich Blume 4add1684c3 Enable additional ZIM archives for kiwix
New archives (~95G total):
- Project Gutenberg 2023 (72G) - 60,000+ public domain books
- iFixit (3.3G) - Repair guides
- Stack Exchange: SuperUser (3.7G), Math (6.9G)
- LibreTexts: Biology, Chemistry, Engineering, Mathematics, Physics, Humanities

Also:
- Fix transmission to only restart when config changes
- Update CLAUDE.md to use full ansible paths

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 12:47:54 -08:00

52 lines
1.5 KiB
YAML

---
- name: Install transmission-cli via homebrew
community.general.homebrew:
name: transmission-cli
state: present
- name: Ensure transmission download directory exists
ansible.builtin.file:
path: "{{ transmission_download_dir }}"
state: directory
mode: '0755'
- name: Ensure transmission incomplete directory exists
ansible.builtin.file:
path: "{{ transmission_incomplete_dir }}"
state: directory
mode: '0755'
- name: Remove old config directory (was deployed to wrong location)
ansible.builtin.file:
path: ~/.config/transmission-daemon
state: absent
# Note: transmission must be stopped before modifying settings.json
# otherwise it may overwrite our changes on shutdown
- name: Check if settings.json needs updating
ansible.builtin.template:
src: settings.json.j2
dest: "{{ transmission_config_dir }}/settings.json"
mode: '0644'
check_mode: true
register: settings_check
- name: Stop transmission before config changes
ansible.builtin.command: brew services stop transmission-cli
when: settings_check.changed
register: brew_stop
changed_when: false
failed_when: false
- name: Deploy transmission settings.json
ansible.builtin.template:
src: settings.json.j2
dest: "{{ transmission_config_dir }}/settings.json"
mode: '0644'
notify: restart transmission
- name: Ensure transmission service is started
ansible.builtin.command: brew services start transmission-cli
register: brew_start
changed_when: "'Successfully started' in brew_start.stdout"
failed_when: false