Oefenweb.dnsmasq
dnsmasq
Richten Sie Dnsmasq in Debian-ähnlichen Systemen ein.
Voraussetzungen
Keine
Variablen
dnsmasq_service_state: [Standard:started]: Der Status des Dienstes (z.B.stopped)dnsmasq_service_enabled: [Standard:true]: Ob der Dienst beim Booten starten solldnsmasq_service_resolved_disabled: [Standard:false]: Ob der Dienstsystemd-resolveddeaktiviert werden solldnsmasq_etc_default_domain_suffix: [optional]: Gibt die Domain an, die aus der DHCP-Leases-Datei gelesen werden muss, um gültig zu sein (z.B.dnsdomainname)dnsmasq_etc_default_dnsmasq_opts: [optional]: Optionen, die an dendnsmasqDaemon übergeben werden sollen (z.B.--conf-file=/etc/dnsmasq.alt)dnsmasq_etc_default_config_dir: [Standard:/etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new]: Durchsucht dieses Verzeichnis nach Konfigurationsoptionen (leer lassen, um auszukommentieren)dnsmasq_etc_default_ignore_resolvconf: [optional]: Wenn das Paketresolvconfinstalliert ist, wirddnsmasqdessen Ausgabe anstelle des Inhalts von/etc/resolv.confverwenden, um übergeordnete Nameserver zu finden (z.B.true)dnsmasq_etc_default: [siehe:defaults/main.yml]: Liste der Zeilen, die zu/etc/default/dnsmasqhinzugefügt werden sollendnsmasq_dnsmasq_conf: [Standard:[]]: Liste der Zeilen, die zu/etc/dnsmasq.confhinzugefügt werden sollendnsmasq_dnsmasq_d_files_present: [Standard:{}]: Deklaration spezifischer Konfigurationsdateien (hinzuzufügen)dnsmasq_dnsmasq_d_files_present.key: [erforderlich]: Der Name der Konfigurationsdatei (z.B.hosts)dnsmasq_dnsmasq_d_files_present.key.{n}: [Standard:[]]: Liste der Zeilen der Konfigurationsdateidnsmasq_dnsmasq_d_files_absent: [Standard:{}]: Spezifische Konfigurationsdateien, die entfernt werden sollendnsmasq_dnsmasq_d_files_absent.key: [erforderlich]: Der Name der Konfigurationsdatei (z.B.hosts)
Abhängigkeiten
Keine
Beispiel
---
- hosts: all
roles:
- oefenweb.dnsmasq
Beispiel mit Konfiguration (Domain zu einer IP-Adresse zwingen)
---
- hosts: all
roles:
- oefenweb.dnsmasq
vars:
dnsmasq_dnsmasq_d_files_present:
example-com:
- address=/mail.example.com/192.168.0.8
- address=/www.example.com/192.168.0.9
Beispiel mit Konfiguration (Caching)
---
- hosts: all
pre_tasks:
- name: Erstelle resolv-Datei für dnsmasq
ansible.builtin.copy:
content: |
nameserver 8.8.8.8
nameserver 8.8.4.4
dest: /etc/resolv.dnsmasq
roles:
- oefenweb.dnsmasq
vars:
dnsmasq_dnsmasq_conf:
- |
port=53
listen-address={{ ansible_lo['ipv4']['address'] }}
bind-interfaces
dnsmasq_dnsmasq_d_files_present:
cache:
- |
domain-needed
bogus-priv
no-hosts
dns-forward-max=150
cache-size=1000
neg-ttl=3600
resolv-file=/etc/resolv.dnsmasq
no-poll
Lizenz
MIT
Autor Informationen
- Mark van Driel
- Mischa ter Smitten
Feedback, Fehlerberichte, Anfragen, ...
Sind willkommen!
ansible-galaxy install Oefenweb.dnsmasq