ansible-ffibk/roles/service-yanic/tasks/main.yml

39 lines
858 B
YAML
Raw Permalink Normal View History

2018-09-11 14:20:44 +02:00
---
2019-05-02 16:00:02 +02:00
- name: create system user
2018-09-11 14:20:44 +02:00
user:
name: "{{ yanic_user }}"
home: "{{ yanic_home }}"
shell: /bin/false
2019-05-02 16:00:02 +02:00
- name: create source directory
file:
path: "{{ gopath }}/src/{{ yanic_dst }}"
state: directory
2019-05-02 16:00:02 +02:00
- name: clone repository
git:
repo: "https://{{ yanic_src }}"
dest: "{{ gopath }}/src/{{ yanic_dst }}"
version: "{{ yanic_version }}"
force: true
2019-05-02 16:00:02 +02:00
- name: ensure dependencies
shell: "cd {{ gopath }}/src/{{ yanic_dst }} && {{ gopath }}/bin/dep ensure"
environment:
GOPATH: "{{ gopath }}"
2019-05-02 16:00:02 +02:00
- name: build binary
shell: 'go install {{ gopath }}/src/{{ yanic_dst }}'
environment:
GOPATH: "{{ gopath }}"
notify:
- restart respondd
- restart yanic
2018-09-11 14:20:44 +02:00
2019-05-02 16:00:02 +02:00
- name: configure yanic
include_tasks: yanic.yml
when: server_type == "monitoring"
- name: configure respondd
include_tasks: respondd.yml