Skip to content

Commit

Permalink
Merge branch 'sonic-ztp' of github.com:metal-stack/metal-roles into s…
Browse files Browse the repository at this point in the history
…onic-ztp
  • Loading branch information
iljarotar committed Dec 9, 2024
2 parents ffd1fe6 + 2bd33f3 commit 3384bc2
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 3384bc2

Please sign in to comment.