86 lines
1.8 KiB
YAML
86 lines
1.8 KiB
YAML
- name: Install umurmur build dependencies
|
|
package:
|
|
name: "{{ package }}"
|
|
state: present
|
|
loop:
|
|
- git
|
|
- build-essential
|
|
- cmake
|
|
- libconfig-dev
|
|
- libprotobuf-c-dev
|
|
- libmbedtls-dev
|
|
- ssl-cert
|
|
loop_control:
|
|
loop_var: package
|
|
|
|
- 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 |