lmn-client/roles/dhcp-dns-dnsmasq/tasks/main.yml
2019-05-25 22:44:59 +03:00

17 lines
449 B
YAML

- name: install dnsmasq package
apt:
name: dnsmasq
state: latest
- name: add client hostnames and IP addresses to /etc/hosts
lineinfile:
dest: /etc/hosts
line: "{{ item.1 }}\t{{ 'debian%03d' | format(item.0) }}"
with_indexed_items: "{{ dhcp_list }}"
notify: "restart dnsmasq"
- name: configure dnsmasq
template:
src: dnsmasq-transparent-proxy.j2
dest: /etc/dnsmasq.d/transparent-proxy
notify: "restart dnsmasq"