From e49fcb7231d75b001e1d1767470fe03faabcddfe Mon Sep 17 00:00:00 2001 From: Matt Layher Date: Tue, 19 Apr 2016 21:14:30 -0400 Subject: [PATCH] subsonic: initial commit --- roles/subsonic/tasks/main.yml | 35 ++++++++++++++++++++++++++++ roles/subsonic/templates/subsonic.j2 | 9 +++++++ roles/subsonic/vars/main.yml | 4 ++++ servnerr.yml | 1 + 4 files changed, 49 insertions(+) create mode 100644 roles/subsonic/tasks/main.yml create mode 100644 roles/subsonic/templates/subsonic.j2 create mode 100644 roles/subsonic/vars/main.yml diff --git a/roles/subsonic/tasks/main.yml b/roles/subsonic/tasks/main.yml new file mode 100644 index 0000000..7973961 --- /dev/null +++ b/roles/subsonic/tasks/main.yml @@ -0,0 +1,35 @@ +--- +- name: install java runtime + tags: + - subsonic + apt: pkg=openjdk-7-jre state=installed + +- name: create subsonic user + tags: + - subsonic + user: name=subsonic shell=/bin/false comment="subsonic service user" + +- name: download and checksum subsonic debian package + tags: + - subsonic + get_url: url={{ subsonic_url }} dest={{ subsonic_deb }} checksum=sha256:{{ subsonic_sha256 }} + +- name: install subsonic + tags: + - subsonic + apt: deb={{ subsonic_deb }} state=installed + +- name: write subsonic configuration + tags: + - subsonic + template: src=subsonic.j2 dest=/etc/default/subsonic + +- name: restart subsonic service + tags: + - subsonic + service: name=subsonic state=restarted enabled=yes + +- name: remove temporary subsonic debian package + tags: + - subsonic + file: path={{ subsonic_deb }} state=absent diff --git a/roles/subsonic/templates/subsonic.j2 b/roles/subsonic/templates/subsonic.j2 new file mode 100644 index 0000000..b7a5a86 --- /dev/null +++ b/roles/subsonic/templates/subsonic.j2 @@ -0,0 +1,9 @@ +# {{ ansible_managed }} +# subsonic configuration, Matt Layher, 2016-04-19 + +{% if subsonic_args is defined %} +SUBSONIC_ARGS="{{ subsonic_args }}" +{% else %} +SUBSONIC_ARGS="--max-memory=150" +{% endif %} +SUBSONIC_USER="subsonic" diff --git a/roles/subsonic/vars/main.yml b/roles/subsonic/vars/main.yml new file mode 100644 index 0000000..ca404dc --- /dev/null +++ b/roles/subsonic/vars/main.yml @@ -0,0 +1,4 @@ +--- +subsonic_url: "http://subsonic.org/download/subsonic-5.3.deb" +subsonic_deb: "/tmp/subsonic.deb" +subsonic_sha256: "ff161159e5a3ae7f70e79cba59c3321b1889efbfad101ecb1eadf7ed4f47125a" diff --git a/servnerr.yml b/servnerr.yml index 8244710..efc1d7c 100644 --- a/servnerr.yml +++ b/servnerr.yml @@ -7,3 +7,4 @@ - plex - prometheus - rtorrent + - subsonic