38 lines
858 B
YAML
38 lines
858 B
YAML
---
|
|
- name: create system user
|
|
user:
|
|
name: "{{ yanic_user }}"
|
|
home: "{{ yanic_home }}"
|
|
shell: /bin/false
|
|
|
|
- name: create source directory
|
|
file:
|
|
path: "{{ gopath }}/src/{{ yanic_dst }}"
|
|
state: directory
|
|
|
|
- name: clone repository
|
|
git:
|
|
repo: "https://{{ yanic_src }}"
|
|
dest: "{{ gopath }}/src/{{ yanic_dst }}"
|
|
version: "{{ yanic_version }}"
|
|
force: true
|
|
|
|
- name: ensure dependencies
|
|
shell: "cd {{ gopath }}/src/{{ yanic_dst }} && {{ gopath }}/bin/dep ensure"
|
|
environment:
|
|
GOPATH: "{{ gopath }}"
|
|
|
|
- name: build binary
|
|
shell: 'go install {{ gopath }}/src/{{ yanic_dst }}'
|
|
environment:
|
|
GOPATH: "{{ gopath }}"
|
|
notify:
|
|
- restart respondd
|
|
- restart yanic
|
|
|
|
- name: configure yanic
|
|
include_tasks: yanic.yml
|
|
when: server_type == "monitoring"
|
|
|
|
- name: configure respondd
|
|
include_tasks: respondd.yml
|