salt.modules.dnsmasq

Module for managing dnqmasq

salt.modules.dnsmasq.fullversion()

Shows installed version of dnsmasq, and compile options

CLI Example:

salt '*' dnsmasq.version
salt.modules.dnsmasq.get_config(config_file='/etc/dnsmasq.conf')

Dumps all options from the config file

CLI Examples:

salt '*' dnsmasq.get_config
salt '*' dnsmasq.get_config file=/etc/dnsmasq.conf
salt.modules.dnsmasq.set_config(config_file='/etc/dnsmasq.conf', follow=True, **kwargs)

Sets a value or a set of values in the specified file. By default, if conf-dir is configured in this file, salt will attempt to set the option in any file inside the conf-dir where it has already been enabled. If it does not find it inside any files, it will append it to the main config file. Setting follow to False will turn off this behavior.

If a config option currently appears multiple times (such as dhcp-host, which is specified at least once per host), the new option will be added to the end of the main config file (and not to any includes). If you need an option added to a specific include file, specify it as the config_file.

CLI Examples:

salt '*' dnsmasq.set_config domain=mydomain.com
salt '*' dnsmasq.set_config follow=False domain=mydomain.com
salt '*' dnsmasq.set_config file=/etc/dnsmasq.conf domain=mydomain.com
salt.modules.dnsmasq.version()

Shows installed version of dnsmasq

CLI Example:

salt '*' dnsmasq.version

Previous topic

salt.modules.djangomod

Next topic

salt.modules.dnsutil