[WIP] Role for uvrrpd

This commit is contained in:
Tristan PILAT 2018-08-16 16:27:21 +02:00 committed by Jérémy Lecour
parent bc8858fc0a
commit a615d2b32b
3 changed files with 106 additions and 0 deletions

3
uvrrpd/README.md Normal file
View File

@ -0,0 +1,3 @@
# uvrrpd
Install Evolix's uvrrpd from sources.

12
uvrrpd/meta/main.yml Normal file
View File

@ -0,0 +1,12 @@
galaxy_info:
author: Evolix
description: Install uvrrpd from sources.
issue_tracker_url: https://forge.evolix.org/projects/uvrrpd/issues
min_ansible_version: 2.2
platforms:
- name: Debian
versions:
- stretch

91
uvrrpd/tasks/main.yml Normal file
View File

@ -0,0 +1,91 @@
---
- name: "Is uvrrpd already installed ?"
stat:
path: /usr/local/sbin/uvrrpd
check_mode: no
register: uvrrpd_test
- name: Make sure unzip is present
command: 'dpkg -l unzip'
check_mode: no
ignore_errors: yes
register: unzip_is_installed
when: not uvrrpd_test.stat.exists
tags:
- uvrrpd
- name: Make sure dh-autoreconf is present
command: 'dpkg -l dh-autoreconf'
check_mode: no
ignore_errors: yes
register: autoreconf_is_installed
when: not uvrrpd_test.stat.exists
tags:
- uvrrpd
- name: Make sure unzip and dh-autoreconf are installed
apt:
name: "{{item}}"
with_items:
- unzip
- dh-autoreconf
when: not uvrrpd_test.stat.exists
tags:
- uvrrpd
- name: Get uvrrpd sources
unarchive:
src: 'https://github.com/Evolix/uvrrpd/archive/master.zip'
dest: /root/
remote_src: True
mode: "0755"
when: not uvrrpd_test.stat.exists
tags:
- uvrrpd
- name: Pre-build configure
shell: 'cd /root/uvrrpd-master/;autoreconf -i;./configure'
when: not uvrrpd_test.stat.exists
tags:
- uvrrpd
- name: Make
make:
chdir: /root/uvrrpd-master/
when: not uvrrpd_test.stat.exists
tags:
- uvrrpd
- include_role:
name: remount-usr
when: not uvrrpd_test.stat.exists
tags:
- uvrrpd
- name: Make install
make:
chdir: /root/uvrrpd-master/
target: install
when: not uvrrpd_test.stat.exists
tags:
- uvrrpd
- name: Remove unzip if initially not present
apt:
name: unzip
state: absent
when:
- not uvrrpd_test.stat.exists
- unzip_is_installed.rc == 0
tags:
- uvrrpd
- name: Remove dh-autoreconf if initially not present
apt:
name: dh-autoreconf
state: absent
when:
- not uvrrpd_test.stat.exists
- autoreconf_is_installed.rc == 0
tags:
- uvrrpd