Working prototype

This commit is contained in:
felix.niederwanger@suse.com 2021-03-25 11:09:16 +01:00
parent c620206691
commit be38529589
9 changed files with 34 additions and 14 deletions

Binary file not shown.

View file

@ -1,5 +1,10 @@
---
# handlers file for geekoops-next
- name: restart dnsmasq
systemd:
name: "{{dnsmasq_service}}"
state: restarted
- name: reload firewalld
shell: firewall-cmd --reload

View file

@ -17,7 +17,7 @@
state: enabled
notify: reload firewalld
when: dns_port != 0
tags: ['firewall', 'tftp', 'dnsmasq']
tags: ['firewall', 'dns', 'dnsmasq']
- name: Ensure dhcp is open in firewall
firewalld:
zone: "{{firewall_zone}}"
@ -26,4 +26,13 @@
state: enabled
notify: reload firewalld
when: dhcp_range != ""
tags: ['firewall', 'tftp', 'dnsmasq']
tags: ['firewall', 'dhcp', 'dnsmasq']
- name: Ensure proxy-dhcp is open in firewall
firewalld:
zone: "{{firewall_zone}}"
service: proxy-dhcp
permanent: true
state: enabled
notify: reload firewalld
when: "'proxy' in dhcp_range"
tags: ['firewall', 'dhcp', 'dnsmasq']

View file

@ -18,6 +18,8 @@
owner: root
group: root
mode: 0755
notify: restart dnsmasq
tags: ['dnsmasq','tftp']
- name: Ensure pxelinux.cfg is present
file:
path: "{{tftp_root}}/pxelinux.cfg"
@ -44,6 +46,12 @@
mode: 0755
tags: ['dnsmasq','tftp']
- name: Ensure dnsmasq is started and enabled
systemd:
name: "{{ dnsmasq_service }}"
state: started
enabled: true
tags: ['dnsmasq','tftp']
- include: firewall.yml
when: config_firewall == true

View file

@ -4,11 +4,16 @@
## Don't manually edit it, as your changes will be overwritten! ##
################################################################################
PORT={{dns_port}}
# DNS port (use 0 to disable DNS)
port={{dns_port}}
{% if dhcp_no_override == true %}
# Disable reuse of the DHCP servername to avoid confusion of old (and broken) clients
dhcp-no-override
{% endif %}
{% if dhcp_range != "" %}
dhcp-range={{dhcp_range}}
{% endif %}
# PXE boot menu
dhcp-boot={{dhcp_boot}}
@ -22,9 +27,6 @@ pxe-service=x86PC, "Legacy Network Boot", pxelinux
pxe-service=x86-64_EFI,"EFI Network Boot", pxelinux
{% endif %}
{% if dhcp_range != "" %}
dhcp-range={{dhcp_range}}
{% endif %}
# tftp server
enable-tftp

View file

@ -1,4 +1,4 @@
#DEFAULT vesamenu.c32
DEFAULT vesamenu.c32
PROMPT 0
TIMEOUT 100
ONTIMEOUT local

View file

@ -1,2 +0,0 @@
localhost

View file

@ -1,5 +0,0 @@
---
- hosts: localhost
remote_user: root
roles:
- geekoops-next

View file

@ -5,4 +5,7 @@
packages: ['dnsmasq']
dnsmasq_service: "dnsmasq"
tftp_root: "/srv/tftpboot"