Skip to content

Commit

Permalink
Merge branch 'master' into gardener-local
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 authored Dec 9, 2024
2 parents a4eaa65 + 2176e00 commit 502b6ce
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions partition/roles/dhcp/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
loop_control:
label: "{{ item.network }}"

- name: install isc-dhcp-server
apt:
name:
- isc-dhcp-server
update_cache : yes
- name: ensure config directories are present
file:
path: "{{ item }}"
state: directory
mode: 0755
loop:
- /etc/dhcp
- /etc/default

- name: render dhcpd conf
template:
Expand All @@ -42,11 +45,20 @@
when: dhcp_static_hosts is defined
register: _hosts_conf

- name: install isc-dhcp-server
apt:
name:
- isc-dhcp-server
update_cache : yes

# we want this task to be run at this point and not at the end of the playbook
# this is why we don't use a handler here
- name: restart isc-dhcp-server on config change
service:
name: "{{ dhcp_service_name }}"
enabled: true
state: restarted
daemon-reload: true
when: _dhcpd_conf is changed or _isc_dhcp_server is changed or _hosts_conf is changed

- name: ensure isc-dhcp-server is running
Expand Down

0 comments on commit 502b6ce

Please sign in to comment.