From 803d2727bb504fdebeae2956e268e395270d1dac Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sun, 18 Dec 2016 22:45:38 +0200
Subject: [PATCH] - Pass on OpenBSD.

---
 tasks/main.yml     | 2 ++
 tests/test_dhcp.py | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/tasks/main.yml b/tasks/main.yml
index 8d92dec..e5b6f29 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -11,6 +11,7 @@
         - dhcp_config is defined
 
 - name: APT install
+  when: ansible_pkg_mgr == 'apt'
   apt:
       name: isc-dhcp-server
       state: present
@@ -46,5 +47,6 @@
 - meta: flush_handlers
 
 - name: Wait for service to come online
+  when: ansible_os_family == 'Debian'
   wait_for:
       path: /var/run/dhcp-server/dhcpd.pid
diff --git a/tests/test_dhcp.py b/tests/test_dhcp.py
index 64b2c37..5a5e39f 100644
--- a/tests/test_dhcp.py
+++ b/tests/test_dhcp.py
@@ -13,4 +13,5 @@ def test_dhcp_service(Service, Socket, SystemInfo):
         assert service.is_enabled
     except NotImplementedError:
         pass
-    assert Socket('udp://0.0.0.0:67').is_listening
+    if SystemInfo.type == 'linux':
+        assert Socket('udp://0.0.0.0:67').is_listening
-- 
GitLab