aboutsummaryrefslogtreecommitdiffstats
path: root/roles/space_server/tasks/unbound.yml
blob: a3726a0a441c9f1bddb6cc637a4585e63ee3cfee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
- name: Install unbound package
  dnf:
    name:
    - policycoreutils # needed for unbound-keygen.service
    - unbound
    state: present
  tags:
  - packages

- name: Configure unbound
  template:
    dest: '/etc/unbound/unbound.conf'
    src: unbound.conf.j2
    owner: root
    group: root
    mode: 0644
  notify:
  - restart unbound

- name: Enable unbound service
  systemd:
    name: unbound.service
    enabled: yes
    masked: no
    state: started
  when: not chroot
- name: '- when in chroot'
  command: systemctl enable unbound.service
  args:
    creates: '/etc/systemd/system/multi-user.target.wants/unbound.service'
  when: chroot

- name: Use our own resolver
  copy:
    dest: '/etc/resolv.conf'
    content: "nameserver 127.0.0.1\nnameserver ::1\n"
    owner: root
    group: root
    mode: 0644

# vim: set ts=2 sw=2 et: