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:
Andreas B. Mundt 2021-04-09 10:31:16 +02:00 committed by Andreas B. Mundt
parent e55997a01c
commit ebcfd88ef4
10 changed files with 18 additions and 18 deletions

View file

@ -0,0 +1 @@
tftp_root: "/var/lib/tftpboot"

View file

@ -0,0 +1,15 @@
- name: bind mount images
mount:
path: "{{ tftp_root }}/d-i/n-pkg/"
src: /usr/lib/debian-installer/
fstype: none
state: mounted
opts: bind
listen: bind mount images
- name: rebuild di-netboot-assistant menu
command: "{{ item }}"
with_items:
- di-netboot-assistant rebuild-menu
- di-netboot-assistant rebuild-grub
listen: rebuild di-netboot-assistant menu

View file

@ -0,0 +1,26 @@
- name: make preseed directory available
file:
path: "{{ tftp_root }}/d-i/{{ di_dist }}"
state: directory
- name: install di-netboot-assistant and installer package
apt:
name:
- di-netboot-assistant
- "{{ di_pkg }}"
notify:
- bind mount images
- rebuild di-netboot-assistant menu
- name: provide preseed file
copy:
src: /usr/share/doc/di-netboot-assistant/examples/preseed.cfg
dest: "{{ tftp_root }}/d-i/{{ di_dist }}"
force: no
remote_src: yes
- name: make the hostname resolvable from the LAN
replace:
path: /etc/hosts
regexp: '^(127\.0\.1\.1.*)$'
replace: '#\1\n{{ ipaddr_lan | ipaddr("address") }} {{ ansible_hostname }}.{{ ansible_domain }} {{ ansible_hostname }}'