ansible-ffrgb/roles/yanic/tasks/main.yml

44 lines
1.1 KiB
YAML
Raw Normal View History

---
- name: Create users
user: name=yanic generate_ssh_key=yes ssh_key_type=rsa ssh_key_file=.ssh/id_rsa ssh_key_comment="yanic@{{inventory_hostname}}"
- name: Install yanic
2017-11-09 21:31:39 +01:00
shell: /usr/local/go/bin/go get -u github.com/FreifunkBremen/yanic
environment:
GOPATH: /opt/go
notify: Restart yanic
- name: Configure yanic
2017-11-09 21:44:38 +01:00
template: src=config.toml.j2 dest=/etc/yanic.conf
notify: Restart yanic
- name: Create directories
file: path={{ item }}/ state=directory owner=yanic
with_items:
- "{{ yanic_meshviewer_path }}"
- /var/lib/yanic
- name: Install system unit
2017-11-09 21:44:38 +01:00
copy: src=yanic.service dest=/lib/systemd/system/yanic.service
notify:
- Reload systemd
- Restart yanic
- name: Enable yanic
service: name=yanic enabled=yes
- name: Install system publish unit
2017-11-09 21:44:38 +01:00
template: src={{ item }}.j2 dest=/lib/systemd/system/{{ item }}
when: yanic_publisher
with_items:
- yanic-publish.service
- yanic-publish.timer
notify:
- Reload systemd
- Restart yanic-publish
- name: Enable yanic-publish
service: name=yanic-publish.timer enabled=yes
when: yanic_publisher