Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 1 | |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | |
Zack Williams | ba5549c | 2017-03-25 15:04:45 -0700 | [diff] [blame] | 17 | --- |
| 18 | # dhcpd/tasks/main.yml |
| 19 | |
| 20 | - name: Install dhcpd |
| 21 | apt: |
| 22 | name: "{{ item }}" |
| 23 | update_cache: yes |
| 24 | cache_valid_time: 3600 |
| 25 | with_items: |
| 26 | - isc-dhcp-server |
| 27 | |
| 28 | - name: Create /etc/dhcp/dhcpd.conf from template |
| 29 | template: |
| 30 | src: dhcpd.conf.j2 |
| 31 | dest: /etc/dhcp/dhcpd.conf |
| 32 | mode: "0644" |
| 33 | owner: root |
| 34 | group: root |
| 35 | # validate: 'dhcpd -t -cf %s' |
| 36 | notify: |
| 37 | - restart-dhcpd |
| 38 | |
| 39 | - name: Set interfaces for dhcpd to listen on |
| 40 | template: |
| 41 | src: isc-dhcp-server.j2 |
| 42 | dest: /etc/default/isc-dhcp-server |
| 43 | mode: "0644" |
| 44 | owner: root |
| 45 | group: root |
| 46 | notify: |
| 47 | - restart-dhcpd |
| 48 | |