<commit_before># Dnsmasq

This role can be used to set up Dnsmasq.

## Requirements

This role can be used on Linux systems with:

* the `yum` package manager,
* `firewalld`, which is used to configure the firewall.

That means a fairly recent Fedora, or RedHat/CentOS 7.

## Role Variables

* `dnsmasq_addn_hosts` (*Optional*) -- set this to specify a custom host file that should be read in addition to `/etc/hosts`.
* `dnsmasq_bogus_priv` (*Optional*) -- set this if Dnsmasq should not forward addresses in the non-routed address spaces.
* `dnsmasq_dhcp_hosts` (*Optional*) -- set this to reserve IP addresses for specific hosts. You should provide an array of hashes with keys `name` (optional), `mac` and `ip` for each reservation.
* `dnsmasq_dhcp_ranges` (*Optional*) -- set this to enable the DHCP server. You should specify an array of hashes (with keys `start_addr`, `end_addr`, and `lease_time`) for each address pool. See the example section below.
* `dnsmasq_domain_needed` (*Optional*) -- set this if Dnsmasq should not forward local requests (i.e. without domain name).
* `dnsmasq_domain` (*Optional*) -- set the domain for Dnsmasq.
* `dnsmasq_expand_hosts` (*Optional*) -- set this (and `dnsmasq_domain`) if you want to have a domain automatically added to simple names in a hosts-file.
* `dnsmasq_listen_address` (*Default value:* 127.0.0.1, set in `defaults/main.yml`) -- set this to specify the IP address of the interface that should listen to DNS/DHCP requests.
* `dnsmasq_option_router` (*Optional*) -- set this to specify the default gateway to be sent to clients.
* `dnsmasq_port` (*Optional*) -- set this to listen on a custom port.
* `dnsmasq_resolv_file` (*Optional*) -- set this to specify a custom `resolv.conf` file.

## Dependencies

None

## Example Playbook

Most Dnsmasq settings have sane defaults and don't have to be specified. The simplest configuration would be:<commit_msg>Added description<commit_after># Dnsmasq

This role can be used to set up Dnsmasq. Specifically, this role can be used to set up a simple DNS forwarder, and a DHCP server.

## Requirements

This role can be used on Linux systems with:

* the `yum` package manager,
* `firewalld`, which is used to configure the firewall.

That means a fairly recent Fedora, or RedHat/CentOS 7.

## Role Variables

* `dnsmasq_addn_hosts` (*Optional*) -- set this to specify a custom host file that should be read in addition to `/etc/hosts`.
* `dnsmasq_bogus_priv` (*Optional*) -- set this if Dnsmasq should not forward addresses in the non-routed address spaces.
* `dnsmasq_dhcp_hosts` (*Optional*) -- set this to reserve IP addresses for specific hosts. You should provide an array of hashes with keys `name` (optional), `mac` and `ip` for each reservation.
* `dnsmasq_dhcp_ranges` (*Optional*) -- set this to enable the DHCP server. You should specify an array of hashes (with keys `start_addr`, `end_addr`, and `lease_time`) for each address pool. See the example section below.
* `dnsmasq_domain_needed` (*Optional*) -- set this if Dnsmasq should not forward local requests (i.e. without domain name).
* `dnsmasq_domain` (*Optional*) -- set the domain for Dnsmasq.
* `dnsmasq_expand_hosts` (*Optional*) -- set this (and `dnsmasq_domain`) if you want to have a domain automatically added to simple names in a hosts-file.
* `dnsmasq_listen_address` (*Default value:* 127.0.0.1, set in `defaults/main.yml`) -- set this to specify the IP address of the interface that should listen to DNS/DHCP requests.
* `dnsmasq_option_router` (*Optional*) -- set this to specify the default gateway to be sent to clients.
* `dnsmasq_port` (*Optional*) -- set this to listen on a custom port.
* `dnsmasq_resolv_file` (*Optional*) -- set this to specify a custom `resolv.conf` file.

## Dependencies

None

## Example Playbook

Most Dnsmasq settings have sane defaults and don't have to be specified. The simplest configuration would be:
{'fraction_non_alphanumeric': 0.09675772274700026, 'fraction_numerical': 0.0035741639009446006, 'mean_word_length': 4.456824512534819, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4748836', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1173, 'n_words': 531}