Adding role for dhcptest
This commit is contained in:
40
roles/dhcptest/tasks/main.yaml
Normal file
40
roles/dhcptest/tasks/main.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: install dependencies
|
||||||
|
become: yes
|
||||||
|
apt:
|
||||||
|
name: "{{ item }}"
|
||||||
|
update_cache: yes
|
||||||
|
with_items:
|
||||||
|
- default-d-compiler
|
||||||
|
- build-essential
|
||||||
|
|
||||||
|
- name: Downloading dhcptest sources
|
||||||
|
git:
|
||||||
|
clone: yes
|
||||||
|
repo: "{{ dhcptest_url }}"
|
||||||
|
dest: "/tmp/dhcptest"
|
||||||
|
register: dhcptest_source
|
||||||
|
|
||||||
|
|
||||||
|
- name: Building NGINX
|
||||||
|
become: yes
|
||||||
|
shell: ldc2 dhcptest.d
|
||||||
|
args:
|
||||||
|
chdir: "{{ dhcptest_build_dir }}"
|
||||||
|
when: dhcptest_source
|
||||||
|
register: build_dhcptest
|
||||||
|
|
||||||
|
|
||||||
|
- name: Installing dhcptest
|
||||||
|
become: yes
|
||||||
|
copy:
|
||||||
|
src: "{{ dhcptest_build_dir }}/dhcptest"
|
||||||
|
dest: "{{ dhcptest_bin_path }}"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0755
|
||||||
|
when: build_dhcptest
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
9
roles/dhcptest/vars/main.yaml
Normal file
9
roles/dhcptest/vars/main.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
dhcptest_url: "https://github.com/CyberShadow/dhcptest.git"
|
||||||
|
dhcptest_bin_path: "/usr/sbin/dhcptest"
|
||||||
|
dhcptest_build_dir: "/tmp/dhcptest"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user