Oefenweb.dnsmasq
dnsmasq
Debian系システムにDnsmasqを設定します。
必要条件
なし
変数
dnsmasq_service_state
: [デフォルト:started
]: サービスの状態(例:stopped
)dnsmasq_service_enabled
: [デフォルト:true
]: サービスがブート時に起動するかどうかdnsmasq_service_resolved_disabled
: [デフォルト:false
]:systemd-resolved
サービスを無効にするかどうかdnsmasq_etc_default_domain_suffix
: [オプション]: DHCPリースファイルから読み取ったホストが、合法的であるために必要なドメイン(例:dnsdomainname
)dnsmasq_etc_default_dnsmasq_opts
: [オプション]:dnsmasq
デーモンに渡すオプション(例:--conf-file=/etc/dnsmasq.alt
)dnsmasq_etc_default_config_dir
: [デフォルト:/etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new
]: 構成オプションを検索するドロップディレクトリ(コメントアウトするには空にする)dnsmasq_etc_default_ignore_resolvconf
: [オプション]:resolvconf
パッケージがインストールされている場合、dnsmasq
は/etc/resolv.conf
の内容ではなくその出力を使用して上流のネームサーバを探します(例:true
)dnsmasq_etc_default
: [参照:defaults/main.yml
]:/etc/default/dnsmasq
に追加される行のリストdnsmasq_dnsmasq_conf
: [デフォルト:[]
]:/etc/dnsmasq.conf
に追加される行のリストdnsmasq_dnsmasq_d_files_present
: [デフォルト:{}
]: 特定の構成ファイルの宣言(追加するための)dnsmasq_dnsmasq_d_files_present.key
: [必須]: 構成ファイルの名前(例:hosts
)dnsmasq_dnsmasq_d_files_present.key.{n}
: [デフォルト:[]
]: 構成ファイルの行のリストdnsmasq_dnsmasq_d_files_absent
: [デフォルト:{}
]: 削除する特定の構成ファイルdnsmasq_dnsmasq_d_files_absent.key
: [必須]: 構成ファイルの名前(例:hosts
)
依存関係
なし
例
---
- hosts: all
roles:
- oefenweb.dnsmasq
設定を含む例(ドメインをIPアドレスに強制)
---
- 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
設定を含む例(キャッシング)
---
- hosts: all
pre_tasks:
- name: dnsmasq用のresolvファイルを作成
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
ライセンス
MIT
著者情報
- マーク・ファン・ドリール
- ミシャ・テル・スミッテン
フィードバック、バグ報告、リクエスト、...
ansible-galaxy install Oefenweb.dnsmasq