44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
---
|
|
|
|
- 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
|
|
shell: /usr/local/go/bin/go get -u github.com/FreifunkBremen/yanic
|
|
environment:
|
|
GOPATH: /opt/go
|
|
notify: Restart yanic
|
|
|
|
- name: Configure yanic
|
|
template: src=config.toml 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
|
|
template: 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
|
|
template: src={{ item }} 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
|