buluma.dnsmasq
Ansible角色 dnsmasq
在系统上安装和配置dnsmasq。
GitHub | 版本 | 问题 | 拉取请求 | 下载量 |
---|---|---|---|---|
示例剧本
这个示例来自molecule/default/converge.yml
,并在每次推送、拉取请求和发布时进行测试。
---
- name: Converge
hosts: all
become: true
gather_facts: true
pre_tasks:
- name: 更新apt缓存。
apt: update_cache=true cache_valid_time=600
when: ansible_os_family == 'Debian'
roles:
- role: buluma.dnsmasq
机器需要准备。在CI中使用molecule/default/prepare.yml
进行准备:
---
- name: Prepare
hosts: all
become: true
gather_facts: false
roles:
- role: buluma.bootstrap
也可以查看完整的说明和示例来了解如何使用这些角色。
角色变量
变量的默认值在defaults/main.yml
中设置:
---
# dnsmasq的默认文件
# dnsmasq_port: 5353
dnsmasq_domain_needed: false
dnsmasq_bogus_priv: false
dnsmasq_conf_file: "{{ dnsmasq_documentation_path }}/trust-anchors.conf"
dnsmasq_dnssec: false
dnsmasq_dnssec_check_unsigned: false
dnsmasq_filterwin2k: false
# dnsmasq_resolv_file: /etc/resolv.conf
dnsmasq_strict_order: false
dnsmasq_no_resolv: false
dnsmasq_no_poll: false
# dnsmasq_servers:
# - domain: localnet
# nameserver: "192.168.0.1"
# - domain: "3.168.192.in-addr.arpa"
# nameserver: "10.1.2.3"
# - domain: "10.1.2.3"
# interface: eth1
# - destination: "10.2.3.4"
# nameserver: "192.168.1.1"
# interface: "192.168.1.1"
# port: 55
# dnsmasq_locals:
# - domain: localnet
# dnsmasq_addresses:
# - domain: double-click.net
# address: "127.0.0.1"
# - domain: www.thekelleys.org.uk
# address: "fe80::20d:60ff:fe36:f83"
# dnsmasq_ipsets:
# - domains:
# - name: yahoo.com
# - name: google.com
# destination: vpn
# option: search
dnsmasq_user: "{{ dnsmasq_set_user }}"
dnsmasq_group: "{{ dnsmasq_set_group }}"
# dnsmasq_interfaces:
# - name: lo
# - name: eth0
# dnsmasq_except_interface: eth0
# dnsmasq_listen_addresses:
# - name: "127.0.0.1"
dnsmasq_no_dhcp_interface: ""
dnsmasq_local_service: false
dnsmasq_bind_interfaces: false
dnsmasq_no_hosts: false
# dnsmasq_addn_hosts: /etc/banner_add_hosts
dnsmasq_expand_hosts: false
# dnsmasq_domains:
# - name: thekelleys.org.uk
# - name: wireless.thekelleys.org.uk
# subnet: "192.168.2.0/24"
# - name: reserved.thekelleys.org.uk
# from: "192.68.3.100"
# until: "192.168.3.200"
# dnsmasq_dhcp_ranges:
# - from: "192.168.0.50"
# until: "192.168.0.150"
# leasetime: 12h
# - from: "192.168.0.50"
# until: "192.168.0.150"
# subnet: "255.255.255.0"
# leasetime: 12h
# - from: "192.168.0.50"
# until: "192.168.0.150"
# sets:
# - name: red
# - from: "192.168.0.50"
# until: "192.168.0.150"
# leasetime: 12h
# tags:
# - name: green
# - from: "192.168.0.0"
# options:
# - name: static
# static: true
# - from: "1234::2"
# until: "1234::500"
# prefix: 64
# leasetime: 12h
# - from: "1234::"
# options:
# - name: ra-only
# - from: "1234::"
# options:
# - name: ra-names
# - from: "1234::"
# options:
# - name: ra-only
# leasetime: 48hA
# - from: "1234::2"
# until: "1234::500"
# options:
# - name: slaac
# - from: "1234::"
# options:
# - name: ra-stateless
# - from: "1234::"
# options:
# - name: ra-stateless
# - name: ra-names
dnsmasq_enable_ra: false
# dnsmasq_hosts:
# - name: "11:22:33:44:55:66"
# value: "192.168.0.60"
# - name: "11:22:33:44:55:66"
# value: fred
# - name: "11:22:33:44:55:66"
# value: "fred,192.168.0.60,45m"
# - name: "11:22:33:44:55:66,12:34:56:78:90:12"
# value: "192.168.0.60"
# - name: bert
# value: "192.168.0.70,infinite"
# - name: "id:01:02:02:04"
# value: "192.168.0.60"
# - name: "id:ff:00:00:00:00:00:02:00:00:02:c9:00:f4:52:14:03:00:28:05:81"
# value: "192.168.0.61"
# dnsmasq_dhcp_ignore: "tag:!known"
# dnsmasq_dhcp_vendorclass: "set:red,Linux"
# dnsmasq_dhcp_userclass: "set:red,accounts"
dnsmasq_dhcp_mac: "set:red,00:60:8C:*:*:*"
dnsmasq_read_ethers: false
# dnsmasq_dhcp_options:
# - name: 3
# value: "1.2.3.4"
# - name: "option:router"
# value: "1.2.3.4"
# - name: 3
# - name: "option:ntp-server"
# value: "192.168.0.4,10.10.0.5"
# - name: "option6:dns-server"
# value: "[1234::77],[1234::88]"
# - name: "option6:dns-server"
# value: "[::],[1234::88]"
# - name: "option6:information-refresh-time"
# value: 6h
# - name: "option:T1"
# value: 1m
# - name: "option:T2"
# value: 2m
# - name: 42
# value: "0.0.0.0"
# - name: 40
# value: welly
# - name: 23
# value: 50
# - name: 27
# value: 1
# - name: 128
# value: "e4:45:74:68:00:00"
# - name: 129
# value: NIC=eepro100
# - name: "option:ntp-server"
# tag: red
# value: "192.168.1.1"
# - name: 19
# value: 0
# - name: 44
# value: "0.0.0.0"
# - name: 45
# value: "0.0.0.0"
# - name: 46
# value: 8
# - name: 252
# value: "\n"
# - name: "option:domain-search"
# value: eng.apple.com,marketing.apple.com
# - name: 121
# value: "192.168.1.0/24,1.2.3.4,10.0.0.0/8,5.6.7.8"
# - name: "vendor:PXEClient"
# value: "1,0.0.0.0"
# - name: "vendor:MSFT"
# value: 2,1i
# - name: "vendor:Etherboot"
# value: 60,"Etherboot"
# dnsmasq_dhcp_option_force:
# - name: 208
# value: "f1:00:74:7e"
# - name: 209
# value: configs/common
# - name: 210
# value: /tftpboot/pxelinux/files/
# - name: 211
# value: 30i
# dnsmasq_dhcp_boot: pxelinux.0
# dnsmasq_dhcp_boot: "pxelinux.0,server.name,192.168.1.100"
dnsmasq_enable_tftp: false
# dnsmasq_tftp_root: /var/ftpd
dnsmasq_tftp_no_fail: false
dnsmasq_tftp_secure: false
dnsmasq_tftp_no_blocksize: false
# dnsmasq_dhcp_lease_max: 150
# dnsmasq_dhcp_leasefile: /var/lib/dnsmasq/dnsmasq.leases
dnsmasq_dhcp_authoritative: false
dnsmasq_dhcp_rapid_commit: false
dnsmasq_dhcp_script: /bin/echo
# dnsmasq_cache_size: 150
dnsmasq_no_negcache: false
# dnsmasq_local_ttl: 3600
# dnsmasq_bogus_nxdomain: "64.94.110.11"
# dnsmasq_aliases:
# - from: "1.2.3.4"
# until: "4.5.6.7"
# - from: "1.2.3.0"
# until: "5.6.7.0"
# subnet: "255.255.255.0"
# - from: "192.168.0.10-192.168.0.40"
# until: "10.0.0.0"
# subnet: "255.255.255.0"
# dnsmasq_mx_hosts:
# - domain: maildomain.com
# host: servermacine.com
# priority: 50
# - domain: servermachine.com
dnsmasq_localmx: false
dnsmasq_selfmx: false
# dnsmasq_src_hosts:
# - record: _ldap._tcp.example.com
# destination: ldapserver.example.com
# port: 389
# - record: _ldap._tcp.example.com
# destination: ldapserver.example.com
# port: 389
# priority: 1
# - record: _ldap._tcp.example.com
# destination: ldapserver.example.com
# port: 389
# priority: 2
# - record: _ldap._tcp.example.com
dnsmasq_log_queries: false
dnsmasq_log_dhcp: false
# dnsmasq_conf_dir: /etc/dnsmasq.d
# dnsmasq_dhcp_name_match: "set:wpad-ignore,wpad"
# dnsmasq_ignore_names: "tag:wpad-ignore"
要求
- 在 requirements.txt中列出的pip包。
已使用角色的状态
以下角色用于准备系统。您可以以其他方式准备您的系统。
要求 | GitHub | 版本 |
---|---|---|
buluma.bootstrap |
上下文
此角色是多个兼容角色的一部分。有关更多信息,请查看这些角色的文档。
这是相关角色的概述:
兼容性
此角色已在以下容器镜像中进行测试:
容器 | 标签 |
---|---|
Alpine | 所有 |
Debian | 所有 |
EL | 8, 9 |
Fedora | 所有 |
Ubuntu | focal, bionic, jammy |
需要的最低Ansible版本为2.12,测试已在以下版本进行:
- 以前的版本。
- 当前版本。
- 开发版本。
如果您发现问题,请在GitHub上登记。