Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Upgrade Subsonic on Mac OS X
- hosts: all
gather_facts: no
vars:
- release_tag: "{{latest_release.stdout}}"
- repository: EugeneKay/subsonic
- war_name: subsonic-{{release_tag}}.war
- release_url: https://github.com/{{repository}}/releases/download/{{release_tag}}/{{war_name}}
- app_path: /Applications/Subsonic.app
- war_path: "{{app_path}}/Contents/Resources"
- jetty_cache_path: "/Library/Application Support/Subsonic/jetty"
tasks:
- name: find latest release
shell: curl -sSL 'https://api.github.com/repos/{{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}}
notify:
- remove jetty cache
- restart subsonic
- name: link new app
file: name={{war_path}}/subsonic.war src={{war_path}}/{{war_name}} state=link
notify:
- remove jetty cache
- restart subsonic
handlers:
- name: remove jetty cache
file: path={{jetty_cache_path}} state=absent
- name: restart subsonic
shell: pkill -f Subsonic; open -a Subsonic.app
@deluan

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