Zack Williams | 9fc21d7 | 2020-11-22 22:36:54 -0700 | [diff] [blame] | 1 | --- |
| 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 Williams | 98725e2 | 2021-03-18 10:21:26 -0700 | [diff] [blame] | 20 | group: "{{ dhcpd_groupname }}" |
Zack Williams | 9fc21d7 | 2020-11-22 22:36:54 -0700 | [diff] [blame] | 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 |
Zack Williams | 98725e2 | 2021-03-18 10:21:26 -0700 | [diff] [blame] | 39 | arguments: "{{ dhcpd_arguments | default(omit) }}" |
Zack Williams | 9fc21d7 | 2020-11-22 22:36:54 -0700 | [diff] [blame] | 40 | |
| 41 | - name: Enable and start tftpd |
| 42 | service: |
| 43 | name: "{{ tftpd_service }}" |
| 44 | enabled: true |
| 45 | state: started |
Zack Williams | 98725e2 | 2021-03-18 10:21:26 -0700 | [diff] [blame] | 46 | arguments: "{{ tftpd_arguments | default(omit) }}" |