blob: 80927eccffc7db5179d54e1b64722ca21b0f314a [file] [log] [blame]
Zack Williams9fc21d72020-11-22 22:36:54 -07001---
2# dhcpd tasks/main.yml
3#
4# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
5# SPDX-License-Identifier: Apache-2.0
6
7- name: include OS-specific vars
8 include_vars: "{{ ansible_os_family }}.yml"
9
10- name: include OS-specific tasks
11 include_tasks: "{{ ansible_os_family }}.yml"
12
13- name: Create dhcpd.conf from template
14 template:
15 src: dhcpd.conf.j2
16 dest: "{{ dhcpd_config_dir }}/dhcpd.conf"
17 backup: true
18 mode: "0644"
19 owner: root
Zack Williams98725e22021-03-18 10:21:26 -070020 group: "{{ dhcpd_groupname }}"
Zack Williams9fc21d72020-11-22 22:36:54 -070021 # validate: 'dhcpd -t -cf %s' # Does not work...
22 notify:
23 - dhcpd-restart
24
25- name: Copy tftpd served files
26 copy:
27 src: "{{ item }}"
28 dest: "{{ tftpd_boot_dir }}/{{ item }}"
29 owner: root
30 group: "{{ tftpd_groupname }}"
31 mode: "0644"
32 with_items: "{{ tftpd_files }}"
33
34- name: Enable and start dhcpd
35 service:
36 name: "{{ dhcpd_service }}"
37 enabled: true
38 state: started
Zack Williams98725e22021-03-18 10:21:26 -070039 arguments: "{{ dhcpd_arguments | default(omit) }}"
Zack Williams9fc21d72020-11-22 22:36:54 -070040
41- name: Enable and start tftpd
42 service:
43 name: "{{ tftpd_service }}"
44 enabled: true
45 state: started
Zack Williams98725e22021-03-18 10:21:26 -070046 arguments: "{{ tftpd_arguments | default(omit) }}"