diff --git a/roles/dhcptest/tasks/main.yaml b/roles/dhcptest/tasks/main.yaml new file mode 100644 index 0000000..aa90e73 --- /dev/null +++ b/roles/dhcptest/tasks/main.yaml @@ -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 + + + diff --git a/roles/dhcptest/vars/main.yaml b/roles/dhcptest/vars/main.yaml new file mode 100644 index 0000000..02219da --- /dev/null +++ b/roles/dhcptest/vars/main.yaml @@ -0,0 +1,9 @@ +--- + +dhcptest_url: "https://github.com/CyberShadow/dhcptest.git" +dhcptest_bin_path: "/usr/sbin/dhcptest" +dhcptest_build_dir: "/tmp/dhcptest" + + + +