Commit 95c95af1 authored by Lars Beckers's avatar Lars Beckers
Browse files

dhcp-server: minor clean up

parent f833a31c
---
# file: roles/dhcp-server/handlers/main.yml
- name: reload systemd service files
command: systemctl daemon-reload
- name: restart dnsmasq
service: name=dnsmasq state=restarted
......@@ -2,43 +2,56 @@
# file: roles/dhcp-server/tasks/main.yml
- name: ensure we have the necessary packages
apt: name="{{item}}" state=present
apt:
name: "{{ item }}"
state: present
with_items:
- dnsmasq
- dnsmasq-utils
tags:
- packages
- dhcp-server
- name: ensure we have our group
group: name=dnsmasq state=present system=yes
group:
name: dnsmasq
state: present
system: yes
tags:
- group
- dhcp-server
- name: ensure we have our user
user: name=dnsmasq system=yes group=dnsmasq state=present
user:
name: dnsmasq
state: present
system: yes
group: dnsmasq
tags:
- user
- dhcp-server
- name: ensure we have our config
template: src=dnsmasq.conf dest=/etc/dnsmasq.conf
template:
src: dnsmasq.conf.j2
dest: /etc/dnsmasq.conf
notify:
- restart dnsmasq
tags:
- config
- dhcp-server
- name: ensure we have a tftp root dir
file: name="{{tftp_root}}" state=directory owner="{{dnsmasq_user}}" group="{{dnsmasq_group}}" mode=0755
file:
name: "{{ tftp_root }}"
state: directory
owner: "{{ dnsmasq_user }}"
group: "{{ dnsmasq_group }}"
mode: 0755
when: tftp_active
tags:
- config
- dhcp-server
- name: ensure the service is enabled
service: name=dnsmasq state=started enabled=yes
service:
name: dnsmasq
state: started
enabled: yes
tags:
- config
- dhcp-server
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment