Restructuring/renaming DNS, DHCP, TFTP and netboot installer.
Idea: The role 'dnsmasq' and a new role 'dns-dhcp-tftp' are drop-in replacements and interchangeable. 'netboot-installer' works indepently of the role chosen for DNS, DHCP and TFTP.
This commit is contained in:
parent
e55997a01c
commit
ebcfd88ef4
10 changed files with 18 additions and 18 deletions
3
roles/dnsmasq/handlers/main.yml
Normal file
3
roles/dnsmasq/handlers/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
- name: restart dnsmasq
|
||||
service: name=dnsmasq state=restarted enabled=yes
|
||||
listen: "restart dnsmasq"
|
22
roles/dnsmasq/tasks/main.yml
Normal file
22
roles/dnsmasq/tasks/main.yml
Normal file
|
@ -0,0 +1,22 @@
|
|||
- name: check if dnsmasq is already there
|
||||
stat: path=/etc/dnsmasq.d/dnsmasq-dhcp
|
||||
register: dnsmasq
|
||||
|
||||
- name: install dnsmasq package
|
||||
apt:
|
||||
name:
|
||||
- dnsmasq
|
||||
- resolvconf
|
||||
state: latest
|
||||
|
||||
- name: configure dnsmasq dhcp
|
||||
template:
|
||||
src: dnsmasq-dhcp.j2
|
||||
dest: /etc/dnsmasq.d/dnsmasq-dhcp
|
||||
notify: "restart dnsmasq"
|
||||
|
||||
- name: configure dnsmasq tftp
|
||||
template:
|
||||
src: dnsmasq-tftp-netboot-installer.j2
|
||||
dest: /etc/dnsmasq.d/tftp-netboot-installer
|
||||
notify: "restart dnsmasq"
|
3
roles/dnsmasq/templates/dnsmasq-dhcp.j2
Normal file
3
roles/dnsmasq/templates/dnsmasq-dhcp.j2
Normal file
|
@ -0,0 +1,3 @@
|
|||
interface={{ if_lan }}
|
||||
dhcp-range={{ dhcp_start }},{{ dhcp_stop }},2h
|
||||
dhcp-generate-names
|
|
@ -0,0 +1,5 @@
|
|||
enable-tftp
|
||||
tftp-root={{ tftp_root }}
|
||||
dhcp-boot=d-i/n-a/pxelinux.0
|
||||
dhcp-match=set:efi-x86_64,option:client-arch,7
|
||||
dhcp-boot=tag:efi-x86_64,d-i/n-a/bootnetx64.efi
|
Loading…
Add table
Add a link
Reference in a new issue