Oefenweb.dnsmasq

dnsmasq

CI Ansible Galaxy

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 soll

  • dnsmasq_service_resolved_disabled: [Standard: false]: Ob der Dienst systemd-resolved deaktiviert werden soll

  • dnsmasq_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 den dnsmasq Daemon ü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 Paket resolvconf installiert ist, wird dnsmasq dessen Ausgabe anstelle des Inhalts von /etc/resolv.conf verwenden, um übergeordnete Nameserver zu finden (z.B. true)

  • dnsmasq_etc_default: [siehe: defaults/main.yml]: Liste der Zeilen, die zu /etc/default/dnsmasq hinzugefügt werden sollen

  • dnsmasq_dnsmasq_conf: [Standard: []]: Liste der Zeilen, die zu /etc/dnsmasq.conf hinzugefügt werden sollen

  • dnsmasq_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 Konfigurationsdatei

  • dnsmasq_dnsmasq_d_files_absent: [Standard: {}]: Spezifische Konfigurationsdateien, die entfernt werden sollen

  • dnsmasq_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!

Über das Projekt

Set up dnsmasq in Debian-like systems

Installieren
ansible-galaxy install Oefenweb.dnsmasq
Lizenz
mit
Downloads
347.7k
Besitzer