blob: a030609a382a7389b5420f7753bd7e95290f0e04 [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
20 group: root
21 # 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
39
40- name: Enable and start tftpd
41 service:
42 name: "{{ tftpd_service }}"
43 enabled: true
44 state: started