aboutsummaryrefslogtreecommitdiffstats
path: root/roles/space_server/tasks/resolved.yml
blob: d95d1d1f8f907ff8f4a77487e36730d84c4883b8 (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
---
#- name: Enable systemd-resolved
#  systemd:
#    name: systemd-resolved.service
#    enabled: yes
#    masked: no
#    state: started
#  when: "'container' not in ansible_env"
#- name: '- when in nspawn'
#  command: systemctl enable systemd-resolved.service
#  args:
#    creates: '/etc/systemd/system/multi-user.target.wants/systemd-resolved.service'
#  when: "'container' in ansible_env"
#
#- name: Use systemd-resolved
#  lineinfile:
#    path: /etc/nsswitch.conf
#    regexp: '^hosts:'
#    line: 'hosts: files resolve [!UNAVAIL=return] dns myhostname'

- name: Disable systemd-resolved
  systemd:
    name: systemd-resolved.service
    enabled: no
    masked: no
    state: stopped
  when: "'container' not in ansible_env"
- name: '- when in nspawn'
  command: systemctl disable systemd-resolved.service
  args:
    removes: '/etc/systemd/system/multi-user.target.wants/systemd-resolved.service'
  when: "'container' in ansible_env"

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