ansible/roles/rtty/tasks/main.yml

66 lines
1.5 KiB
YAML
Raw Normal View History

---
- name: Gather instance facts
setup:
- name: Update APT package cache
apt:
update_cache: "true"
cache_valid_time: "3600"
tags:
- rtty-install
- name: Install dependencies
package:
name: "{{ packages }}"
state: present
vars:
packages:
- libev4
- build-essential
- cmake
- libev-dev
- libssl-dev
tags:
- rtty-install
- block:
- name: Clone Sources
shell:
cmd: git clone --recursive https://github.com/zhaojh329/rtty.git /opt/rtty
creates: /opt/rtty/.git
tags:
- rtty-install
- name: Update sources
shell:
cmd: git pull
chdir: /opt/rtty
tags:
- rtty-install
- name: Prep sources
shell:
cmd: mkdir /opt/rtty/build
creates: /opt/rtty/build
tags:
- rtty-install
- name: Build sources
shell: |
cd /opt/rtty/build && \
cmake .. && \
make install
tags:
- rtty-install
- block:
- name: Setup rtty service
template:
src: rtty.service
dest: "/etc/systemd/system/rtty.service"
owner: root
group: root
mode: 0600
notify:
- restart rtty
tags:
- rtty-config
- name: restart rtty
systemd:
name: "rtty"
enabled: "true"
daemon_reload: yes