Last active
February 20, 2016 19:42
-
-
Save deluan/aeb28794e9981a345ee4 to your computer and use it in GitHub Desktop.
Upgrade Subsonic on Mac OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run with:
ansible-playbook subsonic_upgrade.yml -i server_address,