Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Upgrade Subsonic on Mac OS X
- hosts: all
gather_facts: no
- release_tag: "{{latest_release.stdout}}"
- repository: EugeneKay/subsonic
- war_name: subsonic-{{release_tag}}.war
- release_url:{{repository}}/releases/download/{{release_tag}}/{{war_name}}
- app_path: /Applications/
- war_path: "{{app_path}}/Contents/Resources"
- jetty_cache_path: "/Library/Application Support/Subsonic/jetty"
- name: find latest release
shell: curl -sSL '{{repository}}/releases' | /usr/local/bin/jq '.[0].tag_name' | tr -d '"'
changed_when: False
register: latest_release
- debug: var=latest_release.stdout
- name: download new version
get_url: url={{release_url}} dest={{war_path}}
- remove jetty cache
- restart subsonic
- name: link new app
file: name={{war_path}}/subsonic.war src={{war_path}}/{{war_name}} state=link
- remove jetty cache
- restart subsonic
- name: remove jetty cache
file: path={{jetty_cache_path}} state=absent
- name: restart subsonic
shell: pkill -f Subsonic; open -a

This comment has been minimized.

Copy link
Owner Author

@deluan deluan commented Feb 20, 2016

Run with:
ansible-playbook subsonic_upgrade.yml -i server_address,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment