Role service-yanic: use golang dep util

This commit is contained in:
Julian Labus 2019-01-14 22:24:20 +01:00
parent 8670f113ff
commit 28ba57aa49
No known key found for this signature in database
GPG Key ID: 8AF209F2C6B3572A
2 changed files with 16 additions and 1 deletions

View File

@ -4,3 +4,4 @@ yanic_home: "/var/lib/yanic"
yanic_path: "{{ gopath }}/bin/yanic"
yanic_config: "/etc/yanic.conf"
yanic_database: "yanic"
yanic_src: "github.com/FreifunkBremen/yanic"

View File

@ -33,8 +33,22 @@
dest: "/etc/systemd/system/yanic.service"
notify: reload systemd
- name: create Yanic source directory
file:
path: "{{ gopath }}/src/{{ yanic_src }}"
state: directory
- name: clone Yanic repository
git:
repo: "https://{{ yanic_src }}"
dest: "{{ gopath }}/src/{{ yanic_src }}"
force: true
- name: get required library versions
shell: "cd {{ gopath }}/src/{{ yanic_src }} && GOPATH={{ gopath }} {{ gopath }}/bin/dep ensure"
- name: build Yanic binary
shell: "GOPATH={{ gopath }} go get -v -u github.com/FreifunkBremen/yanic"
shell: 'GOPATH={{ gopath }} go install {{ gopath }}/src/{{ yanic_src }}'
notify: restart yanic
- name: configure Yanic systemd unit