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_path: "{{ gopath }}/bin/yanic"
yanic_config: "/etc/yanic.conf" yanic_config: "/etc/yanic.conf"
yanic_database: "yanic" yanic_database: "yanic"
yanic_src: "github.com/FreifunkBremen/yanic"

View file

@ -33,8 +33,22 @@
dest: "/etc/systemd/system/yanic.service" dest: "/etc/systemd/system/yanic.service"
notify: reload systemd 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 - 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 notify: restart yanic
- name: configure Yanic systemd unit - name: configure Yanic systemd unit