## Summary - Add pre-commit framework with hooks for YAML, Ansible, Python, shell, TOML, JSON, and secret detection - Fix all 91+ ansible-lint violations (variable naming, handler capitalization, changed_when) - Fix shellcheck warnings in mise-tasks scripts - Document pre-commit setup in README.md ## Deployment and Testing - [x] All pre-commit hooks pass (`uvx pre-commit run --all-files`) - [x] Test ansible playbook with `--check` mode - [x] Run `mise run indri-services-check` after deploy 🤖 Generated with [Claude Code](https://claude.com/claude-code) Reviewed-on: https://forge.tail8d86e.ts.net/eblume/blumeops/pulls/19
52 lines
1.6 KiB
YAML
52 lines
1.6 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: '0600'
|
|
check_mode: true
|
|
register: transmission_settings_check
|
|
|
|
- name: Stop transmission before config changes
|
|
ansible.builtin.command: brew services stop transmission-cli
|
|
when: transmission_settings_check.changed
|
|
register: transmission_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: '0600'
|
|
notify: Restart transmission
|
|
|
|
- name: Ensure transmission service is started
|
|
ansible.builtin.command: brew services start transmission-cli
|
|
register: transmission_brew_start
|
|
changed_when: "'Successfully started' in transmission_brew_start.stdout"
|
|
failed_when: false
|