88 lines
1.9 KiB
YAML
88 lines
1.9 KiB
YAML
- name: Install umurmur build dependencies
|
|
apt:
|
|
name:
|
|
- git
|
|
- build-essential
|
|
- cmake
|
|
- libconfig-dev
|
|
- libprotobuf-c-dev
|
|
- libmbedtls-dev
|
|
- ssl-cert
|
|
|
|
- name: Clone umurmur git repository
|
|
git:
|
|
repo: https://github.com/umurmur/umurmur.git
|
|
dest: /opt/umurmur
|
|
version: "{{ umurmur_version }}"
|
|
|
|
- name: Change umurmur git repository's permissions
|
|
file:
|
|
path: /opt/umurmur
|
|
owner: root
|
|
group: root
|
|
mode: "775"
|
|
state: directory
|
|
|
|
- name: Create the build directory
|
|
file:
|
|
path: /opt/umurmur/build
|
|
owner: root
|
|
group: root
|
|
mode: "775"
|
|
state: directory
|
|
|
|
- name: Generate the Makefile with cmake
|
|
shell: cd /opt/umurmur/build && cmake .. -DSSL=mbedtls
|
|
changed_when: no
|
|
|
|
- name: Build umurmur from source
|
|
make:
|
|
chdir: /opt/umurmur/build
|
|
changed_when: _umurmur_built.stdout_lines | length > 1
|
|
register: _umurmur_built
|
|
|
|
- name: Install umurmur
|
|
make:
|
|
chdir: /opt/umurmur/build
|
|
target: install
|
|
changed_when: "'Installing' in _umurmur_installed.stdout"
|
|
register: _umurmur_installed
|
|
notify: restart umurmur
|
|
|
|
- name: Copy umurmur config file
|
|
template:
|
|
src: umurmur.conf.j2
|
|
dest: /usr/local/etc/umurmur.conf
|
|
owner: root
|
|
group: "{{ umurmur_ssl_group }}"
|
|
mode: "640"
|
|
validate: /usr/local/bin/umurmurd -t -c %s
|
|
notify: restart umurmur
|
|
tags: umurmur_config
|
|
|
|
- name: Copy umurmur systemd service
|
|
template:
|
|
src: umurmur.service.j2
|
|
dest: /etc/systemd/system/umurmur.service
|
|
owner: root
|
|
group: root
|
|
mode: "644"
|
|
notify:
|
|
- reload systemd
|
|
- restart umurmur
|
|
|
|
- name: Start umurmur service
|
|
service:
|
|
name: umurmur
|
|
enabled: yes
|
|
state: started
|
|
register: umurmur_started
|
|
|
|
- name: Trigger umurmur handlers
|
|
meta: flush_handlers
|
|
|
|
- name: Open umurmur port with UFW
|
|
ufw:
|
|
rule: allow
|
|
port: "{{ umurmur_port }}"
|
|
when: umurmur_ispublic | bool |