diff --git a/README.rst b/README.rst index c874821cfad71a0c01e0f2a998a58300a1831ba5..2fc717cf324cf8f3292365dd66e7e268eeaee494 100644 --- a/README.rst +++ b/README.rst @@ -59,12 +59,3 @@ Nimrod Adar, `contact me <nimrod@shore.co.il>`_ or visit my `website <https://www.shore.co.il/>`_. Patches are welcome via `git send-email <http://git-scm.com/book/en/v2/Git-Commands-Email>`_. The repository is located at: https://www.shore.co.il/git/. - -TODO ----- - -- Flush handlers at the end of the role and wait for the service to come online. -- Assertions, tests. -- Log to syslog. -- Alias email to root. -- Flush handlers and wait for service to come up. diff --git a/tasks/main.yml b/tasks/main.yml index 3f198b6e9ca42dced9fd53bb7d5b94752bd65860..8d92dec9ca50e3c71cd005713dcae8820673500e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -47,4 +47,4 @@ - name: Wait for service to come online wait_for: - port: 67 + path: /var/run/dhcp-server/dhcpd.pid diff --git a/tests/templates/dhcpd.conf.j2 b/tests/templates/dhcpd.conf.j2 index a9da45312fbb187bca0a236d15713f287099f7ab..57045b68913b7e77af76ea8e0765ec51343cd966 100644 --- a/tests/templates/dhcpd.conf.j2 +++ b/tests/templates/dhcpd.conf.j2 @@ -1,4 +1,5 @@ authoritative; subnet {{ ansible_default_ipv4.network }} netmask {{ ansible_default_ipv4.netmask }} { + range {{ (ansible_default_ipv4.address|ipaddr('int') + 1) | ipaddr }} {{ (ansible_default_ipv4.address|ipaddr('int') + 2) | ipaddr }}; } diff --git a/tests/test_dhcp.py b/tests/test_dhcp.py index f898616cbc14f489994ae85faeb716f8edd95b96..64b2c37ad9755dc60c49929e4a137bee5daed741 100644 --- a/tests/test_dhcp.py +++ b/tests/test_dhcp.py @@ -6,11 +6,11 @@ testinfra_hosts = AnsibleRunner('.molecule/ansible_inventory').get_hosts('all') def test_dhcp_service(Service, Socket, SystemInfo): if SystemInfo.type == 'openbsd': service = Service('dhcpd') - elif SystemInfo.type == 'debian': + elif SystemInfo.type == 'linux': service = Service('isc-dhcp-server') assert service.is_running try: assert service.is_enabled except NotImplementedError: pass - assert Socket('tcp://0.0.0.0:80').is_listening + assert Socket('udp://0.0.0.0:67').is_listening